SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0
0

Hello,
I’m having some trouble because all the points in a DataSeries have the same value, and those values are rendered outside the surface. (By constant values I mean that all the values on the y axis are equal to 19.8).

If I put a zoom modifier on the chart and zoom out, I can find my values, but when the chart is displayed for the first time, they are not visible.
This makes me think that the scaling of the y axis is not calculated correctly on the chart.

I have attached a code example.

  • You must to post comments
0
0

Hi Straliciuc,

This can be resolved by setting a YAxis.GrowBy value as follows:

<s:SciChartSurface x:Name="sciChartSurface" s:ThemeManager.Theme="BrightSpark" >
    <s:SciChartSurface.ChartModifier>
        <s:ModifierGroup>
            <s:LegendModifier x:Name="legendModifier"/>
            <s:MouseWheelZoomModifier />
            <s:ZoomPanModifier  />
        </s:ModifierGroup>
    </s:SciChartSurface.ChartModifier>

    <!-- Defines the renderable series, which map 1:1 to data-series. R-Series may be styled -->
    <s:SciChartSurface.RenderableSeries>
        <s:FastLineRenderableSeries SeriesColor="Red" YAxisId="yAxis1"/>
    </s:SciChartSurface.RenderableSeries>

    <!-- Defines the XAxis -->
    <s:SciChartSurface.XAxis>
        <s:NumericAxis>
        </s:NumericAxis>
    </s:SciChartSurface.XAxis>

    <!-- Defines the YAxis -->
    <s:SciChartSurface.YAxes>
        <s:NumericAxis TickTextBrush="red"  AxisAlignment="Left" Id="yAxis1" >
          <s:NumericAxis.GrowBy>
            <s:DoubleRange Min="0.1" Max="0.1"/>
          </s:NumericAxis.GrowBy>
        </s:NumericAxis>
    </s:SciChartSurface.YAxes>
</s:SciChartSurface>

Note that the calculation to generate the YAxis range is as follows:

  1. Get data Min, Max of the axis
  2. If Min == Max, expand the range using GrowBy. Max = max+GrowBy.Max and Min = Min – GrowBy.Min

UPDATE: This issue was fixed in v2.0 or later of SciChart. It will now automatically expand the range around constant values even without a GrowBy.

Hope this helps!

Images
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.