Page 1 of 1

PDF export screwed-up chart

Posted: Fri Sep 26, 2014 4:24 pm
by 16468660
Hi,
I try to export a TeeChart to a pdf-file. The chart is from the template gallerie, the Concentric Donuts.
donut_before.jpg
donut_before.jpg (49.61 KiB) Viewed 22079 times
After export, the chart is screwed-up.
donut_after.jpg
donut_after.jpg (50.24 KiB) Viewed 22074 times
At the pdf-file, there are only the marks from the chart but no chart.
pdfoutput.jpg
pdfoutput.jpg (6.19 KiB) Viewed 22072 times
Please can you help me?

sincerely yours

Peter

Re: PDF export screwed-up chart

Posted: Mon Sep 29, 2014 1:00 pm
by yeray
Hi Peter,

The concentric Donuts Template doesn't look as the one you posted above for me here.
Here it is how it looks for me:
2014-09-29_1343.png
2014-09-29_1343.png (22.4 KiB) Viewed 22040 times
And here it is the pdf I get with this code:

Code: Select all

uses Series, TeePDFCanvas;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.Title.Caption:='Concentric Donuts';

  for i:=0 to 2 do
    with Chart1.AddSeries(TPieSeries) as TPieSeries do
    begin
      FillSampleValues(4);
      Marks.Hide;
      MultiPie:=mpConcentric;
    end;

  TeeSaveToPDFFile(Chart1, 'C:\tmp\Chart1.pdf');
end;
Chart1.zip
(7.45 KiB) Downloaded 791 times
As an alternative, you could print the chart with a virtual pdf printer:
Chart2.zip
(15.82 KiB) Downloaded 772 times

Re: PDF export screwed-up chart

Posted: Fri Oct 03, 2014 6:25 am
by 16468660
Hi Yeray,

you are right, it looks a bit different but I use the concentric Donuts Template. I like to show the values as 100-perscent-columns, the middle of the circle is 100%. So I use the concentric Donuts and give all values the same width. Then I set the color of the values from outer (0%) to inner (100%) of the circle. What chart-type can I use as alternative to my solution? The new Rose Series show the values from inner circle to outer circle and use polar coordinates, but I need free scaling for the circle, not 360°.
Have you an idea what chart type better fit my needs?

Kind regards

Peter

Re: PDF export screwed-up chart

Posted: Fri Oct 03, 2014 2:04 pm
by yeray
Hello Peter,

I've been trying to do a demo using the Rose series. I found some issues but I one problem I can't find how to workaround: some circle labels seem not to be drawn depending on the number of values.
RoseTest.zip
(2.04 KiB) Downloaded 782 times
On the other hand, we'd be pleased to investigate the problem exporting the concentric pies, but we'd need a simple example project we can run as-is to reproduce the problem here.

Thanks in advance.

Re: PDF export screwed-up chart

Posted: Fri Oct 03, 2014 7:17 pm
by 16468660
Hello Yeray,

here is al little sample projekt about my problem.
By the way, an other problem is the positioning of the marks. I set the Marks on the most outer series, but the width of the serie is so big, that some other series are covered. I use curious parameters for the marks-arrow as workaround. Is there an other way in my case to fix the width of the outer serie independently from the marks?
donuts.zip
(54.23 KiB) Downloaded 786 times
Kind regards

Peter

Re: PDF export screwed-up chart

Posted: Mon Oct 06, 2014 11:00 am
by yeray
Hi Peter,
peterlepan wrote:here is al little sample projekt about my problem.
By the way, an other problem is the positioning of the marks. I set the Marks on the most outer series, but the width of the serie is so big, that some other series are covered. I use curious parameters for the marks-arrow as workaround. Is there an other way in my case to fix the width of the outer serie independently from the marks?
I could reproduce the problem with your project when exporting the chart to a pdf.
However, it seems to work fine if I print the chart using a virtual pdf printer, instead of exporting the chart to a pdf.
Yeray wrote:I've been trying to do a demo using the Rose series. I found some issues but I one problem I can't find how to workaround: some circle labels seem not to be drawn depending on the number of values.
I've corrected the example above and this seems to work better.
Exporting to a pdf file works better than with the TPieSeries, but not perfect: the labels in the main chart disappear. However, printing the chart with a virtual pdf printer also works fine:

Code: Select all

uses TeePDFCanvas;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;
  Chart1.Legend.Visible:=false;

  with Chart1.AddSeries(TRoseSeries) as TRoseSeries do
  begin
    Pointer.Visible:=false;
    Pen.Visible:=false;
    Color:=clWhite;
    CircleBackColor:=RGB(0,0,128);

    GetHorizAxis.Grid.Visible:=false;
    GetVertAxis.Grid.Visible:=false;
    GetHorizAxis.MinorTicks.Visible:=false;
    CircleLabelsRotated:=true;
    LabelsMargin:=10;

    OnGetCircleLabel:=roseGetCircleLabels;
  end;

  Chart1.Axes.Visible:=false;

  TrackBar1.Max:=200;
  TrackBar1.Min:=10;
  TrackBar1.Position:=29;
  TrackBar1.Frequency:=10;
end;

