Search code examples
javascriptjquerychartsjqplot

Jqplot, multiple line type


How do I make multiple line types in a single plot in jqPlot?

The following would display 3 lines in dotted, but what if I want line 1 to be dotted and line 2 to be solid?

plot = $.jqplot("myplot", [line1, line2, line3], {
    seriesDefaults : {
        linePattern : 'dotted',
        showMarker : false,
        shadow : false
    },
    ...
});

Solution

  • You could do it in a similar way as they do it here in the bottom most example for marks you just need to specify your patter for each line accordingly.

    This jsfiddle show exactly how it is used.