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

时间:2013-05-21 17:08:41

标签: vb.net

vb.net代码在转换后出现语法错误

我需要从http://highcharts.codeplex.com/wikipage?title=Create%20a%20column%20chart

将c#代码转换为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

1 个答案:

答案 0 :(得分:0)

您应该删除所有出现的KeyWith语句不需要块内的引用。 EP>

hcFrutas.YAxis.Add(New YAxisItem() With { _
    .title = New Title("Unidades") _
})
相关问题