JQPlot Legend Out of Schedule

I use JQPlot and I have many charts on one HTML page. Each of the graphs has the same legend.

My question is this: is it possible to bring the legend completely out of the chart with its own position on the HTML page or in its own div?

+7
source share
3 answers
legend:{ show:true, renderer: $.jqplot.EnhancedLegendRenderer, location: 's' , placement : "outside", marginTop : "30px", rendererOptions: { numberRows: 1 } }, 

You can use the placement: "outside", as in the code above. And you can move it using the properties marginTop, marginBottom, marginRight, marginLeft.

+7
source

Maybe you could hide the legend from the second to the last chart, for example:

 legend: { show:false} 

and on the 1st chart put something like:

  legend:{ show:true, placement: 'outside', rendererOptions: { numberRows: 1 }, location:'n' 

Thus, you will see only one legend at the top of the graphs.

+3
source

Are you looking for a title ? You can style .jqplot-title to look different. By default, it is displayed outside the graph.

 $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]], { title:'Exponential Line', axes:{yaxis:{min:-10, max:240}}, series:[{color:'#5FAB78'}] }); 

You can also remake the legend. See table.jqplot-table-legend at http://www.jqplot.com/docs/files/jqPlotCssStyling-txt.html

0
source

All Articles