Focal Point
[CLOSED] setDataTextPosition()

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/938100822

September 02, 2009, 03:48 PM
arsalan
[CLOSED] setDataTextPosition()
I've a graph with 2 series, bar (series 0) and a line (series 1). I need to display bar values on the bottom of the graph and line vlaues on top of the line.
I tried this, it works fine for line values but bar values also stay on top:

setDisplay(getDataText(0),true);
setDataTextPosition(getDataText(0),5);
setDisplay(getDataText(1),true);
setDataTextPosition(getDataText(0),1);

Also, there are occasions when sometimes line vlaues appear on bars and sometimes on top of them (depending on the line), is there a way to automatically adjust the font color for line vlaues because they appear on different backgrounds.

Thanks.

This message has been edited. Last edited by: Kerry,
September 03, 2009, 06:18 AM
<JG>
quote:
setDisplay(getDataText(0),true);
setDataTextPosition(getDataText(0),5);
setDisplay(getDataText(1),true);
setDataTextPosition(getDataText( 0),1);

looking at the code the obvious reason is that your 2nd setDataTextPosition is point to the wrong series

Automatic text coloring takes no account of background, if you want to change the colors then
you would have to code it via the API for each bar taking into account if you have an overlap
which would mean preprocessing and generating the required API code to include.

This message has been edited. Last edited by: <JG>,
September 04, 2009, 09:01 AM
arsalan
Sorry about the typo, even after fixing it to
setDataTextPosition(getDataText(1),1);
it doesn't do the job.

setDisplay(getDataText(0),true);
setDataTextPosition(getDataText(0),5);

setDisplay() seems to work fine but not setDataTextPosition() for any values between 1-5.
September 04, 2009, 10:24 AM
<JG>
arsalan,

just rechecked to docs and what you are trying to do is not supported.

setDataTextPosition takes a single argument 0 to 5 and does not support the (getSeries(0),1) construct
If you run it without the error suppresion in the advanced graph assistant or in the old graph assistant
you will see the java error returned.

The only possible option is to play around with setDataTextRadius but I have not been able to get it to work.
September 04, 2009, 12:59 PM
arsalan
I'll try with some other commands. Thanks for your help though.