Hi,
I am plotting a graph for my application using wxFreeChart.
Graph is about network statistics on y-axes and time on x axes.
At 1st second, i need to plot data on y-axes and for the 2nd second, i need to plot the data on y-axes. In precise, my graph is dynamic in similar to task manager performance monitor graph.
I downloaded wxFreeChart and going through the demo plots. My scenario is similar to XYDemo5 given in xydemos.cpp in sample programs. But when i execute the program binary of sample program, i am not getting any output for xy dynamic graph in wxFreeChart.
Any quick workaround would be greatly appreciated.
Thanks,
Seshikanth.
Need urgent help regarding wxFreeChart
-
- In need of some credit
- Posts: 1
- Joined: Thu May 13, 2010 11:09 am
-
- In need of some credit
- Posts: 4
- Joined: Tue May 18, 2010 2:21 pm
I'm having the same problem. I'm using wxWidgets 2.8.10, wxFreeChart 1.6 on Debian Lenny, gcc 4.3. When I run the demo, and open the category "XY Charts",and choose "XY Demo 5 - dynamic", it shows nothing. This, unfortunately. is exactly what I need a sample of. I need to be able to update a graph in real-time. Any help would be appreciated.
-
- In need of some credit
- Posts: 4
- Joined: Tue May 18, 2010 2:21 pm
Andrey sent me a fix. Here's his message:
Here is the bug in dataset.cpp, it's present in 1.6 release, but fixed in SVN.
You can fix it by changing Dataset::DatasetChanged() method in dataset.cpp to following:
void Dataset::DatasetChanged()
{
if (m_updating) {
m_changed = true;
}
else {
FireDatasetChanged();
m_changed = false;
}
}
Here is the bug in dataset.cpp, it's present in 1.6 release, but fixed in SVN.
You can fix it by changing Dataset::DatasetChanged() method in dataset.cpp to following:
void Dataset::DatasetChanged()
{
if (m_updating) {
m_changed = true;
}
else {
FireDatasetChanged();
m_changed = false;
}
}
-
- In need of some credit
- Posts: 4
- Joined: Tue May 18, 2010 2:21 pm
I'm still having a problem with dynamic graphs, though. When there's no activity, and a timer event adds to the dataset, as in the dynamic graph example, the graph gets properly updated. However, if I'm reading data from the serial port in a loop, the graph does not get updated until the loop exits, even if I add to the dataset. How can I get the graph to be updated during the loop which reads from the serial port?
-
- In need of some credit
- Posts: 4
- Joined: Tue May 18, 2010 2:21 pm