Highcharts 实现堆叠图下钻两层的方法
stack chart inside drill-down
JavaScript 代码:
//highcharts
$(function () {
// stacked chart inside drill-down
$('#highcharts-chart').highcharts({
chart: {
type: 'column',
events: {
drilldown: function (e) {
if (!e.seriesOptions) {
var chart = this
drilldowns_avail = {
{% for cluster in cluster_list %}
'{
{cluster.idc}}@{
{cluster.ip}}': {
name: '可用空间',
color: '#50B432',
data: [
{% for chunk in cluster.chunk_set.all %}
['{
{ chunk.ip }}',{
{ chunk.avail_space_tb }}],
{% endfor %}
],
},
{% endfor %}
}
drilldowns_used = {
{% for cluster