how to get the result as examples 'opaque zones'
how to get the result as examples 'opaque zones'
Hello.
I want get the result as the result as examples 'opaque zones' ,I build a new form and put on a Tchart component ,a Tcheck component and a TScrollBar component , then copy the source code to my new project. But When I Compile Error notice :"Field TAxisOpaqueZone.ChartTool1 does not a correspondind component . Remove the Declaration?" How can i do?
my environment is BD7 and Teechart 7.06
I want get the result as the result as examples 'opaque zones' ,I build a new form and put on a Tchart component ,a Tcheck component and a TScrollBar component , then copy the source code to my new project. But When I Compile Error notice :"Field TAxisOpaqueZone.ChartTool1 does not a correspondind component . Remove the Declaration?" How can i do?
my environment is BD7 and Teechart 7.06
Hi,
using the same code as in the example should work fine, most likely the error is related with the ColorLine Tools which you must add, at runtime or at design time.
using the same code as in the example should work fine, most likely the error is related with the ColorLine Tools which you must add, at runtime or at design time.
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi.
To add a chart tool to specific chart, do the following:
1. Add a TChart on the form.
2. Select tChart with left mouse button.
3) Press right mouse button to bring up chart editor.
4) Select the "Tools" tab.
5) Press the "+" sign button
6) Select "Axis" tab
7) Double click the "color line" tool icon.
To add a chart tool to specific chart, do the following:
1. Add a TChart on the form.
2. Select tChart with left mouse button.
3) Press right mouse button to bring up chart editor.
4) Select the "Tools" tab.
5) Press the "+" sign button
6) Select "Axis" tab
7) Double click the "color line" tool icon.
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Hi,
you could make use of the ExtraLegend Tool which allows you to display one Legend for each Series, and then use similar code to the following which allow to move them with the mouse :
you could make use of the ExtraLegend Tool which allows you to display one Legend for each Series, and then use similar code to the following which allow to move them with the mouse :
Code: Select all
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
If Button = mbLeft Then
begin
If iDragged = -1 Then
begin
Chart1.Cursor := 2020;
iDragged := Chart1.Legend.Clicked(X, Y);
If iDragged <> -1 Then
begin
With Chart1.Legend do
begin
xDisp := X - ShapeBounds.Left;
yDisp := Y - ShapeBounds.Top
End;
End
else begin
i2Dragged := charttool1.Legend.Clicked(X, Y);
If i2Dragged <> -1 Then
begin
With Charttool1.Legend do
begin
xDisp := X - Charttool1.legend.ShapeBounds.Left;
yDisp := Y - Charttool1.legend.ShapeBounds.Top
End;
End
else begin
i2Dragged:=-1;
Chart1.Cursor := 0;
end;
end;
end
Else
begin
iDragged := -1;
Chart1.Cursor := 0
End;
End;
end;
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
If iDragged <> -1 Then
begin
With Chart1.Legend do
begin
Left := X - xDisp;
Top := Y - yDisp
End;
End;
if i2Dragged <> -1 then
begin
with ChartTool1.Legend do
begin
Left:=X-xDisp;
Top:=Y-yDisp
end;
end;
end;
procedure TForm1.Chart1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
iDragged := -1;
i2Dragged := -1;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
iDragged := -1;
i2Dragged := -1;
Chart1.Zoom.Allow:=false;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi hexfhhu,
To achieve that you'll need to add one extra legend tool for each series in the chart, for example:
After that you'll have to make some changes in the OnMouseDown event Pep posted. You'll have to change this:
For something like this:
And also some similar changes in the OnMouseMove event when ChartTool1 is used you should replace it by tmpTool.
To achieve that you'll need to add one extra legend tool for each series in the chart, for example:
Code: Select all
uses Series, TeeExtraLegendTool;
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
tmpTool: TExtraLegendTool;
begin
for i:=0 to 40 do
begin
Chart1.AddSeries(TLineSeries.Create(self));
tmpTool:=TExtraLegendTool.Create(self);
Chart1.Tools.Add(tmpTool);
tmpTool.Series:=Chart1[i];
Chart1[i].FillSampleValues();
end;
end;
Code: Select all
i2Dragged := charttool1.Legend.Clicked(X, Y);
If i2Dragged <> -1 Then
begin
With Charttool1.Legend do
begin
xDisp := X - Charttool1.legend.ShapeBounds.Left;
yDisp := Y - Charttool1.legend.ShapeBounds.Top
End;
End
else begin
i2Dragged:=-1;
Chart1.Cursor := 0;
end;
Code: Select all
for i:=0 to Chart1.Tools.Count do
begin
if (Chart1.Tools.Items[i] is TExtraLegendTool) then
begin
tmpTool := (Chart1.Tools.Items[i] as TExtraLegendTool);
i2Dragged := tmpTool.Legend.Clicked(X, Y);
end;
if (i2Dragged <> -1 ) then
begin
With tmpTool.Legend do
begin
xDisp := X - tmpTool.legend.ShapeBounds.Left;
yDisp := Y - tmpTool.legend.ShapeBounds.Top
end;
break;
end
else begin
i2Dragged:=-1;
Chart1.Cursor := 0;
end;
end;
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
I get the legend for every series , but the legend style is set to the series value automatically. I want to change the legend style to seriesname for erery legend, how can I do it?
By the way, I wonder whether the legend can show one or several series names that i want it to show, not just show all the series names. If it can do that, could give me a samlpe program? thank you very much.
just
Best Regard
hexfhhu
I get the legend for every series , but the legend style is set to the series value automatically. I want to change the legend style to seriesname for erery legend, how can I do it?
By the way, I wonder whether the legend can show one or several series names that i want it to show, not just show all the series names. If it can do that, could give me a samlpe program? thank you very much.
just
Best Regard
hexfhhu
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi hexfhhu,
You can do something like this:
I get the legend for every series , but the legend style is set to the series value automatically. I want to change the legend style to seriesname for erery legend, how can I do it?
You can do something like this:
Code: Select all
for i:=0 to Chart1.Tools.Count do
if (Chart1.Tools.Items[i] is TExtraLegendTool) then
(Chart1.Tools.Items[i] as TExtraLegendTool).Legend.LegendStyle:=lsSeries;
You may want to do something as in the All Features\Welcome!\Miscellaneous\Legend\Drawing more text example in the features demo. You'll find the demo at TeeChart's program group.By the way, I wonder whether the legend can show one or several series names that i want it to show, not just show all the series names. If it can do that, could give me a samlpe program? thank you very much.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi hexfhhu,
Thanks for the image. According to it I think that would be most suitable for your needs is using ChartListBox component as shown in the All Features\Welcome!\Components\Chart ListBox examples at the features demo.
Thanks for the image. According to it I think that would be most suitable for your needs is using ChartListBox component as shown in the All Features\Welcome!\Components\Chart ListBox examples at the features demo.
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 hexfhhu,
I've not seen the image you sent to my colleague Narcis (as he is at this moment on holidays), but seeing at your post as he said using ChartListBox should be the best way. You can use some ChartListBox component, assign to all the same Chart and then customize which Series (items) must be displayed. To remove items you can use :
ChartListBox1.Items.Delete(1); // Delete Series index 1
If this still not help please send me the image directly to my mail (pep@steema.com).
I've not seen the image you sent to my colleague Narcis (as he is at this moment on holidays), but seeing at your post as he said using ChartListBox should be the best way. You can use some ChartListBox component, assign to all the same Chart and then customize which Series (items) must be displayed. To remove items you can use :
ChartListBox1.Items.Delete(1); // Delete Series index 1
If this still not help please send me the image directly to my mail (pep@steema.com).
Pep Jorge
http://support.steema.com
http://support.steema.com