I've a need to show the user that there is a point on my line series that is very different from the rest, for example 100,000 points may be value=50 but point 1234 may be value=80. When the chart draws, it can hide this single event. How best can I make it visible?
Thanks
Brian
Single data events hidden on large line charts
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Brian,
You could "play" with pointer styles, colours and with left axis scales as done in the example below. To run it put a TChart into a form and add a line series to it.
You could "play" with pointer styles, colours and with left axis scales as done in the example below. To run it put a TChart into a form and add a line series to it.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
for i:=1 to 100000 do
if i=1234 then Series1.Add(80)
else Series1.Add(50);
Series1.Pointer.Visible:=true;
Chart1.Draw;
end;
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var
Min, Max: double;
begin
Min:=Series1.YValues.MinValue;
Max:=Series1.YValues.MaxValue;
Chart1.Axes.Left.SetMinMax(Min-20,Max+20);
end;
function TForm1.Series1GetPointerStyle(Sender: TChartSeries;
ValueIndex: Integer): TSeriesPointerStyle;
begin
if ValueIndex > 0 then
if (Series1.YValue[ValueIndex]-Series1.YValue[ValueIndex-1]>10) then
result:=FormatPointer(Sender,ValueIndex)
else result:=psNothing
else
if (Series1.YValue[ValueIndex]-Series1.YValue[ValueIndex+1]>10) then
result:=FormatPointer(Sender,ValueIndex)
else result:=psNothing;
end;
function TForm1.FormatPointer(Sender: TChartSeries;
ValueIndex: Integer): TSeriesPointerStyle;
begin
(Sender as TLineSeries).Pointer.Color:=clBlue;
result:=psRectangle;
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Brian,
It appears as a single pixel line because there are many points and just one with that value. However you could also change line pen width.
It appears as a single pixel line because there are many points and just one with that value. However you could also change line pen width.
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 |
Narcis, Thanks it was me. I had DrawAllPoints set false becuase this was a good speed increase at an earlier time. I think I will have to leave DrawAllPoints set true and live with the increased time. It would be great if DrawAllPoints true looked at the data and rendered the max (or min) of the data points represented by that pixel, that way anyone could still see the data extents and gain the speed advantage.
Brian
Brian
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Brian,
Ok, I've added your request to our wish-list to be considered for future releases. However, I guess this feature can also be an inconvenient for other TeeChart users.
If you need to improve your chart's performance please read this article about optimizing TeeChart performance for real-time charting. Maybe you can apply some of those advises to your application.
Ok, I've added your request to our wish-list to be considered for future releases. However, I guess this feature can also be an inconvenient for other TeeChart users.
If you need to improve your chart's performance please read this article about optimizing TeeChart performance for real-time charting. Maybe you can apply some of those advises to your application.
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 |