ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Positioning label over bar
Posted by Nick on Aug-03-2011 03:45
Attachments:
Hello,

I am trying to display a '0.0' just above the X axis to distinguish between bars with no value and bars with a value of zero. How can I accomplish this on my multi-series bar chart?

I am creating the chart through repeated calls to BarLayer.addDataSet().

Thank You,
Nick
a.png

  Re: Positioning label over bar
Posted by Peter Kwan on Aug-04-2011 01:03
Hi Nick,

If you want to add a certain label on top of certain bars, you may use Layer.addCustomGroupLabel. An example is like:


//data0, data1 and data2 are the data arrays for the 3 data sets
double[][] allData = { data0, data1, data2 };

for (int i = 0; i < allData.Length; ++i) {
     for (int j = 0; j < addData[i].Length; ++j) {
          if (allData[i][j] == 0)
                layer.addCustomDataLabel(i, j, "0.0", "Arial", 8, 0x000000);
     }
}


Hope this can help.

Regards
Peter Kwan

  Re: Positioning label over bar
Posted by Nick on Aug-05-2011 02:53
Thanks Peter, worked perfectly!