Hello there,
When I try to set the AutoRange to false on a chart having a StackedColumn Series and set the Chart Primary X-Axis Minimum to Other than 0 I get a run time exception saying the "Width and Height should be non-negative". Can you please let me know what could be wrong.
The code looks some thing like this.
<igCA:XamChart Name="xamChart5" ChartRendered="xamChart5_ChartRendered"> <!-- Legend --> <!--<igCA:XamChart.Legend> <igCA:Legend Visible="False"/> </igCA:XamChart.Legend>--> <!-- Scene --> <igCA:XamChart.Scene> <igCA:Scene> <igCA:Scene.GridArea> <igCA:GridArea/> </igCA:Scene.GridArea> </igCA:Scene> </igCA:XamChart.Scene> <!-- Data points --> <igCA:XamChart.Series> <igCA:Series Label="France" ChartType="stackedColumn" UseDataTemplate="True"> <igCA:Series.DataPoints> <igCA:DataPoint Value="2" Label="2002"/> <igCA:DataPoint Value="4" Label="2003"/> <igCA:DataPoint Value="8" Label="2004"/> <igCA:DataPoint Value="5" Label="2005"/> <igCA:DataPoint Value="6" Label="2006"/> </igCA:Series.DataPoints> </igCA:Series> <!-- Data points --> <igCA:Series Label="Greece" ChartType="stackedColumn" UseDataTemplate="True"> <igCA:Series.DataPoints> <igCA:DataPoint Value="6" OverridesDefaultStyle="True" Style="{Binding XamDatapointStyle}"/> <igCA:DataPoint Value="5" OverridesDefaultStyle="True" Style="{Binding XamDatapointStyle}"/> <igCA:DataPoint Value="7" OverridesDefaultStyle="True" Style="{Binding XamDatapointStyle}"/> <igCA:DataPoint Value="3" OverridesDefaultStyle="True" Style="{Binding XamDatapointStyle}"/> <igCA:DataPoint Value="4" OverridesDefaultStyle="True" Style="{Binding XamDatapointStyle}"/> </igCA:Series.DataPoints> </igCA:Series> </igCA:XamChart.Series> <!-- Axes --> <igCA:XamChart.Axes> <igCA:Axis AxisType="PrimaryX" Unit="2" AutoRange="False" Minimum="1" Maximum="4"> <igCA:Axis.MinorGridline> <igCA:Mark Stroke="DarkBlue" StrokeThickness="2" Unit="1"/> </igCA:Axis.MinorGridline> </igCA:Axis> <igCA:Axis AxisType="PrimaryY" Unit="1"> <igCA:Axis.MinorGridline> <igCA:Mark Stroke="DarkViolet" StrokeThickness="2" Unit="1"/> </igCA:Axis.MinorGridline> <igCA:Axis.Stripes> </igCA:Axis.Stripes> </igCA:Axis> </igCA:XamChart.Axes> </igCA:XamChart>
Thanks in advance,
Pavan Dudday.
Hello,
This exception is probably caused by the PrimaryX axis which in your case is used for the labels. You can specify AutoRange,Minimum and Maximum properties only for numeric Axes (like PrimaryY). You may refer to our online documentation for more details here
Let me know if you have any questions with this matter.
Vlad
Hello Vlad,
Thanks for the quick response.
Yes the exception is caused by the PrimaryX axis.
I use the Primary XAxis for Dates (DateTime in C#) and the corresponding values on the Y-Axis. When I want to show the data between two particular dates I change the Axis Min, Max and Unit Number according to my need. This works fine with the other series basically, the line, Area, and Column series. The problem is only with the stackedcolumn series. I dont see any reason that this should fail since all the other series work fine.
Please let me know if you need more details on this.
Regards,
Pavan.
Pavan,
It seems like an issue with the XamChart control. I will create a support ticket on your behalf so we can continue discussion.
Thanks for submitting this to us.