|
getHTMLImageMap-Tooltip & CDML |
Posted by Fabian on Dec-15-2011 03:12 |
|
Hi Peter,
is it possible to use CDML for getHTMLImageMap-Tooltip?
I tested it with the following code, but nothing happens:
sImageMap = c->getHTMLImageMap("clickable",
"title={xLabel}\\n{top|dd.<*color=ff0000*>mm.yyyy} - {bottom|dd.mm.yyyy}",
"title='0{top|dd.mm.yyyy}{bottom|dd.mm.yyyy}{field0}'");
m_Chart.setImageMap(sImageMap); |
Re: getHTMLImageMap-Tooltip & CDML |
Posted by Peter Kwan on Dec-16-2011 05:39 |
|
Hi Fabian,
ChartDirector actually only renders the chart. Everything else, including the tooltip box, is rendered by the GUI framework (eg. your mouse cursor is rendered by the GUI framework, even when the mouse cursor is on the chart). As a result, CDML is not applicable, as CDML only works on things that are rendered by ChartDirector.
Some GUI frameworks have its own language to create a "fancy" tooltip (eg. the Java SWING framework supports using a subset of HTML in tooltips), but most GUI frameworks only support only plain text as tooltips.
For your case, are you using the MFC GUI framework? For MFC, the tooltip is represented by CToolTipCtrl:
http://msdn.microsoft.com/en-us/library/6b4cb3a5(v=vs.80).aspx
As far as I know, the MFC tooltip only supports plain text. If you would like to use formatted text, you may need to handle the mouse move event and create the pop up box with your own code. I have seen a developer using a "Rich Text Control" as the pop up box for tooltips, in which case the formatting language is "RTF" (rich text format).
Regards
Peter Kwan |
Re: getHTMLImageMap-Tooltip & CDML |
Posted by Peter Kwan on Dec-16-2011 05:44 |
|
Hi Fabian,
In case you are not using MFC, but is using QT (ChartDirector also includes sample code for the QT GUI framework), the tooltip is represented by the QT class QToolTip. I have just checked the QT documentation, and the QToolTip does support using rich text (RTF) for the tooltip, so you may use RTF to format your tooltip instead of CDML.
Regards
Peter Kwan |
Re: getHTMLImageMap-Tooltip & CDML |
Posted by Fabian on Dec-16-2011 14:27 |
|
Hi Peter,
yes, I'm using MFC. I will try it.
Thank you so much!
a correction to my first post:
sImageMap.Format("%s%s" ...
not:
sImageMap=... |
|