-2

vb.net代码转换后有语法错误

我需要将 c# 代码从http://highcharts.codeplex.com/wikipage?title=Create%20a%20column%20chart转换为 vb.net

使用在线工具http://www.developerfusion.com/tools/convert/csharp-to-vb

转换后的vb.net代码如下

hcFrutas.Title = New Title("Consumo de Frutas")
hcFrutas.SubTitle = New SubTitle("Agrupados por tipo de fruta")


'Defining Axis
hcFrutas.YAxis.Add(New YAxisItem() With { _
Key .title = New Title("Unidades") _
})
hcFrutas.XAxis.Add(New XAxisItem() With { _
Key .categories = New () {"Macas", "Laranjas", "Peras", "Bananas", "Uvas"} _
})

'data 
Dim series = New Collection(Of serie)()
series.Add(New Serie() With { _
Key .name = "Andre", _
Key .data = New Object() {4, 15, 5, 17, 14} _
})
series.Add(New Serie() With { _
Key .name = "Ivan", _
Key .data = New Object() {4, 25, 6, 12, 6} _
})
series.Add(New Serie() With { _
Key .name = "Marina", _
Key .data = New Object() {7, 19, 2, 34, 5} _
})
series.Add(New Serie() With { _
Key .name = "Camila", _
Key .data = New Object() {3, 14, 6, 21, 9} _
})

'configuring Visual 
hcFrutas.PlotOptions = New Core.PlotOptions.PlotOptionsColumn() With { _
Key .borderColor = "#dedede", _
Key .borderRadius = 4 _
}

'bind 
hcFrutas.DataSource = series
hcFrutas.DataBind()
please help in resolving above errors in the vb.net code
actually json string is unable to convert in vb.net
4

1 回答 1

0

您应该删除所有出现的Key. 该With语句不需要块内的引用。例如:

hcFrutas.YAxis.Add(New YAxisItem() With { _
    .title = New Title("Unidades") _
})
于 2013-05-21T19:56:11.217 回答