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
60
XamChart - Background Shows Through Graph
posted

I am creating a XamChart with multiple background colors to represent visually if the current value is within a desired range.  I create a ViewBox so that the control will resize itself and place a XamChart inside of the view box.  I am using 3 area series to draw the 3 colored background ranges and then a line series to draw my data.  The issue here is when the control resizes from being inside of the ViewBox, pixels for a given x-value are not repainted properly and I end up with vertical lines across the graph the same color as the Background property's brush.  The graph looks fine once it gets to be a certain size, but as it becomes smaller, the vertical lines become visible.  Setting the Background property is not a solution since that colors both the graph and a large rectangular area around the graph.

 

 

        <Viewbox Name="m_oButtPressureContainer" Grid.Row="1" Grid.Column="2"
                     VerticalAlignment="Bottom">
            <Infragistics:XamChart Name="m_oButtPressureChart">

                <Infragistics:XamChart.Legend>
                    <Infragistics:Legend Visible="False"/>
                </Infragistics:XamChart.Legend>

                <Infragistics:XamChart.Axes>
                    <Infragistics:Axis AxisType="PrimaryX" Minimum="0" Maximum="100" AutoRange="False" Unit="101" StrokeThickness="10"/>
                    <Infragistics:Axis AxisType="PrimaryY" Minimum="0" Maximum="255" AutoRange="False" Unit="256" StrokeThickness="10"/>
                </Infragistics:XamChart.Axes>

                <Infragistics:XamChart.Series>
                    <Infragistics:Series ChartType="Area" Fill="Red" Name="m_oButtPressureUpperOutOfRangeSeries" StrokeThickness="0"/>
                    <Infragistics:Series ChartType="Area" Fill="Green" Name="m_oButtPressureInRangeSeries" StrokeThickness="0"/>
                    <Infragistics:Series ChartType="Area" Fill="Red" Name="m_oButtPressureLowerOutOfRangeSeries" StrokeThickness="0"/>
                    <Infragistics:Series ChartType="Line" Fill="Black" Name="m_oButtPressureDataSeries"/>
                </Infragistics:XamChart.Series>

            </Infragistics:XamChart>
        </Viewbox>

Parents Reply Children