Pre loader

Legend offscreen rendering

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

0
0

I referred to “Offscreen Rendering to Bitmap” topic and was able to save the graph but the legend is not getting saved. Can you please help me with including the legend in the offscreen rendering?

Currently we have placed the legend on a floating canvas so that user can move it around incase the legend grows biggers and obstructs the graph display.

  • You must to post comments
0
0

Hello there,

Rendering to bitmap is provided by WPF, not by SciChart, so all you need to do is to place both elements – the chart & the legend – inside a Grid or other UserControl and then render the entire UserControl to bitmap.

Referring to this tutorial: http://http://www.scichart.com/screenshots-xps-printing-x-axis-text-labels/

You should be able to change the signature of this method:

public static BitmapSource ExportToBitmap(this SciChartSurface element)

To this

public static BitmapSource ExportToBitmap(this FrameworkElement element)

and then call ExportToBitmap on any FrameworkElement in your application.

I hope that makes sense!

Best regards,
Andrew

  • vane
    I'm doing exactly the same. SciChart and SciChartLegend are in a grid and saving the image using FrameworkElement. Only problem is legend is not getting rendered immediately even though it is setup while plotting the graph points. I was wondering if there is something I had to do to render the SciChartLegend similar to SciChart. From your responce I believe there is nothing like that.
  • You must to post comments
Showing 1 result
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