protected void DoDraw(Graphics graphics)
{
if (m_values != null && m_values.Length > 0) {
graphics.SmoothingMode = SmoothingMode.AntiAlias;
float width = ClientSize.Width - m_leftMargin - m_rightMargin;
float height = ClientSize.Height - m_topMargin - m_bottomMargin;
// if the width or height if <=0 an exception would be thrown -> exit method..
if (width <= 0 || height <= 0)
return;
if (m_pieChart != null)
m_pieChart.Dispose();
if (m_colors != null && m_colors.Length > 0)
m_pieChart = new PieChart3D(m_leftMargin, m_topMargin, width, height, m_values, m_colors, m_sliceRelativeHeight, m_texts);
else
m_pieChart = new PieChart3D(m_leftMargin, m_topMargin, width, height, m_values, m_sliceRelativeHeight, m_texts);
m_pieChart.FitToBoundingRectangle = m_fitChart;
m_pieChart.InitialAngle = m_initialAngle;
// if(m_pieChart.HighlightedIndex>=0)
// m_relativeSliceDisplacements[m_pieChart.HighlightedIndex]-=1;
// if(m_highlightedIndex>=0)
// m_relativeSliceDisplacements[m_highlightedIndex]+=1;
m_pieChart.SliceRelativeDisplacements = m_relativeSliceDisplacements;
m_pieChart.EdgeColorType = m_edgeColorType;
m_pieChart.EdgeLineWidth = m_edgeLineWidth;
m_pieChart.ShadowStyle = m_shadowStyle;
m_pieChart.HighlightedIndex = m_highlightedIndex;
m_pieChart.Draw(graphics);
m_pieChart.Font = this.Font;
m_pieChart.ForeColor = this.ForeColor;
m_pieChart.PlaceTexts(graphics);
}
}