Events in wxFreeChart

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
RichardW
Earned a small fee
Earned a small fee
Posts: 14
Joined: Fri Apr 25, 2014 4:45 am

Events in wxFreeChart

Postby RichardW » Thu Oct 08, 2015 2:54 am

What I've done is built a simple Gantt chart. What I'd like to do is be able to handle mouse clicks on the Gantt bars. Ideally, I'd like the user to be able to drag the bar back and forth on the horizontal axis but... baby steps for now.

It's trivial get the mouse coordinates from the click event, but is there a way to get GanttPlot to report where the bars are located, so I could get the dataset index, or something?

AxisPlot.ToDataCoords() looks promising, but I have no idea how to how to return my AxisPlots from the plot. Is there a GanttPlot.GetAxis(AXIS_LEFT) that I missed?

Thanks for reading this. I did a search and I didn't find anything but I apologize in advance if this has been answered elsewhere.

Sincerely,
Richard W.

User avatar
doublemax
Moderator
Moderator
Posts: 11481
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Events in wxFreeChart

Postby doublemax » Thu Oct 08, 2015 4:29 pm

I don't know wxFreeChart, but looking at the class hierarchy, GanttPlot derives from AxisPlot and there you find several GetDatasetAxis methods. Maybe these help?

http://wxcode.sourceforge.net/docs/free ... sPlot.html
Use the source, Luke!

RichardW
Earned a small fee
Earned a small fee
Posts: 14
Joined: Fri Apr 25, 2014 4:45 am

Re: Events in wxFreeChart

Postby RichardW » Fri Oct 09, 2015 3:51 am

I did see those but I couldn't understand why they need a Dataset as a parameter as one has already been passed to the plot. But maybe I don't understand something yet. I'll continue to work on this.

RichardW
Earned a small fee
Earned a small fee
Posts: 14
Joined: Fri Apr 25, 2014 4:45 am

Re: Events in wxFreeChart

Postby RichardW » Wed Oct 21, 2015 4:15 pm

Just to give an update, I completely chickened out. Instead of using wxFreeChart, I rolled my own Gantt chart using a grid bag sizer. It's not as pretty, but grabbing events is much easier. It looks like events are on the original developer's todo list, but the last update was some time ago so they might not happen.

I hope somebody else has better luck than me.

Richard


Return to “wxCode”

Who is online

Users browsing this forum: No registered users and 3 guests