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

How do I show only some of the category axis values

2 Answers 201 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Luca
Top achievements
Rank 1
Iron
Luca asked on 01 Dec 2015, 03:48 PM

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 Answers, 1 is accepted

Sort by
0
Eduardo Serra
Telerik team
answered on 02 Dec 2015, 08:32 AM
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!
 
0
Luca
Top achievements
Rank 1
Iron
answered on 02 Dec 2015, 09:02 PM

Hi, yes it's working fine now.

 Thanks for your help

Tags
Charts
Asked by
Luca
Top achievements
Rank 1
Iron
Answers by
Eduardo Serra
Telerik team
Luca
Top achievements
Rank 1
Iron
Share this question
or