XAxis.MinValue does not work

3 posts, 0 answers
  1. Mario
    Mario avatar
    26 posts
    Member since:
    Oct 2011

    Posted 14 Mar 2014 Link to this post

    Hello,
    I have a RadHtmlChart in which i dinamically create LineSeries. I have successfully set Chart.PlotArea.YAxis.MaxValue and Chart.PlotArea.YAxis.MinValue, but XAxis.MinValue does not work. I'd like to start the series in a way that the first value "thouches" the y-axis. Because in xaxis i have 2006 as first year, I tried to set XAxis.MinValue = 2006, but I always got a gap between the y-axis and the first value in the chart (it seems that the start of xaxis is the half of 2005). I see the same gap at the end of the chart.

    In attachment the screenshot of chart.

    Thanks
  2. Mario
    Mario avatar
    26 posts
    Member since:
    Oct 2011

    Posted 14 Mar 2014 in reply to Mario Link to this post

    Sorry, the forum didn't attach the screenshot.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1494 posts

    Posted 17 Mar 2014 Link to this post

    Hello Mario,

    You can set the justified property of the x-axis through the chartObject which controls that behavior. For example:
    JavaScript:
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script>
            function pageLoad() {
                var chart = $find("<%=LineChart.ClientID%>");
                chart._chartObject.options.categoryAxis.justified = true;
                chart.repaint();
            }
        </script>
    </telerik:RadCodeBlock>
    ASPX:
    <telerik:RadHtmlChart runat="server" ID="LineChart" Width="800" Height="500" Transitions="true">
        <PlotArea>
            <Series>
                <telerik:LineSeries Name="Week 15" MissingValues="Interpolate">
                    <SeriesItems>
                        <telerik:CategorySeriesItem Y="15" />
                        <telerik:CategorySeriesItem Y="23" />
                        <telerik:CategorySeriesItem />
                        <telerik:CategorySeriesItem Y="71" />
                        <telerik:CategorySeriesItem Y="93" />
                        <telerik:CategorySeriesItem Y="43" />
                        <telerik:CategorySeriesItem Y="23" />
                    </SeriesItems>
                </telerik:LineSeries>
            </Series>
        </PlotArea>
    </telerik:RadHtmlChart>

    You may also find useful this feedback item that sheds more light on the matter.

    Regards,
    Danail Vasilev
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
Back to Top