User (Old forums)MemberOctober 15, 2008 at 7:21 pmPost count: 23064
Right now I’m trying to use the built in printmanager to print a line chart. The lines are annoyingly light in color and I can’t figure out how to make them darker.
From looking at the documentation I thought I’d just turn off autoquality and increate the quality value but no matter what I set it to I still just get really fine gray lines.
I tried going through and changing the line widths to various values and it still prints thin lines.
Here’s my code:
Dim VoltsLine = CType(chtBattery.Charts(0).Series(0), LineSeries)
VoltsLine.LineWidth = 5
Dim AmpsLine = CType(chtBattery.Charts(0).Series(1), LineSeries)
AmpsLine.LineWidth = 5
Dim TempLine = CType(chtBattery.Charts(0).Series(2), LineSeries)
TempLine.LineWidth = 5
chtBattery.PrintManager.AutomaticQualityScale = False
chtBattery.PrintManager.QualityScale = 2
chtBattery.PrintManager.Landscape = True
Is there something wrong with that code? Is there reason to believe that shouldn’t increase the thickness of the lines before printing? I can’t use markers for the line because I have hundreds of data points so it would make the chart look bad. Is it because it’s a 2D chart? Would I be able to do it if I didn’t use the built in printmanager, is the printmanager overriding my line widths or something?
By the way, I have noticed that the printmanager doesn’t limit the quality setting at all. I can easily cause the printmanager to throw an exception by setting quality to something like 100. I started increasing it slowly and got an out of memory exception at around 15. I was increasing the value and clicking the update button on the printmanager (this was in the print demo from your chart explorer so I know it wasn’t my code causing the problem).
I’ve also noticed that not all printmanager settings get carried over into the dialog. For instance I can turn off auto quality, set quality to 2 and set landscape to true. When I run ShowDialog the quality settings are set right but orientation is set to portrait.
Thanks in advance for any help you can provide.
Imported from legacy forums. Posted by Steve (had 1764 views)User (Old forums)MemberOctober 16, 2008 at 3:00 pmPost count: 23064
You need to set the LineBorder.Width property to increase the width of a line series.
VoltsLine.LineBorder.Width = 5
For the quality setting, what it does is multiplying the resolution of the printer by this number, and then uses this new resolution to generate the bitmap. The default value is 1, so it means the same resolution as the printer. Now a bitmap can grow fat very rapidly when over dimensioned. Hence the out-of-memory exception. We could limit this number, but since this limit varies from one system to another (it depends on the available memory), it is not something we want to do.
For the last issue, there was a bug that we corrected in the latest version, which prevented some properties on the PrintManager to propagate into the PrintDialog. So update to the latest version, and it should work fine.
Imported from legacy forums. Posted by André (had 1614 views)
- You must be logged in to reply to this topic.