Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Pie chart color control
posted

Hi:

  I designed a pie chart using your software, the problem is how can I control the color of every pie, since I need to write the legend for different pie.

  I saw the following function can be called (posted on your forum): 

private void UltraChart_DrawItem(object sender, DrawItemEventArgs e)

{

 PrimitiveShape currentShape = (PrimitiveShape)e.Primitive;

 if (currentShape != null && currentShape.Data.ContainsKey(typeof(DataPoint)))

 {

 DataPoint dP = currentShape.Data[typeof(DataPoint)] as DataPoint;

 int indexOfDataPoint = this.ultraChart1.Series[0].DataPoints.IndexOf(dP);

 currentShape.BrushElement = this._BrushElements[indexOfDataPoint % this._BrushElements.Length];

 }

}

 

but it's not working in the first line: e.Primitive.

which part I am missing, need to add more reference? I do not install Infragistics.Silverlight on my computer.

I am working under Winform infragaistics2.0 or 3.5.

thanks ...

 

/Cathy