XValueToText Showing the Index Value not the Text
XValueToText Showing the Index Value not the Text
I have a DBChart with numbers on the Y axis and the Month and Year as a string on the X axis. I am trying to get the X and Y value when the user clicks on the series. I am using the event ClickSeries and the code strXVar := Series.XValueToText(Series.XValue[ValueIndex]). How do I get the value such as 'January 1998' that appears in the X axis?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi McMClark,
This works fine for me using a series with X values being DateTime and setting the bottom axis labels format as shown here:
This works fine for me using a series with X values being DateTime and setting the bottom axis labels format as shown here:
Code: Select all
procedure TForm1.Series1Click(Sender: TChartSeries; ValueIndex: Integer;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
DBChart1.Title.Text[0]:=Series1.XValueToText(Series1.XValue[ValueIndex]);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues();
Series1.XValues.DateTime:=true;
DBChart1.Axes.Bottom.DateTimeFormat:='MMMM-yyyy';
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 |