wxFreeChart project need contributors

Do you like to promote your wxWidgets based application or component!? Post it here and let's see what the critics have to say. Also, if you found that ONE wx component the world needs to know about, put it here for future reference.
psychegr
Knows some wx things
Knows some wx things
Posts: 26
Joined: Wed Mar 05, 2014 1:19 pm

Re: wxFreeChart project need contributors

Post by psychegr »

PB wrote:
Further suggestions
I recommend implementing an optional "nice labels" function, the charts look prettier/natural when used. It may not be obvious with sample data, but when you have a lot of varied natural data, the numbers chosen for tick label can look odd to an end user. On a similar note a better default autodetection of label format may be also a good idea, display of labels is currently fixed at two decimal places at the moment, regardless of the magnitude of values of data linked with an axis. Of course, both these things can be easily done by an application programmer just as I did, but I believe it's for the best if such common functions are implemented within the library itself and the sensible defaults should be applied without application programmer intervention.
Image
I am facing this same issue almost. I want to draw an XYplot with known preset horizontal axis values. The only variable is the Y points' value.
So if for example i have 4 horizontal axis values like 100, 1000, 4000, 10000 and a Y value for each one of these, the code will calculate a tick value for each point like this :

Code: Select all

tick = (max - min) / (pointsCount - 1)
and that makes a tick value = 3300. So the first x value is 100, the second is 3400, third 6700 and the last one is 10000.
The XYline draws correctly on the chart so this is something that someone would expect from a chart like this. But what if i wanted to use the same x values and draw the XYline related to that? What i want to do is a "nice labels/nice plot" kind of thing with all x values evenly spaced and the same for the XYline. The closest thing that i could find is the BarPlot but i dont want to use bars. My guess is that the x axis values should be strings and the Y should be double or intergers. But where and how should i change the code to do what i want? I guess that there is some piece of code that calculates the tick values and draws the x axis values and the XYline according to that and the drawing rectangle but i cant really find it. Can anyone help here?
CJS
Earned a small fee
Earned a small fee
Posts: 17
Joined: Thu Jan 28, 2016 8:21 am

Re: wxFreeChart project need contributors

Post by CJS »

psychegr wrote:
PB wrote:
Further suggestions
I recommend implementing an optional "nice labels" function...
This can be tricky, because a general solution will have to cope with very small numbers and very large numbers, while the ends of the axes might only be a small proportion of these values or could be at extreme positive and negative values.

Here are some relevant references:

Algorithm for “nice” grid line intervals on a graph
http://stackoverflow.com/questions/3616 ... on-a-graph

Choosing an attractive linear scale for a graph's Y Axis
http://stackoverflow.com/questions/3266 ... phs-y-axis

Nice Label Algorithm for Charts with minimum ticks - note particularlly answer starting "I am the author of "Algorithm for Optimal Scaling on a Chart Axis"..."
http://stackoverflow.com/questions/8506 ... 7#16363437
psychegr
Knows some wx things
Knows some wx things
Posts: 26
Joined: Wed Mar 05, 2014 1:19 pm

Re: wxFreeChart project need contributors

Post by psychegr »

CJS wrote:
psychegr wrote:
PB wrote:
Further suggestions
I recommend implementing an optional "nice labels" function...
This can be tricky, because a general solution will have to cope with very small numbers and very large numbers, while the ends of the axes might only be a small proportion of these values or could be at extreme positive and negative values.

Here are some relevant references:

Algorithm for “nice” grid line intervals on a graph
http://stackoverflow.com/questions/3616 ... on-a-graph

Choosing an attractive linear scale for a graph's Y Axis
http://stackoverflow.com/questions/3266 ... phs-y-axis

Nice Label Algorithm for Charts with minimum ticks - note particularlly answer starting "I am the author of "Algorithm for Optimal Scaling on a Chart Axis"..."
http://stackoverflow.com/questions/8506 ... 7#16363437
Well i was thinking something simpler. The dataset has for example 10 pairs of values. So what we need is a graph with 10 X axis points. The Y axis could have a min and max value and render according to that. But the X axis is what makes it really "ugly" to me. So we have 10 X axis points, that means that we need to render 10 major ticks evenly spaced on the X axis. If the dataset had 120 pairs then we would need to render 120 major ticks evenly spaced on the X axis.
So according to what i have in mind all we need is the drawing rectangle and the number or major ticks to draw. The labels for these ticks are the x Axis values and so on.
I dont know if this is the correct way of doing it, but this is what i have in mind. What i dont know is where to look and what to change in the wxFreeChart code. I have been working on it the last few days and i have added mouse events, wxGridTableBase type dataset, removed the creation of a bitmap for the drawing process and stuff like that.
bergvagabund
In need of some credit
In need of some credit
Posts: 2
Joined: Sun Feb 05, 2017 4:31 pm

