Freechart 1.6

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Nefarious
Knows some wx things
Knows some wx things
Posts: 28
Joined: Fri Feb 24, 2017 8:23 pm

Freechart 1.6

Post by Nefarious »

I am trying to use freechart 1.6 with wxWidgets.3.1.0 and I can't make sense of how to map the options. I tried all possibilities of:

nmake -fmakefile.vc WX_DIR=C:\wxSpace WX_UNICODE=0 WX_DEBUG=0 WX_SHARED=0 WX_MONOLITHIC=0

and for every option after the one I thought should work gives the message:

----------------------------------------------------------------------------
The selected wxWidgets build is not available!
Please use the options prefixed with WX_ to select another wxWidgets build.
----------------------------------------------------------------------------
NMAKE : fatal error U1077: 'if' : return code '0x1'
Stop.

should WX_DIR really point to the lib directory? when I build wxWidgets there is no MONOLITHIC option and

in makefile.vc the first few lines are:

if not exist C:\wxWidgets-3.1.0\lib\vc_dll\mswu\wx\setup.h echo ----------------------------------------------------------------------------
if not exist C:\wxWidgets-3.1.0\lib\vc_dll\mswu\wx\setup.h echo The selected wxWidgets build is not available!
if not exist C:\wxWidgets-3.1.0\lib\vc_dll\mswu\wx\setup.h echo Please use the options prefixed with WX_ to select another wxWidgets build.
if not exist C:\wxWidgets-3.1.0\lib\vc_dll\mswu\wx\setup.h echo ----------------------------------------------------------------------------
if not exist C:\wxWidgets-3.1.0\lib\vc_dll\mswu\wx\setup.h exit 1

and of course there is no vc_dll in the lib directory?

Is this library supported with wxWidgets-3.1.0?
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Freechart 1.6

Post by PB »

You should also set the wxWidgets version to 3.1 (WX_VERSION=31) and it is likely you have built wxWidgets in Unicode mode so you should set WX_UNICODE=1

Obviously, the other settings must match those of wxWidgets build too, e.g. BUILD=release vs WX_DEBUG=0; SHARED vs WX_SHARED etc.

I recommend checking wxFreeChart thread here or at least this post (even if it is for MinGW): viewtopic.php?f=10&t=33144&start=30#p175171
Nefarious
Knows some wx things
Knows some wx things
Posts: 28
Joined: Fri Feb 24, 2017 8:23 pm

Re: Freechart 1.6

Post by Nefarious »

I got a chart to draw by including the src and include directories into my project. This is not for production use, it is just a tool so although it is cumbersome, it works.

All that said, is this project dead? I assume there are people using it, is there a place to ask questions?

I am using a bar chart to plot FFT data and need a dynamic series. I need to change the dataset names and the dataset values. The implementation has a method to add a series, but not a method to remove a series, or get the series. Am I using the wrong plot?
iwbnwif
Super wx Problem Solver
Super wx Problem Solver
Posts: 282
Joined: Tue Mar 19, 2013 8:52 pm

Re: Freechart 1.6

Post by iwbnwif »

Hi,
I got a chart to draw by including the src and include directories into my project. This is not for production use, it is just a tool so although it is cumbersome, it works.
Glad you got it to work. I haven't played with the build files at all, but instead have a separate project setup in Codelite that builds the shared library for testing.
All that said, is this project dead? I assume there are people using it, is there a place to ask questions?
Not totally dead, but having a rather long rest :) I would really like to spend some time on this library because I think it is really useful. Although the API isn't that consistent with the rest of wxWidgets.
I am using a bar chart to plot FFT data and need a dynamic series.
Interesting that this is your project, I stumbled across GNURadio a few weeks ago. It has a wxWidgets interface, but uses OpenGL to plot FFT charts in real time. See my post here here.

Was the current dynamic chart fast enough to draw for you? Updating drawing speed on dynamic charts was the thing that I forked the wxCode source for.
wxWidgets 3.1.2, MinGW64 8.1.0, g++ 8.1.0, Ubuntu 19.04, Windows 10, CodeLite + wxCrafter
Some people, when confronted with a GUI problem, think "I know, I'll use Eclipse RCP". Now they have two problems.
Nefarious
Knows some wx things
Knows some wx things
Posts: 28
Joined: Fri Feb 24, 2017 8:23 pm

Re: Freechart 1.6

Post by Nefarious »

There is a significant issue with using wxFreechart to dynamically draw graphs.

First there is no easy way to change the data in a dataset, at least that I have found. And the instance variable for the data is private to the class. I am not sure about exactly how the license work, but this makes it difficult to just replace the data in the dataset. If the instance variable was protected one could subclass the dataset and add a new ReplaceData method and then call ChartNeedsRedraw. Then no allocation has to take place.

There doesn't seem to be a way to remove the dataset from the plot so changing it dynamically isn't implemented. Without violating the the license I can draw one graph, unless I'm missing something.

Also, My FFT has 512 bins in it and I cannot possible show all of the bins at the same time, so I need to be able to move the plot to show a different set of bins. The functionality to replace the values in the category axis is the same as explained above, it cannot be changed without subclassing the class and the instance variable that holds the data is also private. If it were protected it would be easier to change.

I have to read the license, but at this time I can't see an alternative to make it work.

I have used QCustomPlot and JFreeChart for applications in those environments and have ideas how to make FreeChart better. I would be willing to contribute some if the project were started.
iwbnwif
Super wx Problem Solver
Super wx Problem Solver
Posts: 282
Joined: Tue Mar 19, 2013 8:52 pm

Re: Freechart 1.6

Post by iwbnwif »

First there is no easy way to change the data in a dataset, at least that I have found. And the instance variable for the data is private to the class. I am not sure about exactly how the license work, but this makes it difficult to just replace the data in the dataset. If the instance variable was protected one could subclass the dataset and add a new ReplaceData method and then call ChartNeedsRedraw. Then no allocation has to take place.
It is some time since I looked at this library, so forgive me for being rusty.

Depending on your use case, you can dynamically update individual 'bins' in a VectorDataset using the Replace() method.

Another option would be to used a XYDynamicSerie, this works a bit like a FIFO but there are bulk Clear() and Insert() methods.

I am not in a rush to change the API, even though it is a bit clunky in places. However, I would like to refactor out the whole FIRE_WITH_THIS mechanism which IMHO just makes it very hard to follow the code.
wxWidgets 3.1.2, MinGW64 8.1.0, g++ 8.1.0, Ubuntu 19.04, Windows 10, CodeLite + wxCrafter
Some people, when confronted with a GUI problem, think "I know, I'll use Eclipse RCP". Now they have two problems.
Post Reply