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

2
2

var lineData = new XyDataSeries<DateTime, double>();

if I have a XyDataSeries<DateTime, double> then I can get the sweeping animation to work. If I change the XyDataSeries to XyDataSeries<DateTime, int> it fails to produce the chart and gives an exception stating

SciChartSurface didn’t render, because an exception was thrown:
Message: Specified cast is not valid.

Stack Trace: at SciChart.Charting.Visuals.RenderableSeries.Animations.Transformations.Point2DSeriesTransformation1.SweepTransform(T pointSeries, Double currentProgress)
at SciChart.Charting.Visuals.RenderableSeries.Animations.Transformations.Point2DSeriesTransformation
1.O(IPointSeries D, Double I)
at SciChart.Charting.Visuals.RenderableSeries.Animations.SweepAnimation.Animate(IRenderPassData rpd, Double currentProgress)
at SciChart.Charting.Visuals.RenderableSeries.Animations.SeriesAnimationBase.OnRender(IRenderPassData rpd)
at SciChart.Charting.Visuals.RenderableSeries.BaseRenderableSeries.WFB(IRenderContext2D D, IRenderPassData I)
at A.IJ.T(ISciChartSurface D, RenderPassInfo I, IRenderContext2D J, Int32 M)
at A.IJ.M(ISciChartSurface D, RenderPassInfo I, IRenderContext2D J)
at A.IJ.RenderLoop(IRenderContext2D renderContext)
at SciChart.Charting.Visuals.SciChartSurface.DoDrawingLoop()

Is this possible or does yaxis have to be a double? If I use fade animation it works properly. Thanks.

Version
5.4
  • You must to post comments
1
0

Hi John,

I’ve just investigated this, by making the following adjustment to our CandlestickChartExample (see this example here):
https://www.scichart.com/example/wpf-chart-example-candlestick-chart/

This is my modification:

private void CandlestickChartExampleView_OnLoaded(object sender, RoutedEventArgs e)
{
    // Create a dataset of type x=DateTime, y=Double
    var dataSeries = new OhlcDataSeries<DateTime, int>();                     

    // Prices are in the format Time, Open, High, Low, Close (all IList)
    var prices = DataManager.Instance.GetPriceData(Instrument.Indu.Value, TimeFrame.Daily);            

    // Append data to series. SciChart automatically redraws
    dataSeries.Append(
        prices.TimeData,
        prices.OpenData.Select(x =>(int)x),
        prices.HighData.Select(x => (int)x),
        prices.LowData.Select(x => (int)x),
        prices.CloseData.Select(x => (int)x));

    sciChart.RenderableSeries[0].DataSeries = dataSeries;

    // Zoom Extents - necessary as we have AutoRange=False
    sciChart.ZoomExtents();
}

Making this change I don’t see any crashes for the Sweep Animation (I am working on v5.4.1, which is our latest nightly build of SciChart WPF v5.x).

I also added some more unit-test cases for Sweep Animation to test different data-types and don’t see any problems.

Can you make the above change and confirm if you see the same? How can we reproduce this crash?

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

SciChart WPF v6 BETA released! Note pricing/licensing changes are coming. Contact us to beat the rise!Read more
+