Change chart bars color in visual studio. C# Winforms -


enter image description here

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:

enter image description here

select of available palettes.

in order add custom colors, can add different colors in palettecustomcolors property, , set palette property none.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -