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

Message ListMessage List     Post MessagePost Message

  Adding a tooltip to text box shown from addCustomDataLabel
Posted by John Vella on Apr-12-2024 02:23
I'm adding a custom label to a single data point in an XY line layer. How can I get a tooltip to appear for the text box created to show the label??

I'm using C++ and QChartViewer

  Re: Adding a tooltip to text box shown from addCustomDataLabel
Posted by Peter Kwan on Apr-13-2024 01:28
Hi John,

You would need to provide custom tooltips for every data point of the line layer. You can use an empty string if a data point has no tooltip.

A simple hard coded example is like:

// The text you want to use as tooltips for the data points
const char* myToolTip[] = {"aaa", "bbb", "ccc", "ddd};

LineLayer *layer = c->addLineLayer(....);

// Add the tooltips you want to use as an extra field
layer->addExtraField(StringArray(myToolTip, 4));

// Use the extra field as tooltips
layer->setHTMLImageMap("", "", "title='{field0}'");

Best Regards
Peter Kwan