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

Line Chart with Negative Values xaxis labels

1 Answer 145 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Iron
Andy asked on 30 May 2013, 01:40 AM
On my line chart with negative values the x-axis labels are under the '0' instead of under the chart.  

See attached image.

Is there a way to fix this?

Andy

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 30 May 2013, 11:39 AM
Hi Andy,

The RadHtmlChart sets its AxisCrossingValue of the YAxis to 0 by default and that is why the XAxis crosses the YAxis through the 0 point. You can, however, control this behavior through the AxisCrossingValue property of the YAxis, as follows:
<telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="800px" Height="400px">
    <PlotArea>
        <Series>
            <telerik:LineSeries>
                <Items>
                    <telerik:SeriesItem YValue="500" />
                    <telerik:SeriesItem YValue="1000" />
                    <telerik:SeriesItem YValue="-500" />
                    <telerik:SeriesItem YValue="-1000" />
                </Items>
            </telerik:LineSeries>
        </Series>
        <XAxis>
            <Items>
                <telerik:AxisItem LabelText="Item1" />
                <telerik:AxisItem LabelText="Item2" />
                <telerik:AxisItem LabelText="Item3" />
                <telerik:AxisItem LabelText="Item4" />
            </Items>
        </XAxis>
        <YAxis AxisCrossingValue="-2000">
        </YAxis>
    </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 their blog feed now.
Tags
Chart (HTML5)
Asked by
Andy
Top achievements
Rank 1
Iron
Answers by
Danail Vasilev
Telerik team
Share this question
or