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

Value Axis does not scale automatically if MajorUnit is set

3 Answers 256 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Poonam
Top achievements
Rank 1
Poonam asked on 06 Sep 2013, 09:17 PM
Hi,
I am try to use kendo chart 's MajorUnit functionality to show the value axis labels as integer values but with big numbers labels get overlapped, and if I do not use MajorUnit the kendo chart display labels in decimal that looks inappropriate for integer values. I also want to scale labels automatically according to the max value in the series, but I am not getting  these two functionalities together.

Please help me how I can show only integer labels on value axis as well as auto scaling.

Thank you & Regards,

Poonam

3 Answers, 1 is accepted

Sort by
0
Iliana Nikolova
Telerik team
answered on 09 Sep 2013, 02:34 PM
Hi Poonam,

I am afraid what you would like to achieve is not supported -> basically to display only integer values on the valueAxis you should set majorUnit: 1. As a workaround I can suggest you to dynamically set min / max / majorUnit values via the chart.options
  //get reference to the Chart widget
  var chart = $("#chart").data("kendoChart");
  //set max to the valueAxis
  chart.setOptions({valueAxis: {max: 100}});
  //set majorUnit
  chart.setOptions({valueAxis: {majorUnit: 1}});
  //refresh the Chart
  chart.refresh();


 Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Poonam
Top achievements
Rank 1
answered on 09 Sep 2013, 07:03 PM
Hi Iliana,

Thank you for the solution.

Regards,

Poonam
0
Kate | D-Flo
Top achievements
Rank 1
answered on 28 Nov 2013, 12:57 PM
Just in case, if you need to reset the majorUnit back to default, do this:
$("#chart").data('kendoChart').options.valueAxis.majorUnit = undefined;
Tags
Charts
Asked by
Poonam
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
Poonam
Top achievements
Rank 1
Kate | D-Flo
Top achievements
Rank 1
Share this question
or