User (Legacy) Posted April 6, 2006 Report Share Posted April 6, 2006 Hi, I am using Chart FX .NET for VS .NET 2005 Winforms to plot a day's worth of Open-High-Low-Close data. I am not using data binding. Instead, I using the normal ChartFX API. My X-Axis is not of DateTime type, just the normal integer type. I loop through say 100 points and plot them at 0, 1, 2, ..., 98, 99. I also like to draw vertical lines on the chart at different points in the day based on things that happen in the news, for instance, like the new Google online Financial application plots news events as vertical lines on their charts. Most of the events I like to plot occur during trading hours, so I can draw those lines at X-Axis values like 0, 4, 97, and 99. However, some events that I like to plot may occur a few hours before or after a stock market opens or closes. To plot those lines at an X-Axis distance that is proportional to the time between the first or last 5 minute Open-High-Low-Close bar for the day, I may plot a vertical line at -7 if the news event occurred 35 minutes before the first bar (35 minutes / 5 minutes = X-Axis distance of 7) or a vertical line at 104 if a news event happened 25 minutes after the close of a market that had only 100 points for the day. When I plot after-hours news events, I adjust the chart.AxisX.MinValue and chart.AxisX.MaxValue programmatically so that the vertical lines show up. In these cases, when a user rolls their mouse over the X-Axis in order to see the tooltip that by default displays the point number like "0" or "99", everything works great for X-Axis values that are within the range of Open-High-Low-Close values (that is points 0 to 99 for a 100-bar chart). However, when the user puts their mouse over an X-Axis value that is outside the range of bar data X-Values (like -7 or 104), a low level exception occurs at the Chart FX level. It is such a low level exception that I can't even catch in the Get Tooltip event. When I debug the application in Visual Studio, the line that generates the exception is unfortunately in program.cs at the Application.Run(new Form_MyChartingApplication()); line. [sTAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form_MyChartingApplication()); } Message: "Object reference not set to an instance of an object." Source: "ChartFX.WinForms" Stack Trace: " at ChartFX.WinForms.AxisSection.a(UIString A_0)\r\n at ChartFX.WinForms.ak.a(Point A_0)\r\n at ChartFX.WinForms.c.a(Object A_0, EventArgs A_1)\r\n at System.Windows.Forms.Timer.OnTick(EventArgs e)\r\n at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(Form mainForm)\r\n at MyChartingApplication.Program.Main() in C:\\projects\\Quadriga4_2005\\QChart4\\Program.cs:line 17\r\n at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()" How can I stop this problem from happening. Shouldn't I be able to draw vertical lines and display X-Axis sections of the chart that are outside of the Open-High-Low-Close bar values without low level exceptions occurring when the user rolls their mouse over the X-Axis? I really don't want to have to do something like add hidden bars in the front and end of my chart data points just so that they can span the distnace between my first and last vertical line. Thank you very much in advance, Brook Hunter Link to comment Share on other sites More sharing options...
User (Legacy) Posted April 6, 2006 Author Report Share Posted April 6, 2006 Hi, I just downloaded the newest Service Pack for Chart FX for VS .NET 2005, and it fixed the problem that I described in my earlier post. I downloaded it from the ActiveX control located here: http://support.softwarefx.com/ShowInteractive.aspx?Product=CfxNet70&option=0 Thanks, Brook Hunter "Brook Hunter" <brookhunter2000@yahoo.com> wrote in message news:pPKKElcWGHA.220@webserver3.softwarefx.com... > Hi, > > I am using Chart FX .NET for VS .NET 2005 Winforms to plot a day´s worth > of Open-High-Low-Close data. I am not using data binding. Instead, I > using the normal ChartFX API. > > My X-Axis is not of DateTime type, just the normal integer type. I loop > through say 100 points and plot them at 0, 1, 2, ..., 98, 99. > > I also like to draw vertical lines on the chart at different points in the > day based on things that happen in the news, for instance, like the new > Google online Financial application plots news events as vertical lines on > their charts. > > Most of the events I like to plot occur during trading hours, so I can > draw those lines at X-Axis values like 0, 4, 97, and 99. However, some > events that I like to plot may occur a few hours before or after a stock > market opens or closes. To plot those lines at an X-Axis distance that is > proportional to the time between the first or last 5 minute > Open-High-Low-Close bar for the day, I may plot a vertical line at -7 if > the news event occurred 35 minutes before the first bar (35 minutes / 5 > minutes = X-Axis distance of 7) or a vertical line at 104 if a news event > happened 25 minutes after the close of a market that had only 100 points > for the day. When I plot after-hours news events, I adjust the > chart.AxisX.MinValue and chart.AxisX.MaxValue programmatically so that the > vertical lines show up. > > In these cases, when a user rolls their mouse over the X-Axis in order to > see the tooltip that by default displays the point number like "0" or > "99", everything works great for X-Axis values that are within the range > of Open-High-Low-Close values (that is points 0 to 99 for a 100-bar > chart). However, when the user puts their mouse over an X-Axis value that > is outside the range of bar data X-Values (like -7 or 104), a low level > exception occurs at the Chart FX level. It is such a low level exception > that I can´t even catch in the Get Tooltip event. When I debug the > application in Visual Studio, the line that generates the exception is > unfortunately in program.cs at the Application.Run(new > Form_MyChartingApplication()); line. > > [sTAThread] > static void Main() > { > Application.EnableVisualStyles(); > Application.SetCompatibleTextRenderingDefault(false); > Application.Run(new Form_MyChartingApplication()); > } > > Message: "Object reference not set to an instance of an object." > Source: "ChartFX.WinForms" > Stack Trace: " at ChartFX.WinForms.AxisSection.a(UIString A_0)\r\n at > ChartFX.WinForms.ak.a(Point A_0)\r\n at ChartFX.WinForms.c.a(Object A_0, > EventArgs A_1)\r\n at System.Windows.Forms.Timer.OnTick(EventArgs e)\r\n > at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)\r\n > at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 > msg, IntPtr wparam, IntPtr lparam)\r\n at > System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n > at > System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 > dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at > System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 > reason, ApplicationContext context)\r\n at > System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 > reason, ApplicationContext context)\r\n at > System.Windows.Forms.Application.Run(Form mainForm)\r\n at > MyChartingApplication.Program.Main() in > C:\\projects\\Quadriga4_2005\\QChart4\\Program.cs:line 17\r\n at > System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)\r\n > at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence > assemblySecurity, String[] args)\r\n at > Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at > System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at > System.Threading.ExecutionContext.Run(ExecutionContext executionContext, > ContextCallback callback, Object state)\r\n at > System.Threading.ThreadHelper.ThreadStart()" > > How can I stop this problem from happening. Shouldn´t I be able to draw > vertical lines and display X-Axis sections of the chart that are outside > of the Open-High-Low-Close bar values without low level exceptions > occurring when the user rolls their mouse over the X-Axis? > > I really don´t want to have to do something like add hidden bars in the > front and end of my chart data points just so that they can span the > distnace between my first and last vertical line. > > Thank you very much in advance, > > Brook Hunter > > > > > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.