2013-05-21 99 views
-2

vb.net代码后,使用在线工具http://www.developerfusion.com/tools/convert/csharp-to-vbvb.net代码有语法错误转换

后具有转换后的语法错误

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

转换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 
+3

什么问题? –

+3

你得到什么语法错误? –

+0

代码似乎并不长,也不复杂......为什么不直接尝试手动转换而不是使用工具?这样你可能对问题有更好的看法...... –

回答

0

您应该删除所有发生KeyWith语句在块中不需要引用。例如:

hcFrutas.YAxis.Add(New YAxisItem() With { _ 
    .title = New Title("Unidades") _ 
}) 
+0

非常感谢尼科 - 真的非常感谢您理解我的问题并给出了精确的解决方案。 – user1924911

+0

不客气。如果它对你有帮助,你应该接受答案。 –