|
AggregateLabel Position relative to base of stacked Bar |
Posted by Christian on Dec-15-2015 22:30 |
|
Hello Peter,
i need to place the TextBox resulting from BarLayer.setAggregateLabelStyle(...) at the
bottom of a stacked bar right above the X-Axis.
With TextBox.setPos i can only shift the TextBox relative to the original position which is
on top of the bar. Unfortunately i don't know the height of the bar before using
BaseChart.makeSession, BaseChart.makeChart or BaseChart.makeChart2.
Is there any other way to accomplish this?
Thanks, Christian. |
Re: AggregateLabel Position relative to base of stacked Bar |
Posted by Peter Kwan on Dec-16-2015 03:04 |
|
Hi Christian,
For your case, the easiest method I can think of is to simply compute the aggregate with
your own code, and put them as labels in another layer. For example, in C#/Java, it is like:
double[] aggregate = new ArrayMath(myData0).add(myData1).add(myData2).result();
double[] zeroArray = new double[myData0.Length]; //just an array of zeroes
//Put the labels above the transparent data points at y = 0
LineLayer labelLayer = c.addLineLayer(zeroArray, Chart.Transparent);
labelLayer.addExtraField(aggregate);
labelLayer.setDataLabelFormat("{field0}");
//disable image map for this layer just in case your code use image maps
labelLayer.setHTMLImageMap("{disable}");
Hope this can help.
Regards
Peter Kwan |
Re: AggregateLabel Position relative to base of stacked Bar |
Posted by Christian on Dec-18-2015 01:11 |
|
Thank you! That worked beautifully! |
|