我正在动态添加高图系列。我的设置如下。
new Highcharts.Chart({
"name": "Ratingovertijrrrrrrrrr",
"CID": 59,
"type": 1,
"chart": {
"type": "area",
"zoomType": "xy",
"animation": true,
"renderTo": "CHART_01"
},
"colors": ["#fae570", "#e4b9b9", "#dc7474"],
"exporting": {
"enabled": true
},
"legend": {
"enabled": true,
"floating": false,
"layout": "horizontal",
"align": "center",
"verticalAlign": "bottom",
"backgroundColor": ""
},
"plotOptions": {
"series": {
"allowPointSelect": false,
"animation": true,
"showInLegend": true,
"dataLabels": {
"enabled": false
},
"stacking": "normal"
}
},
"subtitle": {
"text": "over tijd",
"style": {
"fontFamily": "Arial",
"fontSize": "14px",
"fontWeight": "normal",
"fontStyle": "normal",
"color": "#000000"
}
},
"title": {
"text": "Rating",
"style": {
"fontFamily": "Arial",
"fontSize": "18px",
"fontWeight": "normal",
"fontStyle": "normal",
"color": "#000000"
}
},
"tooltip": {
"enabled": true,
"shared": true,
"animation": true,
"crosshairs": [true, false],
"backgroundColor": "#79e538",
"formatter": function () {
return '<b>' + this.series.name + ':</b>' + this.y;
}
},
"xAxis": {
"title": {
"text": "Date",
"enabled": false,
"style": {
"fontFamily": "Arial",
"fontSize": "8px",
"fontWeight": "normal",
"fontStyle": "normal",
"color": ""
}
},
"type": "datetime",
"minRange": "60000",
"startOfWeek": "1",
"dateTimeLabelFormats": {
"millisecond": "%H:%M:%S.%L",
"second": "%H:%M:%S",
"minute": "%H:%M",
"hour": "%H:%M",
"day": "%e. %b",
"week": "%e. %b",
"month": "%b '%y",
"year": "%Y"
},
"categories": [""],
"labels": {
"enabled": true,
"align": "center",
"rotation": "0",
"x": "0",
"y": "15"
}
},
"yAxis": {
"title": {
"text": "Rating",
"enabled": false,
"style": {
"fontFamily": "Arial",
"fontSize": "8px",
"fontWeight": "normal",
"fontStyle": "normal",
"color": ""
}
},
"type": "linear",
"minRange": "",
"startOfWeek": "1",
"dateTimeLabelFormats": {
"millisecond": "%H:%M:%S.%L",
"second": "%H:%M:%S",
"minute": "%H:%M",
"hour": "%H:%M",
"day": "%e. %b",
"week": "%e. %b",
"month": "%b '%y",
"year": "%Y"
},
"categories": [""],
"labels": {
"enabled": true,
"align": "center",
"rotation": "",
"x": "",
"y": ""
}
},
"series": [{
"data": [0],
"name": "Loading...",
"loadingSeries": true
}],
credits: {
enabled: false
}
});
CHART_01
是容器ID。最初加载将显示..之后ajax发送到服务器获取系列列表..并且系列在ajax函数的成功回调时动态添加。
问题是浏览器停止工作。
编辑:
当我将类型更改为linear
"xAxis": {
"type": "linear",
"minRange": "0"
它有效...... "type": "datetime"
有什么问题?
答案 0 :(得分:1)
PRoblem设置了xAxis。在Highcharts中,无法在分类轴和datetime
的同一时间进行设置。此外,当将minRange
设置为分类图表的某些高值(如60 000)时,Highcharts预计会显示至少60 000个类别,这对于宽度为~1000px的图表上的xAxis无法显示60 000个标签。