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

Prevent lines disappearing at Y-Axis Max/Min

1 Answer 70 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
iTools
Top achievements
Rank 1
iTools asked on 03 Feb 2010, 11:20 PM
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

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 08 Feb 2010, 01:42 PM
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.
Tags
Chart (Obsolete)
Asked by
iTools
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or