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

How can I limit the number of lines that show

2 Answers 142 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Iron
Iron
Veteran
Paul asked on 09 Apr 2020, 07:34 PM

I have integer based data. So I set my label format to be {0:N0}.If I have a limited data set (0, 1) I would only want two lines on the chart for 0 and 1. Instead I get lines for 0.0, 0.2, 0.4, 0.6, 0.8, 1.0 etc. Due to the value rounding these all appear as 0, 0, 0, 1, 1, 1. This looks really stupid.

Here's a Dojo showing what i mean: https://dojo.telerik.com/UvePaCOj/2

2 Answers, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 13 Apr 2020, 07:01 AM

Hi, Paul,

If I understand the desired outcome correctly, you can use the valueAxis.majorUnit property and set that to 1. In addition to that, you can add a valueAxis.max:

             valueAxis: {
                    labels: {
                        format: "{0:N0}"
                    },
                    majorUnit:1,
                    max:1,
                    line: {
                        visible: false
                    }
                },

Here is the updated Dojo for your reference: https://dojo.telerik.com/@bubblemaster/AWaVexah/2

Let us know what you think.

Regards,
Alex Hajigeorgieva
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
Paul
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 13 Apr 2020, 01:16 PM
Perfect the majorUnit property is what I wanted. Thank you!
Tags
Charts
Asked by
Paul
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Alex Hajigeorgieva
Telerik team
Paul
Top achievements
Rank 1
Iron
Iron
Veteran
Share this question
or