1

I have a simple SciChart surface that gets auto-zoomed by using AutoRange="Always", so as my data changes the XAxis and YAxis get recalculated so that all information on the chart can be shown.

However, the auto-range sets the XAxis and YAxis a little too small, causing some point markers to be cut off on the chart.
Is there a way I can add padding to the auto-range so that I can ensure all of my point markers are shown entirely?

Here is an example of the cutoff (check the points in the bottom-left and top-right corners): Example showing point markers being cut off

My chart in XAML:

<s:SciChartSurface Grid.Column="1" x:Name="sciChartSurfaceScores" 
        ChartTitle="Scores Plot"
        RenderableSeries="{s:SeriesBinding MySeries}">

        <s:SciChartSurface.XAxis>
            <s:NumericAxis AutoRange="Always" />
        </s:SciChartSurface.XAxis>

        <s:SciChartSurface.YAxis>
            <s:NumericAxis AutoRange="Always"/>
        </s:SciChartSurface.YAxis>

        <!-- Chart Modifiers -->
        <s:SciChartSurface.ChartModifier>
            <s:ModifierGroup>
                <!--  Modifier - ZoomExtents  -->
                <s:ZoomExtentsModifier />
                <s:RolloverModifier  ShowTooltipOn="MouseHover"/>
                <s:CursorModifier SnappingMode="TooltipToSeries"/>
            </s:ModifierGroup>
        </s:SciChartSurface.ChartModifier>
</s:SciChartSurface>
Dr. Andrew Burnett-Thompson
  • 20,980
  • 8
  • 88
  • 178
Kyle Williamson
  • 2,251
  • 6
  • 43
  • 75
  • Technically, the points *are* shown on the chart. But I need to somehow add a buffer so that it can be more easily visible for the user. – Kyle Williamson Sep 03 '21 at 14:54

1 Answers1

2

I can suggest use the GrowBy feature in SciChart. This adds a padding to the automatically calculated Axis ranges.

To do this, use this code:

<s:SciChartSurface.XAxis>
    <s:NumericAxis AutoRange="Always" GrowBy="0.1, 0.1" />
</s:SciChartSurface.XAxis>

<s:SciChartSurface.YAxis>
    <s:NumericAxis AutoRange="Always" GrowBy="0.1, 0.1" />
</s:SciChartSurface.YAxis>

GrowBy is a fractional padding, so min=0.1, max=0.2 means '10% at the minimum visible range and 20% at the maximum'

Try playing with that property and see how it works out

Dr. Andrew Burnett-Thompson
  • 20,980
  • 8
  • 88
  • 178