This is a migrated thread and some comments may be shown as answers.

X and Y Axis should come with Integer value

2 Answers 422 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 20 Apr 2020, 06:28 AM

I am using Kendo scatter chart by default x and y axis data are coming decimal. i want integer only. i don't want to use Majorunit because it has to be calculated based on series.

<kendo-chart-series>
<kendo-chart-series-item type="scatter" [data]="graphData" xField="inc_margin_amt" yField="inc_sales_amt">
</kendo-chart-series-item>
</kendo-chart-series>
<kendo-chart-x-axis>
<kendo-chart-x-axis-item [min]="graph.xModel.min" [max]="graph.xModel.max">
</kendo-chart-x-axis-item>
</kendo-chart-x-axis>
<kendo-chart-y-axis>
<kendo-chart-y-axis-item [min]="graph.yModel.min" [max]="graph.yModel.max">
</kendo-chart-y-axis-item>
</kendo-chart-y-axis>

Attaching the image for your reference .

2 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 21 Apr 2020, 10:16 AM

Hello Sam,

The axis item labels.format option can be used to set the preferred formatting for the labels:

https://www.telerik.com/kendo-angular-ui/components/charts/api/XAxisItemComponent/#toc-labels

https://www.telerik.com/kendo-angular-ui/components/charts/api/XAxisLabels/#toc-format

Here is an example, demonstrating this approach:

https://stackblitz.com/edit/angular-4paf5w?file=app/app.component.ts

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Sam
Top achievements
Rank 1
answered on 22 Apr 2020, 05:03 AM
Thank you so much.. appreciate your efforts.
Tags
Charts
Asked by
Sam
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Sam
Top achievements
Rank 1
Share this question
or