Events in wxFreeChart

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

Events in wxFreeChart

Post by RichardW »

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: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Events in wxFreeChart

Post by doublemax »

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

Post by RichardW »

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

Post by RichardW »

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
Post Reply