Brunel-Visualization / Brunel

Brunel Visualization
Apache License 2.0
290 stars 77 forks source link

tooltip should be displayed for all charts not just the very top one #300

Closed cjiang-ibm closed 6 years ago

cjiang-ibm commented 6 years ago
  1. Please see attached 3 .csv files
  2. Syntax to use:

at(0, 0, 100,100) data('CatCellDistribution.csv') bar x(x) y(y) axes(x:1, y:5) stack color(ClusterID:[#CBF7FF, #00B6CB]) tooltip(#all) style('width:20px;') legends(none) | at(0, 0, 100,100) data('scaleCellDistribution.csv') area smooth(y:40) x(x) y(y) color(ClusterID:[#CBF7FF, #00B6CB]) tooltip(#all) | at(0, 0, 100,100) data('ed_catCell.csv') bar x(x) y(y) axes(x:5, y:5) color(ClusterID:[#CBF7FF, #00B6CB]) tooltip(#all) legends(none) style('width:20px;')

  1. You can see the tooltip for the third chart as expected. screen shot 2018-05-17 at 1 54 24 pm

  2. From the browser debugger, add style="visibility:hidden" for "chart3". You will see the chart like this: screen shot 2018-05-17 at 1 48 50 pm

when mouse over the chart, no tooltip is displayed. data.zip

grahamwills commented 6 years ago

I have pushed a fix for this; however note that if you allow panning and zooming (which is on by default for many charts), then the pan/zoom activity for the top chart will consume the event and you will not get tooltips for the charts underneath.

Thus the safest thing to do is to add interaction(none) to all the chart definitions so they do not pan/zoom and all mouse events are good for tooltips

cjiang-ibm commented 6 years ago

I just pulled the latest codes from master and built all the jars. I still couldn't see the tooltip after I added interaction(none) to all the syntax.

grahamwills commented 6 years ago

I updated the online javascript and CSS resources; it should work now. For an example, if you go the demo environment (http://brunelvis.mybluemix.net/try.html) and use the following syntax, you should see two overlaid charts, with tooltips on both elements

x(weight) y(mpg) color(origin) tooltip(#all) interaction(none) at(0,0,100,100)| bar x(weight) y(#count) bin(weight) tooltip(#all) interaction(none) at(0,0,100,100)

cjiang-ibm commented 6 years ago

indeed it is working after removing the overlay .css overridden.

cjiang-ibm commented 6 years ago

fixed.