|
Be able to click on the line of a Mark |
Posted by Arno on Sep-27-2013 15:32 |
|
Hello,
In a XYChart, i want the user to be able to click on the line associated to a mark.
Here is a part of the MFC C++ code:
// Chart creation
XYChart* c = new XYChart();
...
// Add the mark
Mark* markTest = c->yAxis()->addMark(1.5, 25632, "MarkTest");
markTest->setLineWidth(4);
// Output chart
c->makeChart();
//include tool tip for point of the chart
imageMap = c->getHTMLImageMap("clickable", "test1={dataSetName}&test2={field0}")),
"My Title"));
// Get the info from the Mark
String sCoord = markTest->getImageCoor();
String markMap = "";
markMap.sprintf("<area %s title='Test Mark' href=\\"clickable?test=5\\">", sCoord);
// Then i append it the image map
imageMap += markMap;
It works but when i do that, only the label "MarkTest" is clickable.
I'm not able to click on the line.
Is it possible ?
Thanks !
Regards,
Arno. |
Re: Be able to click on the line of a Mark |
Posted by Peter Kwan on Sep-28-2013 02:23 |
|
Hi Arno,
You can create an image map for the line. As it is just a rectangle, it is easy to create. It is like:
markMap.sprintf("<area shape='rect' coords='%d,%d,%d,%d' title='Test Mark' href=\\"clickable?test=5\\">", c->getPlotArea()->getLeftX(), c->getYCoor(1.5) - 5,
c->getPlotArea()->getRightX(), c->getYCoor(1.5) + 5);
Hope this can help.
Regards
Peter Kwan |
|