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

XAxis.MinValue does not work

2 Answers 73 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Mario
Top achievements
Rank 1
Mario asked on 14 Mar 2014, 04:40 PM
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 Answers, 1 is accepted

Sort by
0
Mario
Top achievements
Rank 1
answered on 14 Mar 2014, 04:44 PM
Sorry, the forum didn't attach the screenshot.
0
Danail Vasilev
Telerik team
answered on 17 Mar 2014, 12:36 PM
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.

 
Tags
Chart (HTML5)
Asked by
Mario
Top achievements
Rank 1
Answers by
Mario
Top achievements
Rank 1
Danail Vasilev
Telerik team
Share this question
or