I'm recreating the contents of a TDBChart within a QuickReport TQRChart.
I'm using the following syntax to do this :
QRChart1.Chart.FreeAllSeries;
QRChart1.Chart.:eftAxis.Automatic := False;
QRChart1.Chart.Assign(DBChart1);
for i := 0 to (DBChart1.SeriesCount - 1) do
begin
CloneChartSeries(DBChart1).ParentChart := QRChart1.Chart;
end;
This works fine and gives me the appropriate bars (in a bar graph) or sections in a pie chart.
The problem I seem to have with this is when I set the colours of the bars (or sections) myself at run-time. The Bar Chart / Pie Chart has only one series in each case and I set 'ColorEachPoint' to True (forcing each plot to be presented in a different colour).
If I use the syntax 'DBChart1.Series[0].ValueColor[x] := clBlack' for instance (to make the x'th plot Black) - if I then use the CloneChartSeries code the resultant chart (in the QuickReport Chart component) does not reflect this colour change.
If I run the same principal using a standard TChart (rather than a TDBChart) then the colour is fed through accordingly. It is only when I try using this from a TDBChart that I see the problem.
Can anyone suggest what I am doing wrong here ?
Or is this a bug with the TDBChart component ?
Any help / pointers would be appreciated.
Thanks in advance
Steve
I'm using the following syntax to do this :
QRChart1.Chart.FreeAllSeries;
QRChart1.Chart.:eftAxis.Automatic := False;
QRChart1.Chart.Assign(DBChart1);
for i := 0 to (DBChart1.SeriesCount - 1) do
begin
CloneChartSeries(DBChart1).ParentChart := QRChart1.Chart;
end;
This works fine and gives me the appropriate bars (in a bar graph) or sections in a pie chart.
The problem I seem to have with this is when I set the colours of the bars (or sections) myself at run-time. The Bar Chart / Pie Chart has only one series in each case and I set 'ColorEachPoint' to True (forcing each plot to be presented in a different colour).
If I use the syntax 'DBChart1.Series[0].ValueColor[x] := clBlack' for instance (to make the x'th plot Black) - if I then use the CloneChartSeries code the resultant chart (in the QuickReport Chart component) does not reflect this colour change.
If I run the same principal using a standard TChart (rather than a TDBChart) then the colour is fed through accordingly. It is only when I try using this from a TDBChart that I see the problem.
Can anyone suggest what I am doing wrong here ?
Or is this a bug with the TDBChart component ?
Any help / pointers would be appreciated.
Thanks in advance
Steve