SVG output problems

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
pdprog
Newbie
Newbie
Posts: 10
Joined: Fri Jun 25, 2004 4:00 am

SVG output problems

Post by pdprog » Fri Jul 02, 2004 9:58 pm

After adding your fix to the code for a windowless chart, I now have an svg chart on my screen. :)

Some initial notes:

1. Top title is placed incorrectly (mine had a negative y value for the text) which means it doesn't show up anywhere. Switching it to positive places it correctly.
2. The font size for the top and bottom titles are specified in negative point sizes. Doesn't seem to bother svg, but I think it should be positive. (presumably this is done in Windows to specify the "actual" height rather than the height with extra top/bottom space)
3. The labels on the chart are all above the bars, though I specified (and the corresonding .bmp renders) that they should be below the bars.
4. In order to get the svg to scale in the browser, rather than be a fixed size... which is why I wanted svg instead of raster. I changed the svg tag to have a viewBox of "0 0 300 200" instead of a height and width. Perhaps this option is already available.
5. All of the fonts are quite a bit larger than in the raster image.


I'm still working with it. And I'm going into your code to see what's up with these things. More soon, but I'd appreciate any comments on these items.

Thanks,
-pete

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Wed Jul 07, 2004 4:25 pm

Hi.

Re #1 and #2 : Hmm.. Can you send me a sample which I can run here as-is ? I'm not able to replicate this one. You can send it to marjan at steema dot com email address.

Re #3 : Looks like the text drawing code is not taking into the account all text properties. I'll check if the code can be improved.

Re #4 : You can control chart or svg viewbox size by increasing TSVGExportFormat Width and Height properties.

Re #5 : svg font size is equal to windows font size. Are you by any chance using the "big fonts" (screen resolution 120dpi) ?
Marjan Slatinek,
http://www.steema.com

pdprog
Newbie
Newbie
Posts: 10
Joined: Fri Jun 25, 2004 4:00 am

Post by pdprog » Thu Jul 08, 2004 11:44 pm

Sorry... I've had guests and forgot to check this forum. (I'll check the "Notify me" next time)

It's going to be very hard to send you my code - I'll see if I can put together a small sample that shows the negative font sizes and coordinates.

I see in the source that some attempt has been made to play with transforms, but I don't see it being used anywhere. (it's commented)

Using the Width and Height parameters in SVG creates a graphic that will not be scaled when viewed in a browser. One of the reasons I want svg output, in addition to having it match all the rest of my code, is to be able to have the image scale _client side_ when the browser resizes. Changing the width and height requires a round-trip to the server, or Javascript that I'm not into writing.

I'm using "normal" font size and getting fairly large fonts. I'll explore setting the size explicitly - I don't want them to be "windows" font size, I need them to be _exactly_ "n" units high. (i.e. they should scale with my image when it is enlarged) Many of my users print to large format printers for presentations. If the fonts stay at 12pt, they will not be visible.

Thanks for the responses. :)

-pete

Post Reply