Re: wxFreeChart project need contributors

Post by bergvagabund »

I just saw that there seems to be some activity on the wxfreechart component.
Back in 2010/2011 I made some additions to this component for my http://softsolutions.sedutec.de/audioanalyser.php project.
These additions were:
- LineTextMarker (for displaying a linemarker with some text, e.g. an measurement value)
- A possibility to change the automatic labeling to manual labels (the user must provide a std::vector with the wanted labels)
- A possibility to change the automatic gridlines to manual gridlines (the user must provide like above a std::vector with the wanted grid lines)

I sent these additions to the original developer, but did not get any response from him. Now after reading this thread I learned that he has abandoned the project.
But I could provide this code if you (psychegr, iwbnwif, pb) are interested.
The problem is that all these new github codebases are not working with mingw. Currently I am only able to compile with the original codebase from sourceforge.

Cheers,
Bergvagabund
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxFreeChart project need contributors

Post by PB »

bergvagabund wrote:The problem is that all these new github codebases are not working with mingw. Currently I am only able to compile with the original codebase from sourceforge.
I cannot confirm this, I was able to build it with MinGW successfully in static debug and release builds.
wxFreeChart: the latest version from iwbnwif's github
wxWidgets: wxWidgets master head from two weeks back
MinGW: the current version (GCC 5.3.0)
Command line for the release build:

Code: Select all

mingw32-make -f makefile.gcc WX_VERSION=31 WX_UNICODE=1 WX_DEBUG=0 CXXFLAGS="-std=gnu++11"
I had to modify makefile.gcc where I added a few Windows libraries recent wxWidgets need to link with, i.e., appended " -lversion -lshlwapi -loleacc" to all the lines formerly ending with "-lodbc32".

But it appears there may be something broken in that version. After running the demo, none of the charts actually showed there and when I built it with MSVC 2008 the result was the same...
psychegr
Knows some wx things
Knows some wx things
Posts: 26
Joined: Wed Mar 05, 2014 1:19 pm

Re: wxFreeChart project need contributors

Post by psychegr »

bergvagabund wrote:I just saw that there seems to be some activity on the wxfreechart component.
Back in 2010/2011 I made some additions to this component for my http://softsolutions.sedutec.de/audioanalyser.php project.
These additions were:
- LineTextMarker (for displaying a linemarker with some text, e.g. an measurement value)
- A possibility to change the automatic labeling to manual labels (the user must provide a std::vector with the wanted labels)
- A possibility to change the automatic gridlines to manual gridlines (the user must provide like above a std::vector with the wanted grid lines)

I sent these additions to the original developer, but did not get any response from him. Now after reading this thread I learned that he has abandoned the project.
But I could provide this code if you (psychegr, iwbnwif, pb) are interested.
The problem is that all these new github codebases are not working with mingw. Currently I am only able to compile with the original codebase from sourceforge.

Cheers,
Bergvagabund
Hi Bergvagabund,

well this seems to be exactly what i want to do. Manual labels and gridlines. I reached to a point but i have lots of bugs. Would you mind sharing the code or at least the changes and maybe an example?
Regarding the compilation problems that you might have, it depends on the wxwidgets version that you use. I am on 3.1 and it works using the same command line as PB mentioned earlier.
bergvagabund
In need of some credit
In need of some credit
Posts: 2
Joined: Sun Feb 05, 2017 4:31 pm

Re: wxFreeChart project need contributors

Post by bergvagabund »

Hi psychegr,

I am still using wxwidgets 2.8.12, so this could be the reason for the unsuccessful compilation.
Nethertheless of course I can provide my code.
The question is how could this be done? I have no github client nor a github account. Perhaps I can send it to you be email.
What would you suggest?

Regards,
Bergvagabund
Post Reply