|
HTMLImageMap for multi-bar chart |
Posted by Vassilios Kotaidis on Mar-16-2015 15:34 |
|
Good morning!
Is it possible to have independent HTML image maps for a multi-bar chart?
Image map only for layer allowed:
BarLayer *layer = c->addBarLayer(Chart::Side);
layer->addDataSet(...);
layer->addDataSet(...)->setUseYAxis2(true);
layer->setHTMLImageMap("", "", "title='{dataSetName} ...'");
Image map for each data set is not possible. But second data set uses second y axis with
different units. The bar charts must be side by side.
Greetings |
Re: HTMLImageMap for multi-bar chart |
Posted by Peter Kwan on Mar-17-2015 01:56 |
|
Hi Vassilios,
There are several methods. If the structure of the tooltips are similar except differences in
some text (such as the unit), one method is to add an extra field. An example is:
// units for the 3 data sets
const char *units[] = { "Mbps", "USD", "kg" };
layer->addExtraField(StringArray(units, 3));
layer->setHTMLImageMap("", "", "title='{dataSetName} {value} {dsField0}'");
Another method is to use two layers. One layer is for the first and third data sets (with the
second data set containing Chart::NoValue), and the other layer for the second data sets
(with the first and third data sets containing Chart::NoValue). A third method commonly
used in scripting language is to post-process the image map. Many scripting language
supports regular expressions which makes this method easy to use. A final method is to
generate the tooltip text for all segments with your own code, and then add them as extra
fields to the layer, and configure the image map to use the extra fields as the tooltips.
Regards
Peter Kwan |
|