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

X-Axis label values round

3 Answers 73 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Gabriel
Top achievements
Rank 1
Gabriel asked on 04 Jul 2013, 01:29 AM

Hi, anyone knows how to round the numbers on an x axis, I have values like 2, 3  4 and my a axis has 0 0.5, 1, 1.5 , 2, 2.5 etc

how do I only show 1, 2 3 4 5 etc? and hide 0.5, 1.5, 2.5

These are products sales, I cant show halves ...

thanks.

3 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 04 Jul 2013, 03:14 PM
Hello Gabriel,

You can use the Step property of the Axes, in order to set the interval of the axes labels. For example:
<telerik:RadHtmlChart runat="server" ID="ColumnChart" Width="800" Height="500" Transitions="true"
    Skin="Forest">
    <PlotArea>
        <XAxis Step="1">
        </XAxis>
        <YAxis Step="1">
        </YAxis>
        <Series>
            <telerik:ScatterLineSeries>
                <SeriesItems>
                    <telerik:ScatterSeriesItem Y="0.5" X="0.5"></telerik:ScatterSeriesItem>
                    <telerik:ScatterSeriesItem Y="2.5" X="2.5"></telerik:ScatterSeriesItem>
                    <telerik:ScatterSeriesItem Y="3.5" X="3.5"></telerik:ScatterSeriesItem>
                </SeriesItems>
            </telerik:ScatterLineSeries>
        </Series>
    </PlotArea>
</telerik:RadHtmlChart>

You can also find useful the Configuring Axes help article.

Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Gabriel
Top achievements
Rank 1
answered on 08 Jul 2013, 05:35 PM

thanks, that did work for small values, when the values exceed 20 the axis labels become very cluttered, I will deal with that progrmatically then, thanks for the tip though, it was what I missed ,,, :D


0
Stamo Gochev
Telerik team
answered on 11 Jul 2013, 08:24 AM
H Gabrieli,

I am glad to hear that you have successfully applied our suggestion. You should also know that we have planned to introduce (n our next major release) Step and Skip properties which will resolve the issue with cluttered labels

Regards,
Stamo Gochev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Chart (HTML5)
Asked by
Gabriel
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Gabriel
Top achievements
Rank 1
Stamo Gochev
Telerik team
Share this question
or