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.

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.