Page 1 of 1

Group several variables on X-axis?

Posted: Fri Jan 20, 2006 1:58 pm
by 9637919
I will try to explain what I want to do with the purpose of finding out if this is doable in an easy way.

What I want to do is to have a series with some values for Y and with several variables linked to it's X, probably as labels. What do I mean with several variables? Well, imagine that you have data that is grouped somehow, in our example we have hierarchical entities that have statistical data, so it might look like this:

Code: Select all

Y
|
|
|
|
|
|
|
_______________________________ X
|   |   |   |   |   |   |   |   |
0    5     8    12   4    6     9    22   35
|                |                |
______________________________
        |                      |
    Group 1               Group 2

That is basically what I want it to look like. Basically you say "this column is Y, this is X1 and this is X2 for this series" or something like it.

Any ideas?

Is this doable with the TeeChart in some easy way?

Cheers,
Tommie Nygren

Posted: Fri Jan 20, 2006 4:02 pm
by narcis
Hi Tommie,

You have 2 options for doing that:

1) Adding a custom horizontal axis located where you need with a fake series with all points being transparent associated and add custom labels to this axis. You'll find an example of custom axis labels at the TeeChart features demo, available at its program group. The example is "All Features\Welcome !\Axes\Labels\Custom labels".

2) Custom drawing on TChart's canvas to draw a line and the desired text calculating the text position with the series CalcXPos, CalcXPosValue, ... methods. For an example on how to custom draw on TeeChart's canvas you can look at the examples under "All Features\Welcome !\Canvas" in the features demo.