Page 1 of 1

Ternary Graph Multiple Series

Posted: Sun Mar 24, 2019 6:21 am
by 16583932
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

Re: Ternary Graph Multiple Series

Posted: Mon Mar 25, 2019 3:33 pm
by yeray
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?

Re: Ternary Graph Multiple Series

Posted: Wed Mar 27, 2019 11:02 am
by 16583932
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

Re: Ternary Graph Multiple Series

Posted: Mon Apr 01, 2019 2:00 pm
by yeray
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 12434 times
Is this the problem?

Re: Ternary Graph Multiple Series

Posted: Mon Apr 01, 2019 2:23 pm
by yeray
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 12434 times