Author |
Topic  |
|
Tobias J
10 Posts |
Posted - 07 Sep 2006 : 06:24:40
|
Hello, I’m struggling with what I believe should be a really easy thing to do. I simply want to get a list of all the labels (i.e. text strings) displayed below an x-axis. Please tell me how to accomplish this.
Regards, Tobias |
|
quinncurtis
1164 Posts |
Posted - 07 Sep 2006 : 08:24:08
|
Sorry, we do not have such a function. The text used to label numeric axes is generated and displayed on-the-fly, based on the numeric value of the tick mark. Once displayed, the actual string is not saved.
Why do you need the axis label strings ? |
 |
|
Tobias J
10 Posts |
Posted - 07 Sep 2006 : 09:11:19
|
Well I actually don’t need the axis label strings themselves. When I am using a TimeAxis x-axis I want to draw vertical lines in the chart for every new day (2006-09-01, 2006-09-02 etc.). If the dataserie time span is large (e.g. a month), I don’t want to draw a line for every date though because that would make the chart quite messy. Instead, I would like to draw a line for every date that is displayed when using
xAxisLabel.SetOverlapLabelMode(ChartObj.OVERLAP_LABEL_DELETE)
For a month, that might mean that the dates 2006-09-01, 2006-09-04 etc. are displayed, while labels for 2006-09-02, 2006-09-03 etc. are not shown. I have tried to examine the TickMarks in the ArrayList from xAxis.GetAxisTicksArrayList(), but I can’t distingusish the ticks whose corresponding text labels are displayed.
Regards Tobias
|
 |
|
quinncurtis
1164 Posts |
Posted - 07 Sep 2006 : 10:22:38
|
We don't keep track of what major tick marks get labels in the case of the OVERLAP_LABEL_DELETE mode. When the code cycles through the major tick marks, we compare the bounding box of the current tick mark's label to the bounding box of the previous label, and if the labels overlap, do not display the current tick mark label. We don't mark the tick mark structure in any way though, because on subsequent redraws, if the size of the chart changes by as little as a pixel, the way labels overlap may change and previously deleted labels will suddenly start to appear. Everything has to be recalculated every redraw anyway. So any lines you draw to match tick mark labels may be invalid with the next redraw.
What you want to do sounds very similar to our Grid class, only that class will display horizontal or vertical lines at all major (or minor) tick marks, regardless if the associated tick mark label was removed because it overlapped with another label. Horizontal date labels can take up alot of space, while grid lines don't, so it never made much sense to have the grid lines track the tick mark labels, rather than the tick marks themselves.
I don't see any way you can get the information you want unless you get the source code, or hire our special services group to make the necessary changes.
|
 |
|
|
Topic  |
|
|
|