How to best create this kind of chart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
X-ray
Newbie
Newbie
Posts: 7
Joined: Tue Jan 16, 2018 12:00 am

How to best create this kind of chart

Post by X-ray » Fri Jun 15, 2018 8:32 pm

Hello,

I have a chart with a ColorGrid series and I would like to display a vertical line series (red line) on top of this ColorGrid.
The Left axis is actually the same axis for both series (Scan Number) the top axis should display the X values of the line series (Measured Voltage V)
ChartCapture.PNG
ChartCapture.PNG (428.96 KiB) Viewed 14527 times
Whats the best way to achieve that ?

Thanks and best regards

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

Re: How to best create this kind of chart

Post by Yeray » Mon Jun 18, 2018 7:23 am

Hello,

The easiest way is probably yo assign the Top axis to the THorizLineSeries and set that axis to limit the length of that axis. Here I'm setting it to end at the 20% of the chart width:
Project4_2018-06-18_09-22-46.png
Project4_2018-06-18_09-22-46.png (16.38 KiB) Viewed 14517 times

Code: Select all

uses TeeSurfa, Series;

var colorGrid1: TColorGridSeries;
    horizLine1: THorizLineSeries;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=False;
  Chart1.Legend.Hide;

  colorGrid1:=Chart1.AddSeries(TColorGridSeries) as TColorGridSeries;
  horizLine1:=Chart1.AddSeries(THorizLineSeries) as THorizLineSeries;

  colorGrid1.FillSampleValues;
  horizLine1.FillSampleValues;

  horizLine1.HorizAxis:=aTopAxis;
  Chart1.Axes.Top.EndPosition:=20;
end;
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

X-ray
Newbie
Newbie
Posts: 7
Joined: Tue Jan 16, 2018 12:00 am

Re: How to best create this kind of chart

Post by X-ray » Mon Jun 18, 2018 10:18 am

Hello Yeray,

Thank You, that looks exactly like what I need.

X-ray
Newbie
Newbie
Posts: 7
Joined: Tue Jan 16, 2018 12:00 am

Re: How to best create this kind of chart

Post by X-ray » Mon Jun 18, 2018 6:04 pm

Hello Yeray,

I got it right for the TColorGridSeries series now :
ColorGridCapture.PNG
ColorGridCapture.PNG (95.34 KiB) Viewed 14510 times
How to get it right for a similar TSurfaceSeries:
SurfaceSeriesCapture.PNG
SurfaceSeriesCapture.PNG (243.42 KiB) Viewed 14510 times
I somehow can't see how to get the axis right....

Thanks in advance!

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

Re: How to best create this kind of chart

Post by Yeray » Tue Jun 19, 2018 6:49 am

Hello,
X-ray wrote:I got it right for the TColorGridSeries series now :
Great!
X-ray wrote:How to get it right for a similar TSurfaceSeries:
I'm not sure to understand what would you exactly like it to get.
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

X-ray
Newbie
Newbie
Posts: 7
Joined: Tue Jan 16, 2018 12:00 am

Re: How to best create this kind of chart

Post by X-ray » Tue Jun 19, 2018 7:48 am

Hello Yeray,

I want to achieve that:
SurfaceSeriesPlusLineSeries.png
SurfaceSeriesPlusLineSeries.png (201.97 KiB) Viewed 14499 times
The line can be drawn at any height of the {Counts} axis.
[Scan Number] should be the common axis again.

Thanks and best regards

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

Re: How to best create this kind of chart

Post by Yeray » Tue Jun 19, 2018 11:07 am

Hello,

For this kind of chart I would use a TPoint3DSeries with hidden Pointer. Ie:
Project3_2018-06-19_13-06-47.png
Project3_2018-06-19_13-06-47.png (76.35 KiB) Viewed 14488 times

Code: Select all

var surface1: TSurfaceSeries;
    points1: TPoint3DSeries;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.Legend.Hide;
  Chart1.Aspect.Orthogonal:=False;
  Chart1.Chart3DPercent:=100;
  Chart1.Aspect.Zoom:=60;
  Chart1.Axes.Left.SetMinMax(0,10);
  Chart1.Axes.Left.LabelsFont.Size:=20;
  Chart1.Axes.Bottom.LabelsFont.Size:=20;
  Chart1.Axes.Top.LabelsFont.Size:=20;
  Chart1.Axes.Depth.LabelsFont.Size:=20;
  Chart1.Axes.Depth.Visible:=True;
  Chart1.Axes.Bottom.Increment:=1;
  Chart1.Axes.Depth.Increment:=1;
  Chart1.Axes.Left.Texts.MarginToAxis:=100;
  Chart1.Axes.Top.Texts.MarginToAxis:=100;

  surface1:=Chart1.AddSeries(TSurfaceSeries) as TSurfaceSeries;
  surface1.FillSampleValues();

  points1:=Chart1.AddSeries(TPoint3DSeries) as TPoint3DSeries;
  points1.Pointer.Hide;
  points1.HorizAxis:=aTopAxis;
  Chart1.Axes.Top.EndPosition:=50;

  for i:=1 to 9 do
    points1.AddXYZ(i, i, random*i);
end;
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

X-ray
Newbie
Newbie
Posts: 7
Joined: Tue Jan 16, 2018 12:00 am

Re: How to best create this kind of chart

Post by X-ray » Tue Jun 19, 2018 1:34 pm

Perfect, Thank You !

Post Reply