pedro_rosas Posted June 4, 2009 Report Share Posted June 4, 2009 Hi, I want to reset all colors in a chart in order to get back the original colors from the palette. Currently, I have tried to set the empty color to all the series and then set the palette I want to load: foreach(SeriesAttributes serie in chart1.Series) { serie.Color = Color.Empty; } chart1.Palette = "Default"; But I don't get the original colors from the "Default" palette. Is there a way to do this? Thanks in advance. Best Regards, Pedro Rosas Quote Link to comment Share on other sites More sharing options...
TatianaG Posted June 5, 2009 Report Share Posted June 5, 2009 Where are you setting the Pallete property? I created a simple sample. Manually I set the Pallete property to Nature.Sky (in the Properties window) and then changed it in code as bellow: private void Form1_Load(object sender, EventArgs e) { chart1.Data.Series = 1; chart1.Data.Points = 3;chart1.Gallery = Gallery.Pie; } private void button1_Click(object sender, EventArgs e) {chart1.Palette = "Default"; } It works just fine! Please let me know if works for you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.