Page 1 of 1

DBChart Colors

Posted: Wed Jul 28, 2004 4:15 pm
by 9232023
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

Posted: Tue Aug 03, 2004 5:52 am
by Marjan
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):

Code: Select all

QRChart1->Chart->OnBeforeDrawSeries = YourDBChartOnBEforeDrawSeriesEvent;