How to always have a set amount of columns in a line chart?

1 Answer 51 Views
Charts
Stephanie
Top achievements
Rank 2
Iron
Stephanie asked on 16 Aug 2024, 05:52 PM

I have a kendo line chart with data that has a date and a value associated with each point. Also the total number of datapoints  can range from 10,000 to 0 depending on filters and other factors. I would like to set the number of columns/divisions on the chart to ALWAYS be 6 no matter how many points of data I have to display.

What I understand is I can set the divisions of the chart using maxDivisions but I have issues getting it to consistently set the columns/divisions number to display 6 every time.

Is it possible to set the columns/divisions to 6?

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Bechev
Telerik team
answered on 21 Aug 2024, 07:25 AM

Hello Stephanie,

Thank you for the provided screenshot.

Try setting the kendo-chart-category-axis-item baseUnitStep to auto and maxDateGroups to the desired number, like:

<kendo-chart-category-axis-item 
                baseUnitStep='auto' 
                [maxDateGroups]='6'>
            </kendo-chart-category-axis-item>

Here is an example:

https://stackblitz.com/edit/angular-hiy3ep

Let me know in case of any other questions.

Regards,
Martin Bechev
Progress Telerik

Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024

Stephanie
Top achievements
Rank 2
Iron
commented on 21 Aug 2024, 03:19 PM

Thank you this works great!
Tags
Charts
Asked by
Stephanie
Top achievements
Rank 2
Iron
Answers by
Martin Bechev
Telerik team
Share this question
or