We are currently using Kendo UI for Angular in our project and have implemented the Kendo bar chart. Currently the bar size is responsive based on the chart height. We need to set that bar to a fixed size as per the jQuery example below.
Anyone have any thoughts on doing this in Angular?
https://docs.telerik.com/kendo-ui/controls/charts/how-to/appearance/fixed-bar-size
It is possible to use the same approach for the angular chart:
<kendo-chart>
<kendo-chart-series>
<kendo-chart-series-item type="bar"[data]="[1, 2]" [visual]="barVisual">
</kendo-chart-series-item>
</kendo-chart-series>
</kendo-chart>
// component
public barVisual(e: any): void {
//create the default visual
const visual = e.createVisual();
//scale it so that it has the predefined size
visual.transform(geometry.transform().scale(1, BAR_SIZE / e.rect.size.height, e.rect.center() ));
return visual;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.