Graphical Interaction with Graphs
Graphical Interaction with Graphs
Hi!
Is there a function available within your charts to have like two line dividers that can be moved accross the graph on the horizontal axis. The graph then must report on the starting value as well as the ending value. I'd like to develop a graphical delete function. All data between these two dividers will then be deleted in the original dataset.
Regards
Jaco Pretorius
Is there a function available within your charts to have like two line dividers that can be moved accross the graph on the horizontal axis. The graph then must report on the starting value as well as the ending value. I'd like to develop a graphical delete function. All data between these two dividers will then be deleted in the original dataset.
Regards
Jaco Pretorius
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jaco,
Yes, TColorBandTool exactly does what you request. For examples on how to use it you can have a look at the features demo at TeeChart's program group.
Yes, TColorBandTool exactly does what you request. For examples on how to use it you can have a look at the features demo at TeeChart's program group.
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 again
I had no demo as you suggested, but I came accross the TColorLine tool which has an extra function than the TColorBand tool and that is to be able to move the lines.
I am using a Chart that displays data over a time period. It should be possible to delete data between two date time values. The TColorLine tool gives you a double value as you move the line, but how on earth do I convert this double value to the exact date time on which the line is.
Have any suggestions/help?
Regards
Jaco
I had no demo as you suggested, but I came accross the TColorLine tool which has an extra function than the TColorBand tool and that is to be able to move the lines.
I am using a Chart that displays data over a time period. It should be possible to delete data between two date time values. The TColorLine tool gives you a double value as you move the line, but how on earth do I convert this double value to the exact date time on which the line is.
Have any suggestions/help?
Regards
Jaco
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jaco,
TColorBandTool also supports line dragging. You can do something like this using a TColorBandTool:
TColorBandTool also supports line dragging. You can do something like this using a TColorBandTool:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
Series1.XValues.DateTime:=true;
Series1.FillSampleValues(50);
With ChartTool1 do
begin
Axis:=Chart1.Axes.Bottom;
ResizeEnd:=true;
ResizeStart:=true;
StartValue:=Series1.XValue[5];
EndValue:=Series1.XValue[15];
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var i1, i2: integer;
begin
i1:=Series1.XValues.Locate(Round(ChartTool1.StartValue));
i2:=Series1.XValues.Locate(Round(ChartTool1.EndValue));
if CheckBox1.Checked then
begin
Series1.Delete(i1,i2-i1, true);
ChartTool1.StartValue:=Series1.XValue[i1];
ChartTool1.EndValue:=Series1.XValue[i2];
end
else
Series1.Delete(i1,i2-i1);
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 Again
How can I actually get the date/time value on which this ColorLine is? I have decided to use the Color Lines and not the Color Bands. My graph is not connected to a dataset, but I have to delete data in a dataset according to this selecteion of the lines.
Regards
Jaco - Thanks for the help so far. It is good.
How can I actually get the date/time value on which this ColorLine is? I have decided to use the Color Lines and not the Color Bands. My graph is not connected to a dataset, but I have to delete data in a dataset according to this selecteion of the lines.
Regards
Jaco - Thanks for the help so far. It is good.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jaco,
Have you tried using the Locate method and Series.XValue[index] as in the code snippet I posted before?
Have you tried using the Locate method and Series.XValue[index] as in the code snippet I posted 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jaco,
It works fine for me here doing something like this:
Could you please check if this works at your end and if the problem persists send us an example we can run "as-is" to reproduce the problem here?
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
It works fine for me here doing something like this:
Code: Select all
uses Math;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
Series1.XValues.DateTime:=true;
Series1.FillSampleValues(50);
SetRoundMode(rmUP);
end;
procedure TForm1.ChartTool1DragLine(Sender: TColorLineTool);
var
i1,i2: Integer;
y,m,d: Word;
begin
i1:=Series1.XValues.Locate(Trunc(ChartTool1.Value));
i2:=Series1.XValues.Locate(Round(ChartTool1.Value));
DecodeDate(Series1.XValue[i1],y,m,d);
Memo1.Lines.Add(IntToStr(d)+'/'+IntToStr(m)+'/'+IntToStr(y));
DecodeDate(Series1.XValue[i2],y,m,d);
Memo1.Lines.Add(IntToStr(d)+'/'+IntToStr(m)+'/'+IntToStr(y));
end;
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
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 |
-
- Newbie
- Posts: 26
- Joined: Tue Apr 02, 2002 5:00 am
- Location: University of Oslo
- Contact:
I thought tOlorBandTool are lacking an important event for that, an event that tell the program that a line has been dragged?narcis wrote:Hi Jaco,
TColorBandTool also supports line dragging. You can do something like this using a TColorBandTool:
Maybe somethng for next version?
Would also be interesting if the area also could be moved around, I have a use here where the area should change dependent on data it covers.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi achristouio,
Yes, I added your request to our wish-list to be considered for inclusion in future releases.I thought tOlorBandTool are lacking an important event for that, an event that tell the program that a line has been dragged?
Maybe somethng for next version?
Could you please give us more specific information on that request?Would also be interesting if the area also could be moved around, I have a use here where the area should change dependent on data it covers.
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 |