VB.Net Newbie question

Jan 17, 2012 at 10:45 PM
Edited Jan 17, 2012 at 11:17 PM


Firstly! Newbie here so please be gentle!

Came across highcharts.net! Quite nicely done I must say. Well impressed.

Although I can make it work nicely in C#, can't understand how to translate the code to VB.Net to make it work. Have tried it several times (including a C# to Vb.Net converter) but failed everytime.

Can anyone help?

Sorry for newbie question, but spent too much time already trying to make it work... starting to feel like an idiot!

Thanks in advance.


My code:


    hcVendas.YAxis = New YAxis() With
                             .title = New Title("Facturamento")
        hcVendas.YAxis = New YAxis() With
                             .categories = New String() {"2001", "2002", "2003", "2004"}
        Dim serie As New Serie

        Dim series As New Collection()
        series.Add(New Serie With {.data = New Object() {100, 200, 300, 400}})
        hcVendas.DataSource = series

I have also noticed that when I do ".title" or .categories with the latest DLL it does not get recognised although it works with 0.9 version.

Jan 18, 2012 at 4:23 AM
Edited Jan 18, 2012 at 4:24 AM

I'm sorry but my knowledge of VB .Net is very limited, but from what I see, you have directly tried to use the YAxis as you would in V 0.9

As of V 1.0, the X/YAxis is no longer a single item, but is made up of a number of X/YAxisItem(s)

Sample usage for C# would be

hcVendas.YAxis.Add(new YAxisItem { title = new Title("First Axis") });

You should be able to translate this into VB .Net; this also explains why 'title' and 'categories' were not being recognized as properties for an Axis.

The change was made to accommodate multiple X/Y Axes, but the feature still has a bug which I plan to fix in a couple of days. Please see the discussion here if you want to find out the simple steps to fix the bug yourself.

Please let us know if you face any other problems.



Jan 18, 2012 at 5:40 PM

Yeah... sorry Unlink, but all the samples in documentation are wrong ( we changed something on the new version and didn't updated the samples).

I'll change it all today.

Jun 14, 2012 at 6:23 PM


Try this code:
<cc1:LineChart runat="server" ID="hcVendas" ShowCredits="True"  Visible="true"          EnableViewState="False" Width="500" Height="350"         RenderType="spline">                </cc1:LineChart>


Dim varYAxisItem As Highchart.Core.YAxisItem       

Dim varXAxisItem As Highchart.Core.XAxisItem

        varXAxisItem = New Highchart.Core.XAxisItem() With {.categories = New String() {"2001", "2002", "2003", "2004"}}       

varYAxisItem = New Highchart.Core.YAxisItem() With {.title = New Title("Faturamento")}

        Dim serie As New Highchart.Core.Data.Chart.Serie
        Dim series As New Collection()       

series.Add(New Highchart.Core.Data.Chart.Serie With {.visible = False, .data = New Object() {100, 200, 300, 400}})       

hcVendas.DataSource = series       

hcVendas.DataBind()        '