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!

1 vote
223 views

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 4 weeks ago
  • last active 5 days ago
0 votes
1k views

I’m implementing exporting charts. As part of my export, the user can specify the size of the chart. I’ve managed to get sciChartSurface.ExportToBitmapSource() working fine for single graphs.

However, I’ve got some quite complex layouts, and when I try to render parent controls that contain Scichart controls manually, with say:

ExportUIElement.Measure(size);
ExportUIElement.Arrange(new Rect(size));

 int dpiScaling = 3;
RenderTargetBitmap bmp = new RenderTargetBitmap(Width * dpiScaling, Height * dpiScaling,
                                                                                                           96 * dpiScaling, 96 * dpiScaling,
                                                                                                           PixelFormats.Pbgra32);

I’m finding everything working, the chart layout & axis/labels update and render fine, but the chart content is not re-rendered to the new size, causing some messy/strange visual effects. This one was arranged to a larger size, you can see that the actual chart content is now sitting snugly in the middle of a large margin:

enter image description here

Can I force Scichart to re-render these so I can manually render the component in a different size?

  • Ken Hobbs asked 2 years ago
  • last active 1 year ago
1 vote
974 views

I would like to call ThemeManager.SetTheme to change the theme, export an image to file, and then restore the original theme. How can I ensure that the new theme has been applied before calling ExportToFile?

is there a better way to capture a screenshot of a plot using a different theme?

Bill

0 votes
0 answers
861 views

hi,
I am using ExpressionDark theme for my scichart surface.
I want to do ExportToFile after changing theme to BrightSpark.
When I do exporttofile after change the theme to BrightSpark, my exported image is still in ExpressionDark.

I do it like below.

ThemeManager.SetTheme(Chart, “BrightSpark”);
var tempFileName = Path.GetTempFileName();
Chart.ExportToFile(tempFileName, ExportType.Png);
var i = Image.FromFile(tempFileName);

Can some one help please?

Showing 4 results
This template supports the sidebar's widgets. Add one or use Full Width layout.