Bar Chart Using addSeries

Coordinator
Oct 2, 2013 at 8:49 AM
Sub DhtmlxCharts4()
        ' bar chart using add series
        Dim dhtmlxChart2 As New dhtmlxChart2
        dhtmlxChart2.Title = "dhtmlxChart: Bar Chart Using AddSeries"
        dhtmlxChart2.Heading = dhtmlxChart2.Title
        dhtmlxChart2.ChartType = dhtmlxChart2.ChartTypeEnum.barhorizontal
        dhtmlxChart2.Width = "500px"
        dhtmlxChart2.Height = "500px"
        dhtmlxChart2.border = "border:1px solid #A4BED4"
        dhtmlxChart2.Value = "sales"
        dhtmlxChart2.BarChart.label = "sales"
        dhtmlxChart2.BarChart.width = 30
        dhtmlxChart2.BarChart.xAxis.title = "Sales per year"
        dhtmlxChart2.BarChart.xAxis.scale_start = 1
        dhtmlxChart2.BarChart.xAxis.scale_end = 5
        dhtmlxChart2.BarChart.xAxis.scale_step = 1
        dhtmlxChart2.BarChart.xAxis.lines = True
        dhtmlxChart2.BarChart.xAxis.SetScales = True
        dhtmlxChart2.BarChart.yAxis.template = dhtmlxChart2.InQuotes(dhtmlxChart2.InHash("year"))
        dhtmlxChart2.BarChart.yAxis.title = "Year"
        dhtmlxChart2.BarChart.border = True
        ' the first column name should alwways be the x axis column name
        dhtmlxChart2.AddColumns("year", "sales", "sales1", "sales2", "sales3")
        dhtmlxChart2.AddXY("2000", "5.0", "3.4", "2.1", "1.1")
        dhtmlxChart2.AddXY("2001", "2.8", "4.8", "1.3", "1.2")
        dhtmlxChart2.AddXY("2002", "1.1", "4.4", "2.9", "1.3")
        dhtmlxChart2.AddXY("2003", "4.4", "5.5", "2.6", "1.4")
        dhtmlxChart2.AddXY("2004", "2.6", "6.0", "1.4", "1.5")
        dhtmlxChart2.AddXY("2005", "4.1", "5.7", "1.1", "1.6")
        dhtmlxChart2.AddSeries("sales", System.Drawing.Color.Red, "sales")
        dhtmlxChart2.AddSeries("sales1", System.Drawing.Color.Orange, "sales1")
        dhtmlxChart2.AddSeries("sales2", System.Drawing.Color.Green, "sales2")
        dhtmlxChart2.AddSeries("sales3", System.Drawing.Color.Blue, "sales3")
        dhtmlxChart2.BarChart.legend.text = "Horizontal Bar"
        dhtmlxChart2.BarChart.legend.color = System.Drawing.Color.Tan
        dhtmlxChart2.BarChart.legend.valign = dhtmlxChart2.AlignEnum.top
        dhtmlxChart2.BarChart.legend.align = dhtmlxChart2.AlignEnum.middle
        dhtmlxChart2.BarChart.legend.visible = True
        WebSite.File_Write("~/dhtmlxChart.html", dhtmlxChart2.Render)
        regLeft.IFrameUrl = "dhtmlxChart.html"
    End Sub