Pre loader

Export a chart after resising does not refreshed properly

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

1
0

Dear all,

In our application we have a chart that we need to explot into a BMP file at a given size.
For our scenario the process is as below :

1 – From the chart which is display to user at a default size we force the Width and Height of the chart to our desired size

mysciChart.Width = 480;
mysciChart.Height = 220;
mysciChart.UpdateLayout();

2 – We can then use the build in Export To file method to export the file

if (mysciChart.ActualWidth > 10 && mysciChart.ActualHeight > 10)
{
    mysciChart.ExportToFile(myBMPFile, ExportType.Bmp, false);
    }

The chart is then exported to correct size but it is not refresh with data as shown in picture attached

please note that the code above is executed in the Main UI thread dispatcher

Any idea how to get the chart properly render in Export, is there a kind of refresh something to call on the chart before export when we change its size ?

Thnaks for help

Version
4
Images
  • You must to post comments
0
0

You can try calling sciChartSurface.InvalidateElement(), which forces the chart to redraw itself.

However, such drawing is done lazily when the UI thread is free. To force a redraw right now, you can set

  scichartsurface.RenderPriority = RenderPriority.Immediate;
  scichartsurface.InvalidateElement();
  scichartsurface.RenderPriority = RenderPriority.Default;

Best regards
Andrew

  • You must to post comments
0
0

Hello Andrew, I have try your suggestion, it is partially working. The last issue I get with your solution is that the chart and the scale information is not matching what I have trying to export.

See in attached image the original chart I try to export and the result

Any suggestion to solve that last point ?

regards

Images
  • You must to post comments
Showing 2 results
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