|
|
|
/**
|
|
|
|
* This is a charting wrapper, it is designed to simplify the interface to d3
|
|
|
|
* dependencies:
|
|
|
|
'https://the-phi.com/pub/js/jqplot/plugins/jqplot.pointLabels.js',
|
|
|
|
min:0,
|
|
|
|
tickOptions:{
|
|
|
|
showGridline: false
|
|
|
|
},
|
|
|
|
labelRenderer: $.jqplot.CanvasAxisLabelRenderer
|
|
|
|
}
|
|
|
|
},
|
|
|
|
legend:{}
|
|
|
|
} ;
|
|
|
|
return options;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @id DOM identifier
|
|
|
|
* @series matrix of values to be ploted
|
|
|
|
* @labels xaxis labels
|
|
|
|
* @lnames names of series (vectors in the matrix)
|
|
|
|
*/
|
|
|
|
jx.jqplot.line.render = function(id,series,labels,lnames){
|
|
|
|
jx.dom.set.value(id,'')
|
|
|
|
var options = jx.jqplot.line.options() ;
|
|
|
|
options.axes.xaxis.ticks = labels ;
|
|
|
|
if(series.length > 1){
|
|
|
|
options.legend.show = true
|
|
|
|
options.legend.location = 'ne'
|
|
|
|
options.legend.placement = 'outsideGrid'
|
|
|
|
options.series = lnames;
|
|
|
|
}
|
|
|
|
show: true
|
|
|
|
jx.jqplot.stackedBar.render = function(id,series,label,lnames){
|
|
|
|
jx.dom.set.value(id,'')
|
|
|
|
var options = jx.jqplot.stackedBar.options()
|
|
|
|
options.axes.xaxis.ticks = labels ;
|
|
|
|
options.legend.show = true
|
|
|
|
|
|
|
|
options.series = lnames;
|
|
|
|
options.stackSeries= true,
|
|
|
|
// options.seriesDefaults.label = lnames[0];
|
|
|
|
options.seriesDefaults.pointLabels.show= false;
|