SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!
I want some specific behavior out of my X and Y axes. Right now I have custom code which modifies the ranges for the axes to get the behavior I want. It would be nice to just do this by setting options on the axes.
For my Y axis I want to use the AutoRange feature but the default seems a little crowded. Instead of it ranging to the min and max of the data series I want it to show a little room on the top and bottom.
For the X axis I want to show exactly the most recent hour of data.
Thanks for any help.
You can use the AxisBase.GrowBy property to achieve this. This will add a fractional padding above/below the axis (on X or Y axis). For an example, please see here:
<!-- Create the chart surface --> <SciChart:SciChartSurface Name="sciChart" SciChart:ThemeManager.Theme="ExpressionDark"> <!-- Declare RenderableSeries --> <SciChart:SciChartSurface.RenderableSeries> <SciChart:FastLineRenderableSeries SeriesColor="#FF4083B7" StrokeThickness="2"/> </SciChart:SciChartSurface.RenderableSeries> <!-- Create an X Axis with Growby --> <SciChart:SciChartSurface.XAxis> <SciChart:NumericAxis> <SciChart:NumericAxis.GrowBy> <SciChart:DoubleRange Min="0.1" Max="0.1"/> </SciChart:NumericAxis.GrowBy> </SciChart:NumericAxis> </SciChart:SciChartSurface.XAxis> <!-- Create a Y Axis with Growby --> <SciChart:SciChartSurface.YAxis> <SciChart:NumericAxis> <SciChart:NumericAxis.GrowBy> <SciChart:DoubleRange Min="0.1" Max="0.1"/> </SciChart:NumericAxis.GrowBy> </SciChart:NumericAxis> </SciChart:SciChartSurface.YAxis> </SciChart:SciChartSurface>
which results in this output:
Please login first to submit.