条形图的chage颜色 [英] chage color of bar chart

查看:76
本文介绍了条形图的chage颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

推荐答案

写绿绿色或其他颜色你改变颜色名称
where write green blue or other colors you change the name of color


这篇关于条形图的chage颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