ColorEachPoint won't color each one
Posted: Tue May 10, 2005 6:32 pm
I know I've had this issue before & I can't remember how to fix it. I want every slice of the pie to be a different color Using VFP 9.0 with TeeChart Pro v7.0.0.2, with a Pie Chart. Color Each Slice is checked. What am I supposed to pass to .Series[0].Add(nVal,cVal,?nColor) as nColor? Here's the code to setup the data...
Code: Select all
.Series[0].Title = cSeriesName
FOR i = 1 TO .SeriesCount
.Series[i-1].Clear
ENDFOR
.Axis.Left.Labels.RoundFirstLabel = .T. && Always round off axis labels.
.Axis.Bottom.Labels.RoundFirstLabel = .T. && Always round off axis labels.
SELECT (cDataSource)
num_Fields = FCOUNT(cDataSource)
cLblField = FIELD(1)
SCAN ALL
FOR i = 1 TO MIN(num_fields - ,.SeriesCount) && Now insert the data
cValField = FIELD(i+1)
.Series[i-1].ColorEachPoint = .T.
.Series[i-1].Add(NVL(&cValField,0),ALLTRIM(TRANSFORM(&cLblField)),.Series[i-1].Color)
ENDFOR
ENDSCAN
.Visible = .T.