I'm using ChartDirector for ASP creating a ChartXY with 2 y axes, one for each array of data, one represented by BarChart and the other by LineChart. All values that I use in these cited are numerical values and I need to format the DataLabels and Labels of the Axes differently for positive and negative values.
I've tried many ways, and the main reason is that the methods for setting the formatting of the labels only accept a string and not a function (as is possible in ChartC3 for example), as shown in the documentation: https://www. advsofteng.com/doc/cdcom.htm#paramsub.htm
Formatting example:
data: 88.9 label: 88.9
data: -88.9 label: (88.9)
my code:
Set cd = CreateObject("ChartDirector.API")
Set c = cd.XYChart(800, 440)
Call c.setPlotArea(30, 30, 740, 360)
Call c.xAxis().setLabels(labels)
Set barLayer = c.addBarLayer(data0, &H444466)
Call barLayer.setAggregateLabelStyle()
Call barLayer.setAggregateLabelFormat("{value|,.}")
Set lineLayer = c.addLineLayer(data1, &H66bbbb)
Call lineLayer.setUseYAxis2()
Call lineLayer.setDataLabelFormat("{value|,.}")
Call lineLayer.moveFront()
Call c.yAxis().setLabelFormat("{value|,.}")
Call c.yAxis2().setLabelFormat("{value|,.}")
Does anyone know if it's possible to do something like this using this technology?
I think the description is enough to contextualize
You can use Layer.addCustomAggregateLabel, Layer.addCustomDataLabel and Axis.addLabel to completely control the labels. You can even use CDML to apply different colors to the labels.
Regards Peter Kwan