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
- sc sc asked 6 years ago
- last edited 6 years ago
- You must login to post comments
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
- Andrew Burnett-Thompson answered 6 years ago
- You must login to post comments
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
- sc sc answered 6 years ago
- You must login to post comments
Please login first to submit.