BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TeeChart Pro 4.01

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Third Party Tools)
View previous topic :: View next topic  
Author Message
Kevin Sweeney
Guest





PostPosted: Fri Aug 20, 2004 5:46 pm    Post subject: TeeChart Pro 4.01 Reply with quote



Hi,

I have noticed a problem in an application I created with two charts
using TeeChart Pro 4.01, and cannot figure it out. The first chart
shows a bunch of time-based data; the second shows the same data
intepreted as binary (the Y-axis represents the two's power, and a
different colored box is drawn to indicate whether that bit is on in
the data; the result looks like a grid of red- or white-filled boxes).

The application allows the user to click on one of the bit boxes in
order to toggle its state. It changes the color of the clicked box on
the second chart, recalculates the value of the original data, then
redraws the point at the new value on the first chart (by deleting the
old value, then adding a new point with the new value):

void __fastcall TQP4_4::SeriesClick( TChartSeries *Sender,
int ValueIndex, TMouseButton Button, TShiftState Shift,
int X, int Y )
{
TColor color = Series2->ValueColor[ ValueIndex ]; // bit color
Chart2->Series[0]->ValueColor[ ValueIndex] = ( color == clRed ) ?
clWhite : clRed; // toggle bit box color

int index = ... ; // determine the index to the original data
{ ... }; // modify original data point per bit change
double xval = index; // set X and Y values for new point
double yval = data[ index ];

Chart1->Series[0]->Delete( index ); // delete old TROUBLE
Chart1->Series[0]->AddXY( xval, yval, NULL, clRed ); // add new
}

This code seems to do everything I want, except that the line marked
TROUBLE also deletes the same indexed point from Chart2, like it is
performing:

Chart2->Series[0]->Delete( index );

I must be doing something incorrectly. Does anyone have any ideas?
Thanks in advance.

Kevin Sweeney
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Third Party Tools) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.