Min y-axis not working for jQPlotSeries stacked series

From semantic-mediawiki.org

I am having issues getting the y-axis to start at 0 when using the stacked series option in the bar chart. I used the Demo data and put and example here. You can even see the second column's data value is listed below the x-axis. (It is difficult to see...near "BB"). I have added the min parameter, but there was no change. Thank you in advance for any assistance.

15:34, 20 March 2015

> I am having issues getting the y-axis to start at 0 when using the stacked series option in the bar chart. I used the Demo data and put and example here.

Please have a look at [0], it seems that 'data.parameters.stackseries' uses jqplot autoscale. I'm not sure whether jqplot/bar/stack itself can be adjusted or not but I recommend you try tweaking those options available and see the results.

[0] https://github.com/SemanticMediaWiki/SemanticResultFormats/blob/master/formats/jqplot/resources/ext.srf.jqplot.chart.bar.js#L93

[1] https://stackoverflow.com/questions/7837346/how-can-i-display-a-jqplot-stacked-bar-graph-when-xaxis-is-text

[2] https://stackoverflow.com/questions/9046987/jqplot-individual-values-not-totals-in-stacked-chart

[3] http://www.jqplot.com/deploy/dist/examples/barTest.html

16:17, 20 March 2015

Below is what I found fixes the issue I was having.

Starting at line 93 in SemanticResultFormats/formats/jqplot/resources/ext.srf.jqplot.chart.bar.js

// Number axis 
var numberaxis = { 
	  ticks: data.parameters.stackseries || data.parameters.autoscale ?  [] : data.ticks, // use autoscale for staked series 
	  label: data.parameters.numbersaxislabel, 
	  labelRenderer: $.jqplot.CanvasAxisLabelRenderer, 
	- autoscale: data.parameters.stackseries || data.parameters.autoscale ? true : false, 
	+ autoscale: data.parameters.autoscale ? true : false,     //do not use autoscale for stacked series
	- padMax: 0, 
	+ padMax: 0.5,    // make some room at the top
	  padMin: 0, 
	+ min: 0,         // force min = 0 (should be changed to accept min param)
	  tickOptions: { 
	     angle: data.parameters.direction === 'horizontal' ? 0 : -40, 
	     formatString: !data.parameters.valueformat ? '%d' : data.parameters.valueformat  // %d default 
	  } 
}; 
19:51, 24 March 2015
21:32, 24 March 2015

Thanks. I hope this helps someone else out there.

20:06, 25 March 2015