我使用的是kendo图表,我希望y轴上的类别和x轴上的日期为静态,并希望滚动条表示图表而不是取div并且还希望条形尺寸小而字体大小应小于这个例子。
为了实现它,不得不这样做
app.component.ts更改如下:
@Component({
selector: 'my-app',
template: `
<div >
<kendo-chart style="width: 3832px" [valueAxis]="valueAxis" [ngStyle]="{ 'height.px': chartHeight }">
<kendo-chart-plot-area background="#F2F2F2"></kendo-chart-plot-area>
<kendo-chart-series>
<kendo-chart-series-item *ngFor="let series of model"
type="rangeBar" [spacing]="-1" [data]="series.data" [opacity]="0.8" fromField="Start" toField="End" categoryField="Category">
</kendo-chart-series-item>
</kendo-chart-series>
</kendo-chart>
</div>
`,
styles:[`
kendo-chart{ max-width: 525px; max-height: 300px;}
::ng-deep g>text{ font-size: 11px !important;}
`]
})