Search code examples
activexteechart

Want to set label value on TeeChart InnerTick VC++


I wanted to set label text value on TeeChart InnerTick using VC++. like we have below example (I wanted to set AAAA,BBBB,CCCC,DDDD values).

// Sorry i was not able to attach image.

Below mention chart we have created using CGraph. to get co-ordinates we are using SDKInfo property. i wanted to know that how can we get all these x axis,y axis values using TeeChart. Is there any API to get these co ordinates ?

1 X axis max (your data units)

2 X axis min (your data units)

3 Y axis max (your data units)

4 Y axis min (your data units)

5 X axis length (Graphics Server view units)

6 Y axis length (Graphics Server view units)

7 X origin (Graphics Server view units)

8 Y origin (Graphics Server view units)

9 Label font size (percentage of system font)

| | | AAAA BBBB CCC DDDD |__________|____________________|___________________|__________________|________ | | | | 111 222 333 444

Thanks,


Solution

  • I'm not sure about what exact TeeChart version are you using so this answer may be a bit vague.

    All binary installations of TeeChart come with a program we call "Features Demo". This program includes examples showing how to use the majority of features supported.
    One of the examples is the "Custom Labels", you should find it under "All Features\Welcome !\Axes\Labels\Custom Labels" in the program.

    Also, to convert axis values to screen pixels, all TeeChart versions provide "Calc*" functions for it. Ie, to convert the value 10 in the bottom axis to pixels, in TeeChart ActiveX:

    XPix = tChart1.Axis.Bottom.CalcXPosValue(10);
    

    Just note these functions need the chart to be drawn once so the internal properties have been initialized and the calculations can be correctly done.