ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Ugly SVG output(java)
Posted by loadPNG_java on Oct-27-2022 08:39
CD can generate png but SVG looks ugly.

88.06 Kb

  Re: Ugly SVG output(java)
Posted by Peter Kwan on Oct-28-2022 02:25
Hi loadPNG_java,

I cannot reproduce the problem with your code. I can only reproduce the problem if I add an extra line:


Is it possible in your code, you have this line somewhere?

The bmpscale is only applicable to bitmap images. These images are generated by ChartDirector with a definite pixel size. The bmpscale can be used to ask ChartDirector to generate bitmap images with more pixels (higher resolution).

For SVG, the image is indefinitely scalable. You can consider it to have infinite resolution. As a result, it does not need bmpscale. Of course, with currently technology, to actually display it, it needs to be convert to pixel images (because the screen can only display pixels). This is the responsibility of the viewing program (such as the browser). The viewing program should be able to convert the SVG to the required number of pixels. For example, in HTML. you can use CSS or HTML tags to specify the size you what the SVG to display.

If you need to output the chart in both SVG and PNG, you can output it in SVG first, then call setOutputOptions, and then output in PNG. The setOutputOptions make some changes to the chart object, so if you output PNG first, it would not work normally for SVG which does not support bmpscale. Another alternative is to create two chart objects, one to output PNG and one to output SVG. (Normally, creating two chart objects does not need any extra charting code. You just call the same code twice.)

Best Regards
Peter Kwan

  Re: Ugly SVG output(java)
Posted by loadPNG_java on Oct-28-2022 12:46
Thank you very much for both your responses to my question. I had set c.setOutputOptions("bmpscale=4").
Best Regards