Click here to Skip to main content
15,896,730 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Dim table As DataTable = New DataTable
        table.Columns.Clear()
        Chart1.DataSource = Nothing
        Chart1.Series.Clear()
        table.Columns.Add("Color", GetType(System.String))
        table.Columns.Add("Data", GetType(System.Int32))
        table.Rows.Add("Green", Integer.Parse(txtgreen.Text))
        table.Rows.Add("Red", Integer.Parse(txtred.Text))
        table.Rows.Add("Blue", Integer.Parse(txtblue.Text))
        table.Rows.Add("Yellow", Integer.Parse(txtyellow.Text))
        table.Rows.Add("Brown", Integer.Parse(txtnothing.Text))
        Dim IEtable = CType(table, System.ComponentModel.IListSource).GetList
        Chart1.DataBindTable(IEtable, "Color")
        Chart1.DataBindTable(IEtable, "Data")


this is the code for generate/create bar chart
there are five chart in this code i want set different color to each bar

thanks in advance.
Posted

1 solution

where write green blue or other colors you change the name of color
 
Share this answer
 
Comments
basurajkumbhar 5-Oct-13 3:38am    
i am not getting what do you want to ask me?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900