Pre loader

Printing the chart

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 have one problem by printing the chart. I use one third part library for that job. This library work normally good but in this case the chart SCI will not display any curve or axis configurations.

The code .. maybe you see something.. visual is the report (UserControl) containing the chart SCI.

public static DrawingVisual BuildGraphVisual(PageMediaSize pageSize, Visual visual)
{
var drawingVisual = new DrawingVisual();
using (var drawingContext = drawingVisual.RenderOpen())
{
var visualContent = visual;
var rect = new Rect { X = 0, Y = 0, Width = pageSize.Width.Value, Height = pageSize.Height.Value };

var stretch = Stretch.None;
var visualBrush = new VisualBrush(visualContent) { Stretch = stretch };

drawingContext.DrawRectangle(visualBrush, null, rect);
drawingContext.PushOpacityMask(Brushes.White);
}

return drawingVisual;
}

Version
Version=8.6.0.28199
  • You must to post comments
0
0

Hi Norman,

Thanks for your inquiry.
Please accept my apologies for the delayed response.

If you want to print a View that was rendered, you could use WPF PrintDialog API. Here you can find more details:
PrintDialog.PrintVisual(Visual, String) Method (System.Windows.Controls) _ Microsoft Learn

However, if the View wasn’t rendered before you initialize printing this approach won’t work.
The only way to print the View would be exporting SciChartSurface to a bitmap using SciChart Export API, then inserting this Bitmap onto the View as an Image.

Hope this helps.

Kind regards,
Lex,
SciChart Technical Support Engineer

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.