.NET3.5で実行されているTeeChartPocketを使用しています。ターゲットアプリケーションは、.NET3.5を搭載したWindowsCE6.0を実行しています。円グラフを描画する小さなフォームアプリケーションを作成しましたが、エッジスタイルを追加すると、が表示されNullReferenceException
ます。
この例外を生成する最小コード(デザイナーコードなし)は次のようになります。
public class Form1 : Form
{
public Form1()
{
InitializeComponent();
var series = new Pie();
series.FillSampleValues(6);
series.BevelPercent = 20;
series.EdgeStyle = EdgeStyles.Curved;
var chart = new TChart();
chart.Series.Add(series);
this.Controls.Add(chart);
}
}
この例外は、次のプログラムでもスローされます。
chart.Series.Add(series);
series.FillSampleValues(6);
series.BevelPercent = 20;
series.EdgeStyle = EdgeStyles.Curved;
chart.Location = new Point(0, 0);
chart.Width = this.Width;
chart.Height = this.Height;
this.Controls.Add(chart);
なぜ私は得ているのNullReferenceException
ですか?の設定行のコメントを外してもEdgeStyle
、例外はスローされません。完全なスタックトレースは次のとおりです。
System.NullReferenceException was unhandled
Message="NullReferenceException"
StackTrace:
at System.Drawing.Graphics.FillPolygon(Brush brush, Point[] points)
at Steema.TeeChart.Drawing.Graphics3DGdiPlus.Polygon(PointDouble[] p)
at Steema.TeeChart.Drawing.Graphics3D.Pie3D.DrawPoints()
at Steema.TeeChart.Drawing.Graphics3D.Pie3D.DoTopGradient(Int32 zDepth)
at Steema.TeeChart.Drawing.Graphics3D.Pie3D.DoCurvedGradient(Int32 zDepth)
at Steema.TeeChart.Drawing.Graphics3D.Pie3D.DrawLighting(EdgeStyles edgeStyle)
at Steema.TeeChart.Drawing.Graphics3D.Pie3D.Pie(Int32 xCenter, Int32 yCenter, Int32 xRadius, Int32 yRadius, Int32 z0, Int32 z1, Double startAngle, Double endAngle, Boolean darkSides, Boolean drawSides, Int32 donutPercent, Int32 bevelPercent, EdgeStyles edgeStyle)
at Steema.TeeChart.Drawing.Graphics3D.Pie(Int32 xCenter, Int32 yCenter, Int32 xRadius, Int32 yRadius, Int32 z0, Int32 z1, Double startAngle, Double endAngle, Boolean darkSides, Boolean drawSides, Int32 donutPercent, Int32 bevelPercent, EdgeStyles edgeStyle)
at Steema.TeeChart.Drawing.Graphics3D.Pie(Int32 xCenter, Int32 yCenter, Int32 xOffset, Int32 yOffset, Int32 xRadius, Int32 yRadius, Int32 z0, Int32 z1, Double startAngle, Double endAngle, Boolean darkSides, Boolean drawSides, Int32 donutPercent, Int32 bevelPercent, EdgeStyles edgeStyle)
at Steema.TeeChart.Styles.Pie.DrawPie(Graphics3D g, Int32 valueIndex)
at Steema.TeeChart.Styles.Pie.DrawPie(Int32 valueIndex)
at Steema.TeeChart.Styles.Pie.DrawValue(Int32 valueIndex)
at Steema.TeeChart.Styles.Pie.Draw()
at Steema.TeeChart.Styles.Series.DrawSeries()
at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g)
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)
at Steema.TeeChart.Chart.InternalDraw(Graphics g)
at Steema.TeeChart.Pocket.TChart.Draw(Graphics g)
at Steema.TeeChart.Pocket.TChart.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
at Microsoft.AGL.Forms.WL.Update(IntPtr hwnThis)
at System.Windows.Forms.Control.Update()
at System.Windows.Forms.Control.Refresh()
at Steema.TeeChart.Pocket.TChart.OnResize(EventArgs e)
at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
at System.Windows.Forms.Application.Run(Form fm)
at Demo.Form1.Main()
InnerException: