This is a migrated thread and some comments may be shown as answers.

Change Graphic Stacked Bar Color

2 Answers 100 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Mochamad
Top achievements
Rank 1
Mochamad asked on 17 Sep 2010, 11:13 AM
hi, i was tried group bind on this sample..
http://www.telerik.com/help/aspnet-ajax/grouping-databound-items.html

i want change color of "Year : 2007" from green to black..
what should i do?
or it`s depend on skin?

Thanks in advance..

public void CallDummyData()
       {
           ChartSeries chartSeries = new ChartSeries();
           chartSeries.Name = "Sales";
           chartSeries.Type = ChartSeriesType.Bar;
 
           var dummy = new List<DummyData>
           {
               new DummyData { Year = 2007,Quarter = "Q1", Value = 5 },
               new DummyData { Year = 2007,Quarter = "Q2", Value = 2 },
               new DummyData { Year = 2007,Quarter = "Q3", Value = 3 },
               new DummyData { Year = 2007,Quarter = "Q4", Value = 1 },
               new DummyData { Year = 2008,Quarter = "Q1", Value = 2 },
               new DummyData { Year = 2008,Quarter = "Q2", Value = 5 },
               new DummyData { Year = 2008,Quarter = "Q3", Value = 6 },
               new DummyData { Year = 2008,Quarter = "Q4", Value = 2 }
           };
 
           RadChart1.DataGroupColumn = "Year";
           RadChart1.PlotArea.XAxis.DataLabelsColumn = "Quarter";
           RadChart1.Legend.Appearance.GroupNameFormat = "#NAME: #VALUE";
           RadChart1.DataSource = dummy;
           RadChart1.DataBind();
       }

2 Answers, 1 is accepted

Sort by
0
Accepted
Evgenia
Telerik team
answered on 17 Sep 2010, 03:18 PM
Hi Mochamad,

You can set custom color to your chart Series. Add this code snippet after RadChart1.DataBind(); 
to have green color changed to black:

RadChart1.Series[1].Appearance.FillStyle.MainColor = Color.Black;
RadChart1.Series[1].Appearance.FillStyle.FillType = FillType.Solid;


Best wishes,
Evgenia
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Mochamad
Top achievements
Rank 1
answered on 18 Sep 2010, 04:39 AM
thanks, it`s work perfectly..

Regards

Mochamad Fazar
Tags
Chart (Obsolete)
Asked by
Mochamad
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Mochamad
Top achievements
Rank 1
Share this question
or