How to break a chart in jqplot chart

How to break a graph line if there is no value, and start again after the next value is entered.

+6
source share
1 answer

You just need to specify a point with null as its value.

Inside series set breakOnNull: true .

JSFIDDLE LINK

 $.jqplot.config.enablePlugins = true; var chartData = [[1, 224], [3, 672], [5, null],[15,2240],[17,2000]]; function PlotChart(chartData) { var plot2 = $.jqplot('chart1', [chartData], { title: 'Mouse Cursor Tracking', seriesDefaults: { renderer: $.jqplot.CanvasAxisLabelRenderer, rendererOptions: { smooth: true }, pointLabels: { show: true }, breakOnNull: true }, axes: { xaxis: { label: 'Number of Cookies', renderer: $.jqplot.CategoryAxisRenderer, // renderer to use to draw the axis, tickOptions: { formatString: '%d' } }, yaxis: { label: 'Calories', tickOptions: { formatString: '%.2f' } } }, highlighter: { sizeAdjust: 7.5 }, cursor: { show: true } }); } PlotChart(chartData); 
+7
source

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


All Articles