Using a DBChart, I use the following to set the series colors in the BeforeDrawSeries event. I would like to do the same for a QRDBChart that I am using in the same program. I cannot seem to get it to work however. The events are not the same and no matter what I do, the series are drawn in the default color.
int iIdx = _series->XValues->Count;
// Before the chart is drawn, scan through each data point in each Series
//data set and set the colors of each based on its amplitude.
//THIS WORKS FOR TDBCHART, BUT NOT TQRDBCHART!
for(i=0;i<iIdx;i++){
int iVal = _series->YValue;
if(iVal > 50)
_series->ValueColor = clRed;
}
thanks,
kev
DBChart Colors
Hi, Kev.
Try placing the code in TQuickRep OnNeedData event or alternatively in TQRChart.Chart.OnBeforeDrawSeries event. You'll have to manually connect the event implementation with TQRChart.Chart.OnBeforeDrawSeries event. Something like this (can be placed in report form constructor):
Try placing the code in TQuickRep OnNeedData event or alternatively in TQRChart.Chart.OnBeforeDrawSeries event. You'll have to manually connect the event implementation with TQRChart.Chart.OnBeforeDrawSeries event. Something like this (can be placed in report form constructor):
Code: Select all
QRChart1->Chart->OnBeforeDrawSeries = YourDBChartOnBEforeDrawSeriesEvent;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com