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

Kendo Charts - How to manually set category access min/max?

1 Answer 193 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 19 Dec 2018, 06:39 PM

I'm currently using Kendo UI with jQuery and have a line graph being rendered from a kendoChart object. I've noticed that the category axis (x axis) min and max date renders entirely based off of the data that is returned, using the earliest date as the starting point and latest as the end point. For the life of me, I can not find a way to manually set the start and end date on the chart before it renders. On the flipside, I was able to find where you set the value axis (y axis) min and max by using the chart.dataSource.options.valueAxis.min/max object.

Am I doing something wrong? Is this possible to do or is it unsupported?

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 21 Dec 2018, 01:39 PM
Hi Michael,

You can use the categoryAxis.min and categoryAxis.max properties to change the axis min and max values:
categoryAxis: {
  baseUnit: "days",
  min: "2011/12/16",
  max: "2012/1/16",
  labels: {
    rotation: "auto"
  }
}

Here is a Dojo example where you can see the result:
https://dojo.telerik.com/ijadapaM

I also added logic to update the axis range on click of a button in case you were asking about updating the range dynamically.

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Charts
Asked by
Michael
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or