Click to See Complete Forum and Search --> : Visual Fox Pro


suni
02-23-2004, 12:19 PM
Hey i am working on a program in VFP, making pie charts using ChartDirector

I having one error that i cant figure out for the life of me.
Following is the code:

oChart = Createobject("ChartDirector.API")
DIMENSION data[3] = (25,25,75)
DIMENSION labels[3]=("Labor","Licenses","Taxes")
pie = oChart.PieChart(450,240)
pie.setPieSize(150,100,80)
pie.addTitle2(oChart.Bottom, "Project Cost Breakdown","arialbi.ttf")
pie.set3D()
pie.addLegend(330,40)
pie.setLabelFormat("{label} ${value}K<*br*>({percent}%)")

pie.setData(data,labels) ***PROBLEM***
pie.setExplode(0)
viewer.Picture = pie.makePicture()

viewer.ImageMap = pie.getHTMLImageMap("Clickabe", "",_"title='{label}: US${value}K ({percent}%)'")

At setData (a chartDirector Function) i get the following Error:

OLE IDispatch exception code 0 from ChartDirector: Error converting argument 1 to Type class DoubleArray.

Thanks for the help!!!!!

myauuuu
02-12-2009, 10:30 AM
PUBLIC ochart,pie
oChart = Createobject("ChartDirector.API")
DIMENSION deata(3)
deata(1)=25 && TIENE QUE SER NUMERICO
deata(2)=35 && TIENE QUE SER NUMERICO
deata(3)=75 && TIENE QUE SER NUMERICO

pie = oChart.PieChart(450,240)
pie.setPieSize(150,100,80)
pie.addTitle2(oChart.Bottom, "Project Cost Breakdown","arialbi.ttf")
pie.set3D()
pie.addLegend(330,40)
pie.setLabelFormat("{label} ${value}K<*br*>({percent}%)")

pie.setData(@deata) && ***SOLUCION ***

pie.makechart("testje.png")

:):):):):):):):)