Can anyone help me with how to use “Office.xlDataLabelsShowLabelAndPercent” when formatting a chart in Excel within Realbasic please
I have gotten as far as “Excel.ActiveChart.SeriesCollection(1).ApplyDataLabels” but wish to apply the above to the PIE chart but I cannot work out the correct syntax to use it.
Also why is talking to Exel windows platform specific as Office(incl Excel) is available on a MAC and the wiki sort of teases you into thinking there is an excelapplication for a MAC but gets you back to windows page. Just curious to know.
excel.Charts.add //add the chart
excel.charts.Select_ //select the chart
excel.ActiveChart.SetSourceData Excel.Sheets(“Sheet1”).Range(“A1:B6”) // Select the data Range
excel.ActiveChart.ChartType = office.xl3DPieExploded //Choose the Chart Type
excel.activechart.PlotBy = office.xlvalue //Plot the data by columns
Many many thanks for this Eugene. Your example, not only giving me the labels&percentages, has answered several other questions I was asking myself as well. I really must get round to buying your book!
This example (4-11) has been added to the next version of the book Wish I Knew How To… Program Excel 2010 with Xojo in Windows (version 2.1) that I am targeting for an August release date. I Wish I Knew How To… Series Link