Reputation: 41
This is javascript code of stack chart in highchart-
legend: {
align: 'right',
x: -70,
verticalAlign: 'top',
y: 20,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
borderColor: '#CCC',
borderWidth: 1,
shadow: false
},
Here are series of my data-
series: [{
name: 'A',
data: [5]
}, {
name: 'B',
data: [2]
}, {
name: 'C',
data: [3]
}]
Is it possible to show the legend of above data of a Highcharts (stacked Chart) in a table format ?
Upvotes: 3
Views: 984
Reputation: 2157
Highcharts (stacked Chart) in a table format
http://jsfiddle.net/ntg7qz3q/1/
working fiddle
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Stacked bar chart'
},
xAxis: {
categories: ['A', 'B', 'C']
},
yAxis: {
min: 0,
title: {
text: 'Total fruit consumption'
}
},
legend: {
align: 'right',
x: -70,
verticalAlign: 'top',
y: 20,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
borderColor: '#CCC',
borderWidth: 1,
shadow: false
},
plotOptions: {
series: {
stacking: 'normal'
}
},
series: [{
name: 'A',
data: [5]
}, {
name: 'B',
data: [2]
}, {
name: 'C',
data: [3]
}]
});
});
Upvotes: -1