Accessing the Chart3D property

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
mahoneyh
Posts: 4
Joined: Tue Nov 11, 2008 10:02 pm

Accessing the Chart3D property

Post by mahoneyh »

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
doconnor
Posts: 3
Joined: Thu Sep 16, 2010 8:33 pm

Re: Accessing the Chart3D property

Post by doconnor »

I tried to access to Chart3D property of a Pie chart and I seem to have gotten the same error (2 years later).

It occurred on the line

TChartStylePie(PlotArea.ChartStyle).Chart3D.Elevation := 85;

The documentation mentions the TChart3D class, but doesn't say how to access it.
doconnor
Posts: 3
Joined: Thu Sep 16, 2010 8:33 pm

Re: Accessing the Chart3D property

Post by doconnor »

I have fixed the Chart3D property for Pie Charts.

I added this line

(Id: $103A; Data: #$00#$00#$0F#$00#$1E#$00#$64#$00#$64#$00#$96#$00#$00#$00), // CHART3D

to the RecordStorageChart[2, 3 or 4].DefaultRecordsStylePie array between Id: $1022 and Id: $1015.

I'm not sure why this problem wasn't fixed. 80% of the work for this feature had been done.

To fix other type of charts would be similar, although the data would be different because the detail 3D view is different. The structure for the data can be found in BIFFRecsII[2, 3 or 4].TCRec3D
Post Reply