Ozzard Posted October 28, 2009 Report Share Posted October 28, 2009 I've created a BoxPlot by feeding it data explicitly (source appended). When I click the Properties icon on the chart toolbar, then click the Series tab, I get a NullReferenceException deep in Chart FX code: at ChartFX.WinForms.Internal.UI.h.e() at ChartFX.WinForms.Internal.UI.h.g() at ChartFX.WinForms.Internal.UI.h.h() at ChartFX.WinForms.Internal.UI.h.OnVisibleChanged(EventArgs ev) at System.Windows.Forms.Control.SetVisibleCore(Boolean value) at System.Windows.Forms.TabPage.set_Visible(Boolean value) at System.Windows.Forms.TabControl.UpdateTabSelection(Boolean updateFocus) at System.Windows.Forms.TabControl.OnSelectedIndexChanged(EventArgs e) at System.Windows.Forms.TabControl.WmSelChange() at System.Windows.Forms.TabControl.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m) at System.Windows.Forms.Control.WmNotify(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at System.Windows.Forms.Control.DefWndProc(Message& m) at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.TabControl.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.RunDialog(Form form) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at ChartFX.WinForms.Internal.UI.d.a(Object A_0, Object A_1, IUIObject A_2, Int32 A_3, ResourceSet A_4) at ChartFX.WinForms.Chart.ShowPropertiesDialog(Object context, Int32 pageNumber) at ChartFX.WinForms.at.a(CommandsEventArgs A_0, Boolean& A_1) at ChartFX.WinForms.at.a(Object A_0, CommandsEventArgs A_1, Boolean& A_2) at ChartFX.WinForms.at.a(Object A_0, CommandsEventArgs A_1) at ChartFX.WinForms.CommandCollection.a(Int32 A_0, Int32 A_1, IUIObject A_2) at ChartFX.WinForms.CommandCollection.a(Object A_0, Int32 A_1, ICommand A_2, Boolean A_3, IUIObject A_4) at ChartFX.WinForms.CommandCollection.a(Object A_0, Int32 A_1, ICommand A_2, Point A_3, CommandEventHandler A_4, CommandMenuFlags A_5) at ChartFX.WinForms.ToolBar.b(MouseEventArgs A_0) at ChartFX.WinForms.a.h(MouseEventArgs A_0) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.RunDialog(Form form)[...] Is this expected? -- code sample -- chart.Series.Clear(); chart.Data.Clear(); // Find how many series int seriesNumber = 0; foreach (Variable v in options.Parameters["data"].AsDataFrame.Variables) if (v.IsDoubleVariable) seriesNumber++; chart.Data.Series = seriesNumber; chart.Data.CommitChanges(); // TODO: Why is this necessary? // Add the series seriesNumber = 0; foreach (Variable v in options.Parameters["data"].AsDataFrame.Variables) { if (v.IsDoubleVariable) { DoubleVariable dv = v.AsDoubleVariable; if (dv.Data.Length > chart.Data.Points) chart.Data.Points = dv.Data.Length; for (int i = 0; i < dv.Data.Length; i++) chart.Data[seriesNumber, i] = dv.Data; seriesNumber++; } }-- End of code sample -- Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.