Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
XamChart issue with StackedColumn Series
posted

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.