Mangesh Kulkarni
Mangesh Kulkarni

Reputation: 237

Setting Category Axis Label Step Dynamically in Kendo Chart

I have implemented the Kendo line chart using following code for category axis

categoryAxis: {
categories: model.CycleDateRangeList,
        labels: {
        template: '#= kendo.toString(new Date(value), "dd")#',
                step:2
        },
        baseUnit: "days",
        majorGridLines: {
        visible: false
        }
}

This is working great.Currently Labels step are set to 2. I want to set them to 1 on chart click how can I achieve this using jquery?

Upvotes: 1

Views: 7140

Answers (1)

ezanker
ezanker

Reputation: 24738

You can use the setOptions() method of the chart to update the step property of the axis:

chart.setOptions({ categoryAxis: { labels: {step: 1} } });

API Doc: http://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart#methods-setOptions

Demo: http://dojo.telerik.com/@ezanker/Ohino

Upvotes: 3

Related Questions