Why does the chart refresh all items every time?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
shilei
Posts: 4
Joined: Wed Dec 01, 2010 5:57 am
antibot: No, of course not.

Why does the chart refresh all items every time?

Post by shilei » Fri Dec 24, 2010 8:38 am

Why does the chart refresh all items every time?
I try to use add() or addOrUpdate() methods add a new point or item to series,But when the dataset change ,all points will be refreshing. :(
best cpu, poor efficiency
how refresh the last item by 3 second?
I notice that XYPlot have a segment code below
how can I keep the old points not reload
please help me :(

Code: Select all

							for (int item = firstItem; item <= lastItem; item++) {
								renderer.drawItem(g2, state, dataArea, info, this,
										xAxis, yAxis, dataset, series, item,
										crosshairState, pass);
							}
Image

barbarius
Posts: 74
Joined: Tue Jul 27, 2010 9:33 am
antibot: No, of course not.

Re: Why does the chart refresh all items every time?

Post by barbarius » Fri Dec 24, 2010 11:55 am

i couldnt find the method where it clears all the lines and everything on the screen before redrawing..

lfkpoa
Posts: 7
Joined: Wed Dec 22, 2010 8:28 pm
antibot: No, of course not.

Re: Why does the chart refresh all items every time?

Post by lfkpoa » Fri Dec 24, 2010 12:12 pm

Hi,

JFreeChart was not designed for real time charts.
It's int the FAQ:
5. Does JFreeChart support real-time charting?
Not really. JFreeChart includes an event-notification mechanism that ensures that charts are updated whenever the dataset is updated. However, the chart is completely repainted for each update, which limits the "frames per second" rate that you can achieve with JFreeChart. Typically, updating once per second is fine, but updating multiple times per second results in high CPU load. If you want to pursue this, do some performance testing with your specific configuration and use cases.
With regards,

Luis Fernando

shilei
Posts: 4
Joined: Wed Dec 01, 2010 5:57 am
antibot: No, of course not.

Re: Why does the chart refresh all items every time?

Post by shilei » Sun Dec 26, 2010 2:19 pm

Can i use bufferimage to improve efficiency ?

entirely reload so sad!

Locked