Pre loader

Unable to use sweepanimation when value is something other than a double

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums


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.

  • You must to post comments

Hi John,

I’ve just investigated this, by making the following adjustment to our CandlestickChartExample (see this example here):

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
        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

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,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies