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

Message ListMessage List     Post MessagePost Message

  Qt custom tooltips and disabled ones
Posted by Michael P. on Apr-10-2018 22:48
Attachments:
Dear Peter,

I am having some strange issues with the tooltips. We are using ChartDirector c++ 6 with QChartViewer with Qt 5.9.4 on Windows.
We are displaying ScatterLayers circles with BoxWhiskerLayers as filled areas behind them
(see also http://www.chartdir.com/forum/download_thread.php?site=chartdir&bn=chartdir_support&thread=1520241234#N1520241234).
I also specifically disabled the BoxWhiskerLayer tooltip via setHTMLImageMap("{disabled}").
And they are moved behind the scatterlayer using moveBack(p_event_layer).

The problem is that the hotspot detection and my readout of the keys and values does NOT give me values of the scatterlayer markers I should get.
Instead, I get those from the disabled layer.

Now, it gets trickier If some scatter markers are outside the filled area.
For those outside, the mouseover and hotspot detection work fine.
Also, if they are at the edge of a filled area but inside, I get the correct scatter markers.

But if the mouse moves in further, at some point no more scatter points are detected, instead, I get the disabled boxwhiskers.
There is also a distinction between the mouse coming from the side or from below/above, but I guess it is just because of the distance
between edge of filled area and first scatter marker.

The Scatter tooltips are set using a custom string (missing some qarguments here in this code and also the addExtraField):
QString cust_prm = QString("ident_event={field0}&ident_opmode={field1}&val_dr=value}&alias_name=%1&meas_id=%2&op_id=%3&x_index={x}");
in_p_event_layer->setHTMLImageMap("MARKER_EVENT", cust_prm.toUtf8(), "");

Key/Value retrieval pseudocode:
if (ImageMapHandler->getHotSpot(mouse_point_x, mouse_point_y) >= 0)
{
for( int i = 0;  in_p_map_handler->getKey(i) != 0; ++i )
{
    ImageMapHandler->getKey(i);
    ImageMapHandler->getValue(i);
}
}

Content of the disabled BoxWhiskerLayer maphandler keys and values:
Keys:"coords", "bottom", "min", "med", "x", "path", "top", "max", "xlabel", "title"
Values:"454,22,469,72", "7", "", "", "7", "{disabled}", "10", "", "Engine free acceleration", ""

Any ideas? Need more code?

best regards,
Michael
mouseover_marker_notdetected.png
mouseover_marker_notdetected.png

1.25 Kb
mouseover_marker_detected.png
mouseover_marker_detected.png

1.64 Kb

  Re: Qt custom tooltips and disabled ones
Posted by Peter Kwan on Apr-11-2018 01:15
Hi Michael,

I think the url to disable the image map is "{disable}", not "{disabled}". May be you can try to use "{disable}" to see if it works.

If you use "{disabled}", this will not disable the image map, so the image maps of the box-whisker layer and the scatter layer are both available. In this case, if the image mapx overlap, ChartDirector will choose the map to use as follows:

- If the mouse goes into a region with overlapping image maps, ChartDirector will choose the image map that the mouse enters first.

In the "mouseover_marker_notdetected.png", the mouse first enters the image map of the box, then it enters the image map of the scatter symbol. According to the above, it will stay on the image map of the box. So it does not detect the scatter symbol.

In the "mouseover_marker_detected.png", the scatter symbol may or may not be detected depending on whether the mouse enters the box first or enters the symbol first. That's why it depends on the direction the mouse enters the symbol.

In any case, if the box-whisker image map is disable, the scatter symbols should be detected.

Regards
Peter Kwan

  Re: Qt custom tooltips and disabled ones
Posted by Michael P. on Apr-11-2018 13:23
You are absolutely correct, {disable} is the correct usage and now everything works as expected. I found the wrong tag in a forums post from 2013 and somehow couldn't see the difference to the setHTMLImageMap documentation.

Thank you very very much,
Michael