1
votes

I use a steema teechart in my C# project. I want to assign custom color palette to single series of the pie chart. I works only when chart has big size. When the chart is limited to small area e.g 300x300 all points on the chart are draw in the same color which is the first color from my palette: enter image description here

However when I increase the size of Chart area to 600x600 then chart has colors from my palette. enter image description here

I have noticed that this happens when there is at least 8,9 points in series. I have try following methods to assign my colors.

ApplyPalette(...

pieSeries[i].Color = _currentColorPalette[i];

ColorMember property and give the relevant color in datasource.

Does anybody meet this problem. Thanks

1

1 Answers

0
votes

This works fine for me in a WinForms application, dropping a TChart component on the form and using this code:

  tChart1.Dock = DockStyle.Fill;
  tChart1.Aspect.View3D = false;
  tChart1.Legend.Visible = false;

  Color[] MyPalette = new Color[15];
  Random random = new Random();

  for (int t = 0; t < 15; ++t) MyPalette[t] = Color.FromArgb(random.Next(0, 255), random.Next(0, 255), random.Next(0, 255));     

  Steema.TeeChart.Themes.ColorPalettes.ApplyPalette(tChart1.Chart, MyPalette);

  Steema.TeeChart.Styles.Pie pie1 = new Steema.TeeChart.Styles.Pie(tChart1.Chart);
  pie1.FillSampleValues(10);
  pie1.Marks.Visible = false;

I can resize the form while pie series colors don't change. Does this work fine at your end? If not, can you please post a code example we can run "as-is" to reproduce the problem here?