How can I change the pie slice shape legends to sqaure shape legends?
I don't think you can change the markers style. You can change their size (property MarkerSize of the Legend) but not the shape.
I want to customize the color in the pie chart. How to perform this?
You can change the colors with the Style property by choosing a predefined style. If you want to do your own style, you must create your own StiChartStyle class :
Code: Select all
public class StiCustomChartStyle : StiChartStyle
{
private Color[] m_styleColors;
public StiCustomChartStyle ()
: base()
{
}
public override Color[] StyleColors
{
get
{
if (m_styleColors == null)
{
m_styleColors = new Color[] { Color.FromArgb(153, 204, 255),
Color.FromArgb(204, 153, 255), Color.FromArgb(204, 255, 204),
Color.FromArgb(255, 255, 153), Color.FromArgb(255, 153, 204),
Color.FromArgb(255, 204, 153), Color.FromArgb(51, 204, 204),
Color.FromArgb(153, 204, 0), Color.FromArgb(255, 204, 0),
Color.FromArgb(255, 153, 0), Color.FromArgb(255, 102, 0),
Color.FromArgb(51, 102, 255), Color.FromArgb(0, 204, 255),
Color.FromArgb(204, 255, 255), Color.FromArgb(204, 204, 255),
Color.FromArgb(153, 51, 102), Color.FromArgb(102, 102, 153)
};
}
return m_styleColors;
}
}
///
/// Gets a service name
///
public override string ServiceName
{
get { return StiLocalization.Get("Chart", "Style") + "99"; }
}
public override Color BasicStyleColor
{
get { return Color.FromArgb(212, 210, 208); }
}
}
And don't forget to add this new service :
Code: Select all
StiConfig.Services.Add(new StiCustomChartStyle());
Cordially,
Kakone