Real-time charting?

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
JT
Newbie
Newbie
Posts: 7
Joined: Fri Jun 29, 2007 12:00 am

Real-time charting?

Post by JT » Fri Sep 21, 2007 5:36 pm

Hello Steema Team,

I have one question that I wasn't able to figure out so far:

I use JBuilder 7 as an IDE. I have a Teechart in my visual class showing a time series. Once the simulation is finished TChart plots the time series and everything works well. However, I want to see real-time how the timeseries changes over the course of a simulation and not when it is finished. I have long worked with Tchart in C++ Borland Builder 5 and the way I'm used to doing this is:

//for real-time in each time step in the simulation
Series1->Clear();
Series1->AddXY();
TChart->Refresh();

In my Java code now a XY value is added in each time step but it doesn't show up on the graph (only the entire time series is shown once the simulation is finished). Do you have an idea what I should do? I have pasted the code below:

public void coremodel(){
//this is the annual simulation model
for (year = 1; year <= years; year++) {
somevariable++;
//now the Tchart is supposed to be updated 'real-time'
chart();
}}

public void chart() {
Series line1 = new Line(tChart.getChart());
tChart.getSeries(0).add(year,somevariable);}

I'd appreciate if you could help me. Thanks!!!

JT
Newbie
Newbie
Posts: 7
Joined: Fri Jun 29, 2007 12:00 am

Post by JT » Fri Sep 21, 2007 10:49 pm

I just figured it out:

tChart.refreshControl();

Post Reply