Chart.Legend
Defines a chart legend. It contains visual appearance, position and content properties.
Sample configuration:
var legendConfig = {
visible: true,
title: {
text: 'Legend Title',
font: '14px sans-serif',
fillStyle: 'red'
},
border: {
lineWidth: 2,
strokeStyle: 'green'
},
font: '12px sans-serif',
textFillStyle: '#418CF0',
background: '#eeeeee',
margin: 10
}
Example usage:
$(document).ready(function () {
$('#selector').jqChart({
title: { text: 'Chart Legend' },
legend: {
visible: true,
allowHideSeries: true,
location : 'right',
title: {
text: 'Legend Title',
font: '14px sans-serif',
fillStyle: 'red'
},
border: {
lineWidth: 2,
strokeStyle: 'green'
},
font: '12px sans-serif',
textFillStyle: '#418CF0',
background: '#eeeeee',
margin: 10
},
series: [
{
title: 'Series Title 1',
type: 'column',
data: [['A', 70], ['B', 40], ['C', 85],
['D', 50], ['E', 25], ['F', 40]]
},
{
title: 'Series Title 2',
type: 'column',
data: [['A', 67], ['B', 25], ['C', 11],
['D', 18], ['E', 44], ['F', 14]]
}
]
}
}
Defined By
Config options
Specifies whether or not the series can be hide from the legend. ...
Specifies whether or not the series can be hide from the legend.
Defaults to: true
Specifies the background fill style of the legend.
Specifies the background fill style of the legend.
Specifies the legend border. ...
Specifies the legend border.
Defaults to: {padding: 2, strokeStyle: 'gray', cornerRadius: 6}
Specifies legend items text border line width. ...
Specifies legend items text border line width.
Defaults to: 0
Specifies the horizontal margin between legend items. ...
Specifies the horizontal margin between legend items.
Defaults to: 4
Specifies the vertical margin between legend items. ...
Specifies the vertical margin between legend items.
Defaults to: 0
Specifies the legend location - 'right', 'bottom', 'left' or 'top'. ...
Specifies the legend location - 'right', 'bottom', 'left' or 'top'.
Defaults to: 'right'
Specifies legend items text border line width. ...
Specifies legend items text border line width.
Defaults to: 0