I use jqPlot to render histograms, and I want to do something fairly straightforward, but I'm not sure if the library has one for that.
I have such graphs where the maximum possible value on the y axis can be 42.

Say, if for one case my highest value for any of the bars is 14, then the graph will be displayed only up to 14.

However, I want, IN ALL CASES, I can see that the upper threshold 42 is displayed.
This is what I have now:
var plot3 = $.jqplot('chart3', [line1], { animate: true, animateReplot: true, seriesDefaults: {renderer: $.jqplot.BarRenderer}, series:[{ pointLabels:{ show: true, labels:[depression, anxiety, stress] }, rendererOptions: { animation: { speed: 3500 }, barWidth: 50, barPadding: -15, barMargin: 0, varyBarColor : true, highlightMouseOver: false } }], axes: { xaxis: { renderer:$.jqplot.CategoryAxisRenderer } }, canvasOverlay: { show: true, objects: [{ horizontalLine: { y: 42, lineWidth: 3, color: 'rgb(255,0,0)', shadow: true, xOffset: 0 } }] } }); plot3.replot( { resetAxes: true } );
jquery user-interface graph jqplot
karancan
source share