Page 1 of 1

Series.Marks.OnTop property breaks SVG export

Posted: Thu Aug 09, 2012 1:00 pm
by 16560277
Setting the Series.Marks.OnTop property to True results in incorreclty generated (actually corrupted) SVG export code for charts with marks: chart has incorrect position and two closing </g> tags are missing.
Replication:
1. Set Series.Marks.OnTop = True for some series of a chart with marks visible (I set it programmatically);
2. Call SVG export for the chart above (in my case programmatically genertated SVG code is saved to a file);
3. Open the resulting SVG in web browser - FireFox gives XML parse error and does not open SVG at all, IE9 displays the chart in incorrect position.
Note that adding two closing </g> tags to the end of this SVG code allows this SVG to be opened in FireFox but the position of the chart is still incorrect.
Not using Series.Marks.OnTop (meaning it is False) produces openable and correct SVG code.
I am using Steema TChart version 2012.05.

Re: Series.Marks.OnTop property breaks SVG export

Posted: Fri Aug 10, 2012 1:43 pm
by yeray
Hi,

I've tried it with Delphi 7 and both TeeChart v2012.5 and the actual v2012.06 and the code below seems to give me a correct result.

Code: Select all

uses Series, TeeSVGCanvas;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  for i:=0 to 5 do
    with Chart1.AddSeries(TBarSeries) do
    begin
      Add(i*10, 'Series' + IntToStr(i));
      Add(50-i*10, 'Series' + IntToStr(i));
      Marks.Visible:=true;
      Marks.OnTop:=true;
    end;

  Chart1.Axes.Bottom.LabelStyle:=talValue;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  TeeSaveToSVGFile(Chart1,'C:\tmp\Chart1.svg');
end;
Could you please give it a try and modify the code above if you find I've missed some important step?
Thanks in advance.