Accessing the Chart3D property
Posted: Fri Nov 21, 2008 9:04 pm
I am trying to access the Chart3D property on a TChartStyleBarColumn chart. But I get an access violation. When I step through the source I see that the FRecord object in the TChart3D object is nil. I must not be accessing the property correctly. Here is my code:
with myChart do begin
Col1 := 6;
Col2 := 20;
Row1 := 5;
Row2 := 30;
Series[0].Values := 'Sheet1!$B$2:$E$2';
Series.Add;
Series[1].Values := 'Sheet1!$B$3:$E$3';
Series.Add;
Series[2].Values := 'Sheet1!$B$4:$E$4';
PlotArea.Is3D := true;
PlotArea.ChartType := xctColumn;
//==> Access violation on next line.
TChartStyleBarColumn(PlotArea.ChartStyle).Chart3D.Rotation := 20;
TChartStyleBarColumn(PlotArea.ChartStyle).Chart3D.Elevation := 15;
end;
Can someone tell me what I am doing wrong?
Thanks,
Hardee Mahoney
Washington, DC
with myChart do begin
Col1 := 6;
Col2 := 20;
Row1 := 5;
Row2 := 30;
Series[0].Values := 'Sheet1!$B$2:$E$2';
Series.Add;
Series[1].Values := 'Sheet1!$B$3:$E$3';
Series.Add;
Series[2].Values := 'Sheet1!$B$4:$E$4';
PlotArea.Is3D := true;
PlotArea.ChartType := xctColumn;
//==> Access violation on next line.
TChartStyleBarColumn(PlotArea.ChartStyle).Chart3D.Rotation := 20;
TChartStyleBarColumn(PlotArea.ChartStyle).Chart3D.Elevation := 15;
end;
Can someone tell me what I am doing wrong?
Thanks,
Hardee Mahoney
Washington, DC