I am creating a simple pie chart from my VB program. This chart need to have all the value, percentage and category name as it's Data Labels. For a clearer picture I have attached the sample of chart.
However, the solution I have is not 100% meet with my requirements, which i can only set the DataCaption of each DataPoint to either 1, 2, or 4 (value, percentage or category). I hope to have ALL the value, percentage and category.
Code: Select all
Set aPointProp1 = oDiagram.getDataPointProperties(0, 0)
aPointProp1.DataCaption = 2
Set aPointProp2 = oDiagram.getDataPointProperties(1, 0)
aPointProp2.DataCaption = 2
Code: Select all
Set oDiagram = chart.getDiagram
Set oFirstDiagram = chart.getFirstDiagram()
oCoordinateSystems = oFirstDiagram.getCoordinateSystems()
Set oObj_3 = oCoordinateSystems(0)
oChartTypes = oObj_3.getChartTypes()
Set oObj_4 = oChartTypes(0)
oDataSeries = oObj_4.getDataSeries()
Set oobj_5 = oDataSeries(0)
Set aLabel = oobj_5.getDataPointByIndex(0).getPropertyValue("Label")
aLabel.ShowNumberInPercent = True
aLabel.ShowCategoryName = True

Any helping hands are greatly appreciated!
reference: http://api.openoffice.org/docs/common/r ... Label.html