Hello,
I use TChart and TSeries for some acquisition of data during a time.
I want to draw marks on some points I have on my series which match with a certain time.
I use the event TSeriesGetMarkText to make visible (MarkText:='Text') or not (MarkText:='') the marks depending on the time.
It works well but at the end, I save my chart in a stream file. When I open this file in an other chart, all marks are visible and the labels match with the YValues of the points.
How can I save the text and the index of the marks I put in the event TSeriesGetMarkText and open it in the right way in an other chart ?
Thanks in advance.
Benoît
Save Marks text
Re: Save Marks text
Hello Benoît,
I'm afraid the exportation can store the design of the chart but not the code in the application.
Instead of using the TSeriesGetMarkText, you could populate the series' Labels array and the empty strings won't be shown. Here you have a simple example:
I'm afraid the exportation can store the design of the chart but not the code in the application.
Instead of using the TSeriesGetMarkText, you could populate the series' Labels array and the empty strings won't be shown. Here you have a simple example:
Code: Select all
uses Series, DateUtils;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
tmpDate: TDateTime;
str: string;
begin
Chart1.Legend.Visible:=false;
with Chart1.AddSeries(TPointSeries) as TPointSeries do
begin
XValues.DateTime:=true;
for i:=0 to 9 do
begin
str:='';
tmpDate:=Today+i;
if (i mod 4 = 0) then
str:='point ' + IntToStr(i);
AddXY(tmpDate, 25+random*75, str);
end;
Marks.Visible:=true;
Marks.Style:=smsLabel;
end;
Chart1.Axes.Bottom.LabelStyle:=talValue;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Save Marks text
Hello Yeray,
Thanks for your solution, it seems to work well !
Benoît
Thanks for your solution, it seems to work well !
Benoît