Page 1 of 1

How to draw an axis

Posted: Wed Aug 16, 2023 8:03 am
by 16494694
How to draw the red axis on a graph?
Using c++builder。

Re: How to draw an axis

Posted: Thu Aug 17, 2023 11:16 am
by Pep
Hello,
you can do this by using the ColorLine Tool (two, one for vertical and another one for horizontal).
You can find an example of use of the ColorLine tool in the TeeNew examples features included with the installation.

Please, do not hesitate to contact us in the case we can be of a further help.

Re: How to draw an axis

Posted: Fri Aug 18, 2023 9:48 am
by 16494694
I can't find it. Can you give me a demo?

Re: How to draw an axis

Posted: Fri Aug 18, 2023 2:00 pm
by Pep
Hello,

you can use the following code to add a colorline tool and then customize it.

Code: Select all

//Now add colorlinetool outside the min/max range of the data
TColorLineTool *line = new TColorLineTool(TrendChart);
TrendChart->Tools->Add(line);
line->AllowDrag = false;
line->NoLimitDrag = false;
line->Axis = axisVert;
line->Pen->Color = clBlue;
line->Pen->Width = 2;
line->Value = 32;
Please, let us know in the case any help still needed.

Re: How to draw an axis

Posted: Mon Aug 21, 2023 2:01 am
by 16494694
line->Axis = axisVert;
What is axisVert???

Re: How to draw an axis

Posted: Mon Aug 21, 2023 5:54 am
by Pep
Hello,
axisVert was used in the case you want to make use of a new custom axis, like:

Code: Select all

//Add vertical axis
TChartAxis *axisVert = new TChartAxis(TrendChart);

axisVert->Maximum = dblMax + 1;
axisVert->Minimum = dblMin - 1;
axisVert->Grid->Visible = true;
axisVert->Automatic = false;
axisVert->AutomaticMinimum = false;
axisVert->AutomaticMaximum = false;
axisVert->PositionPercent = 0;
axisVert->Horizontal = false;
axisVert->OtherSide = false;
axisVert->Visible = true;
axisVert->LabelsFont->Color = clRed;
but you can always use instead:

Code: Select all

Chart->Axes->left