Pie Chart: Own Colors

Oct 2, 2013 at 8:52 AM
Sub DhtmlxCharts10()
        Dim dhtmlxChart2 As New dhtmlxChart2
        dhtmlxChart2.Title = "dhtmlxChart: Pie Chart Own Colors"
        dhtmlxChart2.Heading = dhtmlxChart2.Title
        dhtmlxChart2.ChartType = dhtmlxChart2.ChartTypeEnum.pie3D
        dhtmlxChart2.Width = "500px"
        dhtmlxChart2.Height = "500px"
        dhtmlxChart2.border = "border:1px solid #A4BED4"
        dhtmlxChart2.value = "sales"
        dhtmlxChart2.PieChart.label = "year"
        dhtmlxChart2.PieChart.PieLabelStyle = dhtmlxChart2.PieLabelStyleEnum.value
        ' the first column name should alwways be the x axis column name
        dhtmlxChart2.AddColumns("year", "sales", "color")
        dhtmlxChart2.AddXY("2000", "5.0", dhtmlxChart2.ColorHelper(System.Drawing.Color.Red))
        dhtmlxChart2.AddXY("2001", "2.8", dhtmlxChart2.ColorHelper(System.Drawing.Color.Yellow))
        dhtmlxChart2.AddXY("2002", "1.1", dhtmlxChart2.ColorHelper(System.Drawing.Color.Green))
        dhtmlxChart2.AddXY("2003", "4.4", dhtmlxChart2.ColorHelper(System.Drawing.Color.Blue))
        dhtmlxChart2.AddXY("2004", "2.6", dhtmlxChart2.ColorHelper(System.Drawing.Color.Orange))
        dhtmlxChart2.AddXY("2005", "4.1", dhtmlxChart2.ColorHelper(System.Drawing.Color.Magenta))
        dhtmlxChart2.PieChart.colorcolum = "color"
        dhtmlxChart2.PieChart.legend.valign = dhtmlxChart2.AlignEnum.right
        dhtmlxChart2.PieChart.legend.align = dhtmlxChart2.AlignEnum.right
        dhtmlxChart2.PieChart.legend.marker.type = dhtmlxChart2.MarkerTypeEnum.square
        dhtmlxChart2.PieChart.legend.marker.width = 15
        dhtmlxChart2.PieChart.legend.template = "year"
        dhtmlxChart2.PieChart.legend.marker.visible = True
        dhtmlxChart2.PieChart.legend.visible = True


        WebSite.File_Write("~/dhtmlxChart.html", dhtmlxChart2.Render)
        regLeft.IFrameUrl = "dhtmlxChart.html"
    End Sub