How can I limit the number of lines that show

3 posts, 0 answers
  1. Paul
    Paul avatar
    5 posts
    Member since:
    Jun 2018

    Posted 09 Apr Link to this post

    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. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    954 posts

    Posted 13 Apr Link to this post

    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.
  3. Paul
    Paul avatar
    5 posts
    Member since:
    Jun 2018

    Posted 13 Apr in reply to Alex Hajigeorgieva Link to this post

    Perfect the majorUnit property is what I wanted. Thank you!
Back to Top