Jqplot show marker on single chart

I have a jqplot diagram with two data lines. Only one should turn on the backlight. I tried this:

series:[ { highlighter: { formatString: "", show: false } }, { highlighter: { formatString: "Day %s: %d", show: true } } ] 

But, unfortunately, this does not work: the marker shows a small empty dot in the first line, while it should not show anything.

How to show a marker on one chart, and not on another?

+6
source share
2 answers

This is a very interesting question (+1). The only solution that occurred to me since playing with the plot options did not help was to clear the canvas and hide the tooltip every time it should be shown. This is done in the code below and presented in the working example available here .

 $('#chart').bind('jqplotMouseMove', function(event, xy, axesData, neighbor, plot) { if (neighbor && neighbor.seriesIndex == 0) { var drawingCanvas = $(".jqplot-highlight-canvas")[0]; var context = drawingCanvas.getContext('2d'); context.clearRect(0, 0, drawingCanvas.width, drawingCanvas.height); $('.jqplot-highlighter-tooltip').hide(); } }); 
+2
source

set showHighlight: false for a series for which you do not need a shortcut

0
source

Source: https://habr.com/ru/post/921086/


All Articles