procedure TForm1.recalcAngles;
var i: Integer;
begin
  with Chart1[0] as TRoseSeries do
  begin
    for i:=0 to Count-1 do
      AngleValue[i]:=i*360/Count;

    AngleIncrement:=(AngleValue[1]-AngleValue[0]) / 2;
  end;
end;

procedure TForm1.roseGetCircleLabels(Sender:TCustomPolarSeries; const Angle:Double; Index:Integer;
                                     var Text:String);
var i: Integer;
begin
  Text:='';
  with Chart1[0] as TRoseSeries do
    for i:=0 to Count-1 do
      if Round(Angle-AngleIncrement)=Round(AngleValue[i]) then
        Text:=Labels[i];
end;

procedure TForm1.TrackBar1Change(Sender: TObject);
var i, tmpValue: Integer;
begin
  with Chart1[0] as TRoseSeries do
  begin
    Clear;
    for i:=0 to TrackBar1.Position-1 do
    begin
      tmpValue:=Round(random*100);
      AddPolar(tmpValue, tmpValue, IntToStr(tmpValue));
    end;
      recalcAngles;
  end;

  Label1.Caption:='Num Values: ' + IntToStr(TrackBar1.Position);
end;
2014-10-06_1256.png
2014-10-06_1256.png (52.65 KiB) Viewed 21974 times

Re: PDF export screwed-up chart

Posted: Tue Oct 07, 2014 6:32 am
by 16468660
Hi Yeray,

your sample works fine, but I have one problem. I need to show the values from outer to inner. The outer of the circle is 0% and the center of the circle stands for 100%. If I show the difference to 100% with the rose-serie, I see no chance to change the color for a single value from outer to inner. These color is set with the CircleBackColor.

Oh, I have an idea! I use a second rose-serie to set the color of my single values!

Thank your for your inspiration!

Best regards

Peter

Re: PDF export screwed-up chart

Posted: Tue Oct 07, 2014 6:59 am
by 16468660
Hi Yeray,

only one question, how can I put the labels in the foreground? I have the labels taken in the inner of the circle, but some of them are invisible because they are covered from the rose-serie.
Have you a solution for this problem?
roselabels.jpg
roselabels.jpg (51.66 KiB) Viewed 22023 times
Best regards

Peter

Re: PDF export screwed-up chart

Posted: Tue Oct 07, 2014 7:20 am
by yeray
Hi Peter,
peterlepan wrote:Oh, I have an idea! I use a second rose-serie to set the color of my single values!

Thank your for your inspiration!
Great!
I'm glad to be helpful!
peterlepan wrote:only one question, how can I put the labels in the foreground? I have the labels taken in the inner of the circle, but some of them are invisible because they are covered from the rose-serie.
Have you a solution for this problem?
There's a property for that:

Code: Select all

Series1.CircleLabelsInside:=false;

Re: PDF export screwed-up chart

Posted: Tue Oct 07, 2014 11:02 pm
by 16468660
Hi Yeray,

the rose serie has a cleaner look then the concentric donuts. But I have one Problem. I like to put the labels inside the circle, to save some space around the chart. If the labels-text get a bit longer then 3 numbers, the labels on the left side are not symmetric positioned to the labels on the right side:
rose_labels.jpg
rose_labels.jpg (45.19 KiB) Viewed 21967 times
The labels loose the assignment to its chart-values.
If I put the marks at the concentric donuts inside the circle, I nearly get a circle:
donut_labels.jpg
donut_labels.jpg (66.66 KiB) Viewed 21972 times
Each segment get its right label.

Is there an option at the rose serie, to position the labels in the circle without loosing the assignment to the values?

Best regards

Peter

Re: PDF export screwed-up chart

Posted: Wed Oct 08, 2014 11:23 am
by yeray

Re: PDF export screwed-up chart

Posted: Sun Feb 08, 2015 11:44 pm
by 16468660
Hi Yeray,

I see a new version of TeeChart, have you put some improvements to the rose-serie? (especially labels?)

Best regards

Peter

Re: PDF export screwed-up chart

Posted: Mon Feb 09, 2015 2:08 pm
by yeray
peterlepan wrote:I see a new version of TeeChart, have you put some improvements to the rose-serie? (especially labels?)
I'm afraid not yet, Peter.
I've incremented the priority of the ticket Improve labels in TRoseSeries

Re: PDF export screwed-up chart

Posted: Wed Feb 11, 2015 10:39 am
by 18270926
sorry for the minor threadjack, am not sure how to upvote for features, but would like to add an enthusiastic vote for moving "Rounded/Circled Segments in the TRoseSeries" up the priority list. thank you! (if it will be part of the Xamarin.Forms release, too...)

Re: PDF export screwed-up chart

Posted: Wed Feb 11, 2015 12:57 pm
by yeray
Hello,
jdom wrote:sorry for the minor threadjack, am not sure how to upvote for features, but would like to add an enthusiastic vote for moving "Rounded/Circled Segments in the TRoseSeries" up the priority list. thank you! (if it will be part of the Xamarin.Forms release, too...)
Added to .NET Xamarin.Forms:
http://bugs.teechart.net/show_bug.cgi?id=1132

Feel free to add your mail to the CC list of any ticket to be automatically notified when an update arrives.