Change chart bars color in visual studio. C# Winforms -
how change blue colors in design time? found method earlier changing color on bars , not on legend.
this chart can show many data depending on user need change color data. thank you
code:
private void loadchartfast() { chart1.series[0].points.clear(); chart1.chartareas["chartarea1"].axisx.interval = 1; using (sqlconnection connection = new sqlconnection("data source=benjopc\\sqlexpress;initial catalog=marischelldatabase;integrated security=true")) { sqlcommand command = new sqlcommand("select top 5 productname, sum(qtysold) qtysold sales_productholder group productname order sum(qtysold) desc", connection); //top selling desc connection.open(); sqldatareader read = command.executereader(); while (read.read()) { this.chart1.series["pieces sold"].points.addxy(read["productname"], read["qtysold"]); } read.close(); // chart3.series["pieces sold"].points[0].color = color.lightseagreen; ; } }
you can use palette
property have different colors:
select of available palettes.
in order add custom colors, can add different colors in palettecustomcolors
property, , set palette
property none
.
Comments
Post a Comment