SVG-Export multiple horizBars-Series side by side

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Oliver
Newbie
Newbie
Posts: 3
Joined: Thu Oct 30, 2014 12:00 am

SVG-Export multiple horizBars-Series side by side

Post by Oliver » Sat Jun 27, 2015 4:13 pm

Exporting multiple horizBars-Series, which are displayed on screen side by side, to the SVG-format makes the horizBars-Series overlapping.
The export to the other pixel-export-formats (bmp, png, ...) supplies an correct result. The bars were displayed side by side like the are displayed on the screen.

Please take a look a the attachements:
- AgePyramide.png - bars were displayed side by side -> correct (it is like the screen and all the other pixel-formats)
- AgePyramide.svg - bars overlap

regards Oliver
Attachments
AgePyramide.zip
(5.82 KiB) Downloaded 2174 times
AgePyramide.png
AgePyramide.png (21.87 KiB) Viewed 41110 times

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: SVG-Export multiple horizBars-Series side by side

Post by Yeray » Mon Jun 29, 2015 9:32 am

Hello,

Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Oliver
Newbie
Newbie
Posts: 3
Joined: Thu Oct 30, 2014 12:00 am

Re: SVG-Export multiple horizBars-Series side by side

Post by Oliver » Tue Jul 07, 2015 7:22 pm

Hello,

in the zip-file you can find a simple Netbeans-Projekt which demonstrates the problem.
As a result of the file size limitation I removed the "TeeChart.Swing.jar" from the directory "Gizeh02\dist\lib".

Regards Oliver
Attachments
Gizeh02.zip
(32.89 KiB) Downloaded 2114 times

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: SVG-Export multiple horizBars-Series side by side

Post by Yeray » Wed Jul 08, 2015 2:15 pm

Hello Oliver,

I see the rectangles seem to be too high. Drawing the rectangles one pixel smaller in height seems to fix it.
However, it doesn't look well yet because the antialias is drawing the lines using a stroke two pixels wide. This can be corrected making the rectangles 0.5 pixels smaller in width and starting drawing them 0.5 pixels below in y.
Here it is a SVGRect function you can try in your sources to see if it fits your needs (find this function at Graphics3DSVG.java, in the drawing folder of the sources):

Code: Select all

    private String SVGRect(Rectangle r) {
        int w = r.width;
        int h = r.height;
        m_String = "x=\"" + Double.toString(r.getLeft()) + "\" y=\"" +
                   Double.toString(r.getTop()+0.5) +
                   "\" ";
        m_String += " width=\"" + Double.toString(w-0.5) + "\"" + " height=\"" +
                Integer.toString(h-1) + "\"";
        return m_String;
    }
We still have to investigate if these changes have any drawback before validating them.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply