我的數據來自後面代碼上的數據表。我正在重新繪製圖形以顯示新數據,但是在數據重繪時可以更改y軸嗎?在highcahrts上更改y軸
代碼:
function draw(d) {
var testarray = JSON.parse(a);
var testarray1 = JSON.parse(a1);
var testarray2 = JSON.parse(a2);
if (d == 1)
{
var c = testarray
}
else if (d == 2)
{
var c = testarray1
}
else if (d == 3)
{
var d = testarray
}
else if (d == 4)
{
var d = testarray1
}
else if (d == 5) {
var d = testarray1
}
else if (d == 6) {
var d = testarray1
}
$(function() {
$('#container1').highcharts({
chart: {
type: 'column'
},
credits: {
enabled: false
},
title: {
text: 'Consumption by months'
},
xAxis: {
categories: array3
},
yAxis: {
title: {
text: 'kWh'
}
},
tooltip: {
valueDecimals: 2
},
plotOptions: {
type: 'column'
},
series: [{
name: '2011-2012',
type: 'column',
color: '#0000FF',
data: testarray
},
{
name: '2012-2013',
type: 'column',
color: '#92D050',
data: testarray1
}]
});
});
}
所以我需要的是證據,表明在y軸上testarray當數據被調用。在這種情況下,c和d。
後面的代碼
Case 1
For Each row In Year1
testarray.Add(row("data"))
Next row
For Each row In Year2
testarray1.Add(row("data"))
Next row
For Each row In Year3
testarray2.Add(row("data"))
Next row
Dim serializer1 As New JavaScriptSerializer()
Dim arrayJsonTest1 As String = serializer1.Serialize(testarray)
Dim arrayJson11 As String = serializer1.Serialize(testarray1)
Dim arrayJson12 As String = serializer1.Serialize(testarray2)
hidden.Value = arrayJsonTest1
hidden1.Value = arrayJson11
hidden2.Value = arrayJson12
ScriptManager.RegisterStartupScript(Me.Page, Me.GetType, "draw", "javascript:draw(1);", True)
我已更新我的帖子... –