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

When trying to implement chart printing based on the xps example, I came across some wierd behaviour. In my scenario I’m using the same instance of the viewmodel as datacontext for the chart shown in GUI and the chart created in the CreateSciChartSurfaceWithoutShowingIt method. This causes the chart shown in the GUI to loose all it’s axis and datas. I have a suspicion this caused by the chart loosing it’s databining. In the attached example I have added to charts to the GUI and both are using the same instance of the viewmodel, to make it more clear. Only one chart works as expected. If trying to print to xps, both charts in the GUI looses their data. Please advice. Tnxs in advance. Keep up the good work

Attachments
  • You must to post comments
0
0

Hi Oddvin,

This issues appears because of SeriesSource inner implementation. But there is simple workaround – you just need to use DataSet instead. Also, you need to comment out this row from CreateSciChartSurfaceWithoutShowingIt(…) method to prevent chart from disappearance after printing:

        private Visual CreateSciChartSurfaceWithoutShowingIt(Size size)
        {
            // Create a fresh ChartView, this contains the ViewModel (declared in XAML) and data
            var control = new ChartView();
            var scs = control.SciChartSurface;

            //Comment out this line
            //scs.DataContext = this.customUserControl.SciChartSurface.DataContext;
...
}

Hope this helps! Please, let us know if you need any further assistance with this,

Best regards,
Yuriy

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.