Prevent lines disappearing at Y-Axis Max/Min

Thread is closed for posting
2 posts, 0 answers
  1. iTools
    iTools avatar
    28 posts
    Member since:
    Jun 2007

    Posted 03 Feb 2010 Link to this post

    Hi

    We have a line graph plotting percentages over time.  Being percentages, the minimum value on the y-axis is 0% and maximum is 100%.

    When a series goes to either extreme (0 or 100%) for more than one unit of time, it effectively disappears and limits readability.  (see attachment).  We would like these lines to remain visible.

    Any thoughts on how prevent this would be appreciated.

    Cheers
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 08 Feb 2010 Link to this post

    Hello jan fischer,

    Unfortunately there are only two possible options here but I am not quite sure whether they will be useful for your scenario that displays percentage values on the YAxis as both options require extending the YAxis range and values like -20% and 120% would look a bit odd:

    • You can set the YAxis.AxisMode property to "Extended" and that will automatically extend the YAxis range with a single step above the maximum range value:
    <telerik:RadChart ID="RadChart1" runat="server">
        <Series>
            <telerik:ChartSeries Type="Line">
                <Items>
                    <telerik:ChartSeriesItem YValue="21" />
                    <telerik:ChartSeriesItem YValue="10" />
                    <telerik:ChartSeriesItem YValue="0" />
                    <telerik:ChartSeriesItem YValue="0" />
                    <telerik:ChartSeriesItem YValue="100" />
                    <telerik:ChartSeriesItem YValue="100" />
                    <telerik:ChartSeriesItem YValue="50" />
                </Items>
            </telerik:ChartSeries>
        </Series>
        <PlotArea>
            <YAxis AxisMode="Extended" />
        </PlotArea>
    </telerik:RadChart>
    • Alternatively, you can set YAxisRange.AutoScale to false and extend the YAxis range in both directions manually:
    <telerik:RadChart ID="RadChart1" runat="server">
        <Series>
            <telerik:ChartSeries Type="Line">
                <Items>
                    <telerik:ChartSeriesItem YValue="21" />
                    <telerik:ChartSeriesItem YValue="10" />
                    <telerik:ChartSeriesItem YValue="0" />
                    <telerik:ChartSeriesItem YValue="0" />
                    <telerik:ChartSeriesItem YValue="100" />
                    <telerik:ChartSeriesItem YValue="100" />
                    <telerik:ChartSeriesItem YValue="50" />
                </Items>
            </telerik:ChartSeries>
        </Series>
        <PlotArea>
            <YAxis AutoScale="false" MinValue="-20" MaxValue="120" Step="20" />
        </PlotArea>
    </telerik:RadChart>


    Greetings,
    Manuel
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
Back to Top