How do I show only some of the category axis values

3 posts, 0 answers
  1. Luca
    Luca avatar
    11 posts
    Member since:
    Jul 2012

    Posted 01 Dec 2015 Link to this post

    Hi,

     I'm trying to create a chart that shows the performance of a machine.

    The datasource is an XML with N records containing a value and the acquisition date ( by minutes ). This XML can contain up to 1440 records ( 24Hours )

    When the chart renders I would like to see as category Axis labels, only the hours ( see Result.PNG )

     I tried to do so:

     categoryAxis: {
                        field: "end_time",
                        baseUnit: "minutes",
                        minorUnit: 60,
                        labels: {
                            format: 'hh tt'
                        }
                    }

     but is not working ( WrongResult.PNG ) Do you have any suggestions?

    Thanks

    Luca

     

     

  2. Eduardo Serra
    Admin
    Eduardo Serra avatar
    51 posts

    Posted 02 Dec 2015 Link to this post

    Hello Luca,

    The first thing we have to do to handle this scenario is to set the step property of the labels of the category axis so they don't get overlapped. You would want this step property to be equal to 60 to show only one label per hour. Try this and let's see how it looks:

    categoryAxis: {
        field: "end_time",
        baseUnit: "minutes",
        minorUnit: 60,
        labels: {
            step: 60,
            format: 'hh tt'
        }
    }

    Tell us how it looks, or better yet, create a Kendo UI Dojo that replicates your scenario so we can edit it for ourselves, and we'll take it from there.

    Regards,
    Eduardo Serra
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Luca
    Luca avatar
    11 posts
    Member since:
    Jul 2012

    Posted 02 Dec 2015 in reply to Eduardo Serra Link to this post

    Hi, yes it's working fine now.

     Thanks for your help

Back to Top