JQPlot Highlighter - different lighting options for each series

I have a jQPlot line chart with three different series, and I use the Highlighter insert to show hovering on data points in each series. I would like to use different highlighting options for each line of the chart.

Lines 1 and 2 should show the value of y, and line 3 should show the value of y, as well as the message. For example, pointing to line 1 would be "10", but line 3 should be "Target = 25".

I cannot find a way to specify different parameters for each particular series. Any help would be greatly appreciated.

+4
source share
2 answers

Add a highlight object to each series and specify a format string. Here is an example script with two rows:

var series1 = [[1, 2], [2, 3], [3, 4]]; var series2 = [[6, 7], [7, 8], [8, 9]]; var plot = $.jqplot('chart1', [series1, series2], { series:[ { highlighter: {formatString: "%d"} }, { highlighter: {formatString: "Target = %d"} } ], highlighter: {show: true} } 
+10
source

If you want the "x" and "y" values ​​to be passed to a specific serial marker without the format used in the axes.yaxis.tickOptions.formatString option, you can set useAxesFormatters: false in the applied marker object to the series, so you can apply your personalized format to raw values

0
source

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


All Articles