Line Chart with Negative Values xaxis labels

2 posts, 0 answers
  1. Andy
    Andy avatar
    25 posts
    Member since:
    Aug 2011

    Posted 29 May 2013 Link to this post

    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
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 30 May 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top