Ternary Graph Multiple Series

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Errol
Newbie
Newbie
Posts: 35
Joined: Mon Jul 02, 2018 12:00 am

Ternary Graph Multiple Series

Post by Errol » Sun Mar 24, 2019 6:21 am

I am having problems with sending multiple series to a ternary graph, as follows:
1. My program sends chemistry data to a normal X-Y plot. This data can be grouped by sample (e.g. one data point per series), by sample site (e.g. one of many data points per series) or perhaps grouped by sample date or other parameters.
2. I expected the same facility with a ternary graph - the only difference being that I have to send 3 parameters rather than two, and the graph would auto-calculate the three values as percentages.
3. The program contains extensive code to control colours, symbols and lines used for the series, and I was hoping to be able to use this with ternary graphs.
4. However, when I try to send multiple series to a ternary graph (see attached example project), I obtain multiple graphs nested insides each other.
I am perplexed by this, and would appreciate your urgent attention to this problem.
Thanks and regards
Errol
Attachments
TernaryGraph_MultiSeries.zip
(9.71 KiB) Downloaded 744 times

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

Re: Ternary Graph Multiple Series

Post by Yeray » Mon Mar 25, 2019 3:33 pm

As mentioned here this project seems to be using components we don't have here (TkbmMemTable, TkbmCSVStreamFormat).
If you still find problems with it, could you please arrange example projects using the minimum code to reproduce them and without using 3rd party libraries?
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

Errol
Newbie
Newbie
Posts: 35
Joined: Mon Jul 02, 2018 12:00 am

Re: Ternary Graph Multiple Series

Post by Errol » Wed Mar 27, 2019 11:02 am

Hi Yeray
Thank you for your reply. As the rest of my code uses kbmMemTables, I was experimenting to see if I could use them with Ternary Series. I do not believe that the cause of the error I am experiencing is due to the kbmMemTable, it is because I am clearly allocating the Ternary Series parameters incorrectly, and the Ternary Series Help seems limited (or I cannot find it).
Rather than generating a new example project, I would be grateful if you could use the three csv files as input for three Ternary Series declared programmatically on single chart, and then I could then see to manage multiple series.
Thanks for your assistance on this matter.
Best regards
Errol

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

Re: Ternary Graph Multiple Series

Post by Yeray » Mon Apr 01, 2019 2:00 pm

Hello,

I believe adding three TTernarySeries and populating them with FillSampleValues already shows the undesired result you described in the opening post.
Project1_2019-04-01_15-59-08.png
Project1_2019-04-01_15-59-08.png (47.63 KiB) Viewed 11372 times
Is this the problem?
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

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

Re: Ternary Graph Multiple Series

Post by Yeray » Mon Apr 01, 2019 2:23 pm

If so, you can hide the axes and the walls before drawing the second series at OnBeforeDrawSeries. Ie:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  for i:=0 to 2 do
    with Chart1.AddSeries(TTernarySeries) as TTernarySeries do
    begin
      BeforeDrawValues:=SeriesBeforeDrawValues;
      UseColorRange:=False;
      UsePalette:=False;
      ColorEachPoint:=False;
      VertexTitle.Visible:=i=0;
      FillSampleValues;
    end;
end;

procedure TForm1.SeriesBeforeDrawValues(Sender: TObject);
begin
  if Sender=Chart1[0] then
  begin
    Chart1.Axes.Visible:=True;
    Chart1.Walls.Back.Visible:=True;
  end
  else
  begin
    Chart1.Axes.Visible:=False;
    Chart1.Walls.Back.Visible:=False;
  end;
end;
Project1_2019-04-01_16-23-26.png
Project1_2019-04-01_16-23-26.png (36.87 KiB) Viewed 11372 times
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