我有来自 vb.net 的数据,我想调用到 y 轴。
后面的代码:
Dim yaxis As String
If RadioButtonList1.SelectedItem.Value = 1 Then
yaxis = "Fruit eaten"
End If
hidden10.Value = yaxis
javascript
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: '** i want Fruit eaten here***'**
}
},
series: [{
name: 'Jane',
data: [1, 0, 4]
}, {
name: 'John',
data: [5, 7, 3]
}]
});
});
<asp:HiddenField ID="hidden10" runat="server" />
var a10 = $("#<%=hidden10.ClientID%>").val();
如您所见,它显示文本:但我希望显示 hidden10 值...
我已经拥有的绘图功能
function draw(d) {
var testarray = JSON.parse(a);
var testarray1 = JSON.parse(a1);
var testarray2 = JSON.parse(a2);
var yaxis = $("#<%=hidden10.ClientID%>").val();
testarray 是来自 backcode 的数据。
单选按钮的代码背后:
Select Case RadioButtonList1.SelectedItem.Value
Case 1
Dim yaxis As String
If RadioButtonList1.SelectedItem.Value = 1 Then
yaxis = "fruit eaten"
End If
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
' Bind_kWhValues(Year1, Year2, Year3)
ScriptManager.RegisterStartupScript(Me.Page, Me.GetType, "draw", "javascript:draw(1);", True)
Case 2
Dim yaxis As String
If RadioButtonList1.SelectedItem.Value = 2 Then
yaxis = "fruits not eaten"
End If
hidden10.Value = yaxis
ScriptManager.RegisterStartupScript(Me.Page, Me.GetType, "draw", "javascript:draw(2);", True)