I think what you really want is showMarker
. Since in this code you do not set point labels, therefore they will never be displayed. showMarker
allows you to turn graph points on and off.
Is that what you really are after? Otherwise, specify the example that you are using.
Here is an example made for a similar problem.
Please view this sample. Click the button to change the creators' visibility.
Update: This example shows a solution that uses the approach described above, that is, redesigning the graph when changing the new parameter "pointLabels".
jQuery(document).ready(function () { var data = [ [1, 1], [2, 5], [4, 9] ]; var graph; var isShowPointLabels = true; function makePlot(showPointLabels) { graph = $.jqplot("chart", [data], { series: [{ pointLabels: { show: showPointLabels } }] }); } makePlot(isShowPointLabels); $("#click").click(function () { isShowPointLabels = !isShowPointLabels; makePlot(isShowPointLabels); graph.replot(); }); });
In this case, I could not figure out how to use drawSeries(...)
to redo just one series, as @Mark shows for marker
, which would be good practice here.
source share