Profile Picture

how to print chart on PrintDocument?

Posted By yunhyungjeon 2 Years Ago
Author
Message
yunhyungjeon
Question Posted 2 Years Ago
View Quick Profile
Junior Member

Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 13, Visits: 190
hello

I'm using Nevron .NET Chart at .net 5.0, winform.

However, I have some questions.
I want to print my Nevron Chart, so, I'm using C#'s PrintDocument PrintPage event.
But, my chart do not shown at print preview page.

Here is my chart print code.

      NRectangleF chartBounds = new NRectangleF(headerBounds.Left, headerBounds.Bottom, headerBounds.Width, CompHeight * 8);
      NChartPrintView chartView = new NChartPrintView(nChartControl.PrintManager, nChartControl.Document, ev.Graphics);
      chartView.Print(chartBounds);
      chartView.Dispose();


First image is my origin chart at runtime. Second Image is my printview image.
When I draw just small data, printview page is well. But, If I draw many datas, my chart are not shown like these images.
How can I fix it?






Tags
Nevron Support
Posted 2 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi,

Please send the state of the control for review. To save the control state you can use:

nChartControl1.Serializer.SaveControlStateToFile("c:\\temp\\chartstate.xml", Nevron.Serialization.PersistencyFormat.XML, null);

Let us know if you meet any problems...

Best Regards,
Nevron Support Team



yunhyungjeon
Posted 2 Years Ago
View Quick Profile
Junior Member

Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 13, Visits: 190
Okay, here is my chart's state file.

I hope the problem will be solved soon.
Thank you.

Attachments
chartstate.zip (173 views, 71.00 KB)
Nevron Support
This post has been flagged as an answer
Posted 2 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi Yunhyungjeon,

Thank you for sending the save file. We investigated the issue and indeed the control is printing properly, but only when the amount of data is low. We suspect this is caused by a problem in Windows and the workaround is to create a high res raster, which in turn can be printed:
Bitmap bitmap = new Bitmap(2000, 2000, printerGraphics);
nChartControl1.ImageExporter.RenderToBitmap(bitmap, false);
// you can draw the bitmap to the printerGraphics here
bitmap.Dispose();

We hope this helps - let us know if you meet any problems or have any questions.



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic