DBChart Colors

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
kev
Newbie
Newbie
Posts: 42
Joined: Tue Apr 06, 2004 4:00 am
Location: Texas

DBChart Colors

Post by kev » Wed Jul 28, 2004 4:15 pm

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

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue Aug 03, 2004 5:52 am

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;
Marjan Slatinek,
http://www.steema.com

Post Reply