ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  How the check whether mouse click is in x or y axis
Posted by Stephan Bielmann on May-15-2014 16:07
Hello there,

I am using Chart Director in C++ with Qt and would like to know in my application when a user is clicking on a given area on the whole chart. I already use ImageMapHandler for clicks on hotspots and this works fine.

Know I would like to know if the user is clicking into the drawing area of the x axis, or one of the y axis, or else where. Is CD providing such a way to get this information?

Thanks for the help,

Stephan

  Re: How the check whether mouse click is in x or y axis
Posted by Peter Kwan on May-16-2014 22:55
Hi Stephan,

Sorry for the late reply.

You may create an image map for the axis using Axis.getAxisImageMap. There is also a
similar API Axis.getHTMLImageMap that creates an image map for the axis labels.

You may concatenate all the image map you need together (the image maps are just text
strings) and pass the resulting text string to ChartDirector as the final image map.

Note that in ChartDirector for C++, ChartDirector reuses the same memory to store the
image map returned to your code. That means creating one image map overwrites the
previous image map. So you should make a copy of the image map (such as storing the
returned image map in a QString, std::string or duplicated it using strdup) before creating
another image map for the same chart object.

Hope this can help.

Regards
Peter Kwan

  Re: How the check whether mouse click is in x or y axis
Posted by Stephan Bielmann on May-20-2014 13:56
Hello Peter,

thank you for your help, this does indeed do what I asked for.