Reputation: 880
Using Microsoft's charting control, System.Windows.Forms.DataVisualization.Charting.Chart, I am trying to render a chart to vector graphics. The ultimate goal here is to render a chart to a high enough quality image to be embedded in a PDF and used for print.
The problem is that the EMFs the Chart control produces are low quality, and do not represent what the control looked like at print time. In charts with any curved lines, the EMF simply shows up as an unrecognizable pixelated mess when embedded in a PDF.
My question is, has anybody successfully used Microsoft's charting controls in print? At this point, I am not even concerned with using EMF, as that engine looks like it will not be fixed any time in the near future. I have tried rendering to PNG with a high DPI, but this affects the thickness of various components on the chart (set to a pixel size), with the series lines in a line graph as one example.
I'm not sure if there are settings I am missing, but if there's a trick to getting these charts out in good shape I would be very interested to hear about it.
Upvotes: 2
Views: 1025
Reputation: 880
If anybody's interested, it looks like I have found the answer. If any semi-transparent color is used in a chart, it will not render properly in the EMF file coming out. As long as you avoid partially transparent colors (Alpha that is not 0 or 255), saving as EMF seems to always come out OK.
One thing to take note of is that certain effects (seem to) require transparency to be achieved, and so setting those will also corrupt the resulting EMF. One example of that sort of effect is setting a Pie chart to concave. A pie chart that renders to EMF with no problem will become unrecognizable once it is set to concave.
Hope this helps someone save the three days it took us to work this out.
Upvotes: 2