-
Is it possible? I've been struggling to find out how to do it. I asked over on the ChartDirector forum, and I see I need to use getHTMLImageMap. But how do I get notified if someone clicks something? I'm assuming I need to intercept the wxEVT_CHARTVIEWER_CLICKED event. What I'm looking for is the legend text (or whatever has been clicked). Thanks in advance, Tony. PS. Sorry for all the questions. Replacing the existing graphs in my app is quite a task, just want to be sure this is going to work before spending the time implementing full integration. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sure. Many of the samples implemented in the wxDemo application have clickable data elements. If you move the mouse pointer over the displayed sample graphics the "arrow" mouse pointer changes to a "hand" mouse pointer. If you then do a left mouse click, a modal dialog pops up showing the attributes of the clicked element.
Correct. void YourChartDialog::OnClickChart(wxCommandEvent& event)
{
wxChartViewer* viewer = (wxChartViewer*) event.GetEventObject();
ImageMapHandler* handler = viewer->getImageMapHandler();
if (0 != handler)
{
// Query the ImageMapHandler to see if the mouse is on a clickable hot spot. We
// consider the hot spot as clickable if its href ("path") parameter is not empty.
const char *path = handler->getValue("path");
if ((0 != path) && (0 != *path))
{
// Action to be performed on clicking a hot spot
// For example, show a modal dialog
// (see wxdemo.cpp and hotspotdialog.cpp for an example)
}
}
}
Peter Kwan's answer on the ChartDirector forum contains the relevant information: you have to retrieve the image map of the legend box using
I fully understand that. BTW, I could be available for assisting in converting graphs or for other related tasks. Please send a private mail in case you are interested. |
Beta Was this translation helpful? Give feedback.
Sure. Many of the samples implemented in the wxDemo application have clickable data elements. If you move the mouse pointer over the displayed sample graphics the "arrow" mouse pointer changes to a "hand" mouse pointer. If you then do a left mouse click, a modal dialog pops up showing the attributes of the clicked element.
Correct.