Hello,
i've already searched the forums but could not find a hint on this, so here's my question:
I'm adding several Steema.TeeChart.Styles.Line Series to the TChart control via the method public int Add(DateTime x, double y);
The user can freely pan and zoom in the tchart control that displays the data.
I'd like to know the earliest and latest visible dataset. So i can add
a header to the chart like "Data from yymmdd to yymmdd"
this is important for printing the chart, since sometimes the chart only displays the time of the datasets without the date
How can i achieve this?
It would be okay for me if i scan through the data in Series and can
somehow determine whether the dataset is visible.
Regards
Klaus
How to determine the data visible in the chart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Klaus,
You can try doing something like this:
Or this:
You can try doing something like this:
Code: Select all
double first = tChart1[0].XValues[tChart1[0].FirstVisibleIndex];
double last = tChart1[0].XValues[tChart1[0].LastVisibleIndex];
Code: Select all
double first = tChart1[0].XValues[tChart1[0].FirstDisplayedIndex()];
double last = tChart1[0].XValues[tChart1[0].LastDisplayedIndex()];
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 |
Hello Narcís,
thanks this is exactly what i needed, i use:
to also back-convert to DateTime format
Kind regards, have a nice evening
Klaus
thanks this is exactly what i needed, i use:
Code: Select all
Series series = tChart1.Series[0];
int firstVisibleIndex = series.FirstVisibleIndex;
int lastVisibleIndex = series.LastVisibleIndex;
earliest = Steema.TeeChart.Utils.DateTime(series.XValues[firstVisibleIndex]);
latest = Steema.TeeChart.Utils.DateTime(series.XValues[lastVisibleIndex]);
Kind regards, have a nice evening
Klaus