I would like to create active content evaluations of KPIs. For that I would like to use the mouse over function as availabe e.g. for the point style (hypertext.dem).
Is or will this be available for bargraphs also? I the plot I see a popup displaying my "using" statements, but I did not find a way to modify it with the "with labels hypertext" statements.
The only workaround I see for now is to add another plot on top with point style that would popup the hypertext.
I tried things in gnuplot version 6.0 and 6.0.2.
A solution to this questions probably requires some "tricks". As far as I know, with labels hypertext
can only use anchor points. It would be nice if there might be a feature for hypertext for arbitrary areas, e.g. like filledcurves on a map (maybe in the future?). However, it wouldn't be gnuplot if there isn't a workaround. At least for the simpler case of bars or rectangles.
So, if your mouse is above the anchor point, the hypertext will be displayed.
pointtype
, e.g. pt 5
is a filled squarepointsize
, e.g. ps 5
Hence, for the simplest case
lc rgb 0xff123456
, the mouse will still react, although the point is invisibleThis will look like this: (just for illustration, the alpha channel is not set to full transparency, but only to 0xee
).
The corresponding part of the plot command would look like this:
'' u 1:2:2 w labels hypertext point pt 5 ps 5 lc rgb 0xee123456
However, if you want the whole bar to react to mouse hovering, simply place several anchor points on top of each bar.
Script:
### hypertext for the whole area of bar grahps
reset session
# create some random test data
set table $Data
set samples 9
plot '+' u ($0+1):(rand(0)*10+1) w table
unset table
set boxwidth 0.9
set style fill solid 0.5
set yrange[0:]
set key noautotitle
stats $Data u 2 nooutput
Nmax = 8
dy0 = STATS_max/(Nmax-1)
plot $Data u 1:2 w boxes lc rgb 0xff0000, \
for [i=0:Nmax] $Data u 1:(dy=$2/ceil($2/dy0), i*dy>1.1*$2 ? NaN : i*dy):2 \
w labels hypertext point pt 5 ps 5 lc rgb 0xee123456
### end of script
Result:
Screenshot from qt terminal:
Unfortunately, you cannot upload SVGs in StackOverflow, hence, here a screen capture from SVG in Firefox browser: set color to full transparency, i.e. lc rgb 0xff123456
to let the squares disappear.
For creating a SVG, modify the script to something like this:
...
set term svg mouse standalone
set output "SO79497533.svg"
plot ...
set output