I am trying to think of a neat way to position text boxes in charts based on the respective data in the chart, my first attempt of this (below) works, but still requires me to move the text boxes around to somewhere more visually appealing:
Code: Select all
for !h =1 to data.@count 'data is a group object with the data that is being plotted
%label = @wordq(%chart_labels, !h) ' the labels I would like to put in the text box
%label = @stripquotes(%label)
%colour = @wordq(%colour_list, !h) ' This is custom colour list defined elsewhere
!shift = -0.3+!h ' My attempt to position the textbox somewhere different each time the loop runs
chart.addtext(0, !shift , keep ,textcolor({%colour}), fillcolor(@rgb(255,255,255)), framecolor(@rgb(0,0,0)), font(Arial,12,b,-i,-u,-s)) {%label}
next
I'd really like to get to a point where they are positioned some where near the data they refer to, but not on the data, in the first instance. And if I have to move them after for a final touch then I can.
Any suggestions?
Thanks
Adam