how to print chart on PrintDocument?


Author
Message
yunhyung jeon
yunhyung jeon
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
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?

82% of original size (was 614x323) - Click to enlarge



Tags
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.1K
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


yunhyung jeon
yunhyung jeon
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
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 (351 views, 71.00 KB)
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.1K
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


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic
1 active, 1 guest, 0 members, 0 anonymous
No members currently viewing this topic!

Login

Explore
Messages
Mentions
Search