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;
}
- Norman Bürgi asked 2 months ago
- last edited 1 month ago
- You must login to post comments
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
- Lex answered 1 month ago
- last edited 1 month ago
- You must login to post comments
Please login first to submit.