|
Missing text on bars after position change |
Posted by icm63 on Apr-15-2013 16:17 |
|
code...
Dim c As XYChart = New XYChart(950, xyHeight, Chart.silverColor)
c.setPlotArea(30, 10, 910, 180).setGridColor(Chart.Transparent)
Dim layer As BarLayer = c.addBarLayer3(AdjData, BarColor)
Dim Tbox As ChartDirector.TextBox = layer.setDataLabelStyle("Arial")
Tbox.setFontColor(&H0)
Tbox.setFontSize(7)
Tbox.setPos(0, -15)
Tbox.setBackground(Chart.Transparent, Chart.Transparent, 0)
QUESTION: Why is text missing on top of the bar in the chart??
|
Re: Missing text on bars after position change |
Posted by Peter Kwan on Apr-16-2013 00:02 |
|
Hi icm63,
Text added using setDataLabelStyle are supposed to be inside the bars. If you would like to add text above the bars, you may use setAggregateLabelStyle instead, which automatically put the text on top and outside of the bars.
For setDataLabelStyle, if the bar is too small to contain the text, ChartDirector by default will hide the text. Even if your code moves the text elsewhere, ChartDirector would still check the bar size as if the text is inside the bar. You may use layer.setMinLabelSize(0) to force the text to display regardless of bar size.
(In the past, ChartDirector displays the text regardless of bar size, but many people complain about that. So in modern versions of ChartDirector, by default, the text is displayed only if the bar is tall enough to contain the text. To maintain flexibility, we leave an API BarLayer.setMinLabelSize to allow this behaviour to be configured.
Hope this can help.
Regards
Peter Kwan |
|