Custom Axes : subdivision of "axes"
Custom Axes : subdivision of "axes"
Hi,
I would like to recopy below each custom axes the same subdivision as the bottom axe. Here is a picture :
I do not know how to get the step of subdivision and/or where it begins etc.
As you can see, I've already implemented a code, in the AfterDraw event, who draws the main line.
Thank you for your help!
Cordially,
Rodrigue
I would like to recopy below each custom axes the same subdivision as the bottom axe. Here is a picture :
I do not know how to get the step of subdivision and/or where it begins etc.
As you can see, I've already implemented a code, in the AfterDraw event, who draws the main line.
Thank you for your help!
Cordially,
Rodrigue
Here is the link of the picture :
http://cjoint.com/?chpHko5gIK
http://cjoint.com/?chpHko5gIK
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rodrigue,
Could you please be more specific? What do you refer when speaking about subdivision?
You can copy one axis from another custom or default axis doing:
or
And after having copied it you can change it's specific properties.
Could you please be more specific? What do you refer when speaking about subdivision?
You can copy one axis from another custom or default axis doing:
Code: Select all
Chart1.CustomAxes[1]:=Chart1.CustomAxes[0];
Code: Select all
Chart1.CustomAxes[1]:=Chart1.LeftAxis;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi,
In fact it is not an axis. It is a drawing! I separate several graphs (here 3) by using opaque zone (as in your examples).
For the moment, I separate these various opaque zones by a line from 2 pixels width.
I would like that this "line" will be a little more complex.
I would like to make it resemble to the axis bottom (without labels)...
Please, look at my picture.
I've copied exactly what I want on the second axis.
Cordially,
Rodrigue
In fact it is not an axis. It is a drawing! I separate several graphs (here 3) by using opaque zone (as in your examples).
For the moment, I separate these various opaque zones by a line from 2 pixels width.
Code: Select all
void __fastcall TForm1::AfterDrawSeries(TObject *Sender)
{
...
Chart1->Canvas->Pen->Width = 2;
Chart1->Canvas->Pen->Color = clBlack;
Chart1->Canvas->Line
(
Chart1->ChartRect.Left,
Series1->GetVertAxis->IEndPos,
Chart1->ChartRect.Right,
Series1->GetVertAxis->IEndPos
);
Chart1->Canvas->Line
(
Chart1->ChartRect.Left,
Series2->GetVertAxis->IEndPos,
Chart1->ChartRect.Right,
Series2->GetVertAxis->IEndPos
);
I would like that this "line" will be a little more complex.
I would like to make it resemble to the axis bottom (without labels)...
Please, look at my picture.
I've copied exactly what I want on the second axis.
Cordially,
Rodrigue
Hi.
Yes, that't be great (as I cannot see the image you posted in this thread). Please send more detailed description directly to my address at "marjan at steema dot com". Tnx.
Yes, that't be great (as I cannot see the image you posted in this thread). Please send more detailed description directly to my address at "marjan at steema dot com". Tnx.
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Ok, got your email. In your case there is a simple solution. If you want to duplicate one axis (draw it multipe times over chart canvas), then all you must do is use TChartAxis.CustomDraw method to draw axis at specific screen coordinate. Example (code placed in TChart OnBeforeDrawSeries event!):9340780 wrote:If you don't understant what I woud like, I can give more details ....
Code: Select all
var pos: Integer;
begin
// Draw two axes at 100px and 220px
pos := 100;
Chart1.Axes.Bottom.CustomDraw(pos+10,pos+30,pos,False);
pos := 220;
Chart1.Axes.Bottom.CustomDraw(pos+10,pos+30,pos,False);
end;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Thanks for your reply !
Your method works but I don't want the text.
If I set :
The text is not draw but the litte line too
I saw on an other post that I can use the event OnGetMarkText.
So I would like to draw Text on the bottom Axe. When I use CustomDraw I don't want to draw Text. How to do that ?
Cordially,
Rodrigue [/url]
Your method works but I don't want the text.
If I set :
Code: Select all
Chart->Axes->Bottom->Labels = false;
I saw on an other post that I can use the event OnGetMarkText.
So I would like to draw Text on the bottom Axe. When I use CustomDraw I don't want to draw Text. How to do that ?
Cordially,
Rodrigue [/url]
Hi.
OnGetMarkText is not the best approach. Instead, adding a single line of code might works perfectly:
OnGetMarkText is not the best approach. Instead, adding a single line of code might works perfectly:
Code: Select all
procedure TForm1.Chart1BeforeDrawSeries(Sender: TObject);
var oldShowLabels : boolean;
var oldTicksOnLabels : boolean;
begin
oldShowLabels := Chart1.Axes.Bottom.Labels;
oldTicksOnLabels := Chart1.Axes.Bottom.TickOnLabelsOnly;
// custom settings for additiona "copies"
Chart1.Axes.Bottom.TickOnLabelsOnly := False;
Chart1.Axes.Bottom.Labels := False;
Chart1.Axes.Bottom.CustomDraw(100,120,80,False);
Chart1.Axes.Bottom.CustomDraw(150,170,130,False);
Chart1.Axes.Bottom.Labels := oldShowLabels;
Chart1.Axes.Bottom.TickOnLabelsOnly := oldTicksOnLabels;
end;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com