Hi
I want to build a popmenu include 'linestyle' 'linewidth' 'linecolor' 'linemarks' etc. When custom Press the Item runtime, the according dialog pop up . which tool can I use in chart ?how to use?
about chart line style ,width
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi hexfhhu,
You can use TeeChart's and Series' mouse related events to check what's being selected. However TeeChart doesn't have a pop-up menu component. For this you'll have to use Delphi standard components or other 3rd party components.
You can use TeeChart's and Series' mouse related events to check what's being selected. However TeeChart doesn't have a pop-up menu component. For this you'll have to use Delphi standard components or other 3rd party components.
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 Narcís
You are right . I have builded a popmenu , I do not known how to change series width, color,style, the series I have get from following code :
procedure TFormShowLinebak.Chart1ClickSeries(Sender: TCustomChart;
Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if (ValueIndex > 0) and (Button=mbRight)and (Series<>nil) then
begin
MenuLineColor.Enabled:=True;
MenuLineType.Enabled:=True;
MenuLineWidth.Enabled:=True;
MenuPointStyle.Enabled:=True;
SelectedSeries:=Series;//my selected series //SelectedSeries:TChartSeries; I have declared in public
end;
end;
Best Regard
hexfhhu
You are right . I have builded a popmenu , I do not known how to change series width, color,style, the series I have get from following code :
procedure TFormShowLinebak.Chart1ClickSeries(Sender: TCustomChart;
Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if (ValueIndex > 0) and (Button=mbRight)and (Series<>nil) then
begin
MenuLineColor.Enabled:=True;
MenuLineType.Enabled:=True;
MenuLineWidth.Enabled:=True;
MenuPointStyle.Enabled:=True;
SelectedSeries:=Series;//my selected series //SelectedSeries:TChartSeries; I have declared in public
end;
end;
Best Regard
hexfhhu
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi hexfhhu,
With the code you posted you may not be able to do that because you need to type cast the series variable, for example:
With the code you posted you may not be able to do that because you need to type cast the series variable, for example:
Code: Select all
(SelectedSeries as TLineSeries).LinePen.Width:=3;
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 |
When I pressed the popmenu Item such as ' color ' , I add code
procedure TFormShowLinebak.MenuLineColorClick(Sender: TObject);
begin
ButtonPen1.LinkPen(SelectedSeries.Pen);
// ButtonPen1: TButtonPen; declared in public
ButtonPen1.OnClick(Sender);
end;
but I can not get the result as pressed ButtonPen1
procedure TFormShowLinebak.MenuLineColorClick(Sender: TObject);
begin
ButtonPen1.LinkPen(SelectedSeries.Pen);
// ButtonPen1: TButtonPen; declared in public
ButtonPen1.OnClick(Sender);
end;
but I can not get the result as pressed ButtonPen1
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi hexfhhu,
Which is the type of the series you are using. If it's a line series you need to use LinePen instead of Pen property. To achieve that you'll need to type cast SelectedSeries as I told you before.
Which is the type of the series you are using. If it's a line series you need to use LinePen instead of Pen property. To achieve that you'll need to type cast SelectedSeries as I told you before.
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 |