how to set minimum and maximum value for line series (WPF)

Charts for WPF Forum

Posted 1 month ago by Lee Zheng Yang
Version: 24.1.4
Avatar

I am trying to set the minimum and maximum values for my LineSeries so that the graph doesn't fluctuate too much when small values change. However, I can't find a way to set the minimum and maximum values for the axis  in my XAML code. How can I configure these values for my lineseries?

my code as below :

<charts:XYChart Width="280" GridLineMajorBrush="LightGray" GridLineMinorBrush="LightGray" GridLineMajorVisibility="X" Height="160" Margin="0,5,0,0" FontSize="12" Background="Transparent" Foreground="Gray" FontWeight="Bold" >


<charts:LineSeries ItemsSource="{Binding MotorDataPoints}"
XPath="X" YPath="Y" MarkerVisibility="All" />


</charts:XYChart>

Comments (3)

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

The Axis QuickStart has this example that shows how an axis can be defined with a Minimum and Maximum set:

<sampleBrowser:LabeledCardControl Label="Y axis with minimum and maximum specified">
	<charts:XYChart Style="{StaticResource ChartStyle}">
		<charts:XYChart.XAxes>
			<charts:XYDoubleAxis AreLabelsVisible="False" AreMajorTicksVisible="False" AreMinorTicksVisible="False" />
		</charts:XYChart.XAxes>
		<charts:XYChart.YAxes>
			<charts:XYDoubleAxis AreMajorTicksVisible="True" TickMajorInterval="5" TickMinorInterval="2.5" Minimum="-40" Maximum="40"/>
		</charts:XYChart.YAxes>
		<charts:LineSeries Style="{StaticResource LineSeriesStyle}"/>
	</charts:XYChart>
</sampleBrowser:LabeledCardControl>


Actipro Software Support

Posted 1 month ago by Lee Zheng Yang
Avatar

minimum and maximum property is not available in <charts:XYChart> and <charts:LineSeries> in my code, am i using the line series graph wrongly?

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Please see the example code snippet above.  The Minimum and Maximum are set on the XYDoubleAxis class.


Actipro Software Support

The latest build of this product (v24.1.5) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.