User (Legacy) Posted August 2, 2005 Report Posted August 2, 2005 I'm using ChartFX for .NET v6.2 and Visual Studio.NET/Windows Form/VB.NET to create a scrollable Gantt chart. See attachment for chart visual. When I try to print the chart from the toolbar, it generates a run-time error. See below for code and error message. Note in my code that if I set the x.Inverted property to False, then no run-time error is generated when I print. Please advise on solution. -LT ---------------------------------------------- CODE: ---------------------------------------------- Sub DrawChart() Dim InitStart As DateTime = #6/1/2005# Dim InitStartOA As Double = InitStart.ToOADate Dim PointCount As Integer = 70 Dim y, x As Axis Chart1.Scrollable = True x = Chart1.AxisX x.PixPerUnit = 20 x.Step = 1 x.Inverted = True 'If set to False, then no run-time error y = Chart1.AxisY y.Step = 5 y.Min = InitStartOA y.Max = InitStartOA + (2 * PointCount) + PointCount y.LabelsFormat.Format = AxisFormat.Date y.LabelAngle = 90 Chart1.OpenData(COD.Values, 1, COD.Unknown) Chart1.OpenData(COD.IniValues, 1, COD.Unknown) For i As Integer = 0 To PointCount Chart1.IniValue(0, i) = InitStartOA + i 'start Chart1.Value(0, i) = InitStartOA + i + (2 * i) 'finish x.Label(i) = "Task " & i Next Chart1.CloseData(COD.IniValues) Chart1.CloseData(COD.Values) End Sub ---------------------------------------------- ERROR: ---------------------------------------------- See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: Index was out of range. Must be non-negative and less than the size of the collection. at System.Collections.CollectionBase.System.Collections.IList.get_Item(Int3 2 index) at SoftwareFX.ChartFX.LabelList.get_Item(Int32 i) at SoftwareFX.ChartFX.AxisBase.JK(1P 229, Rectangle[] 22A, SetPropFlag& 22B, 1B 22C, AxisSection& 22D) at SoftwareFX.ChartFX.AxisCollection.K5(1P 23P, Rectangle[] 23Q, 1B 23R) at SoftwareFX.ChartFX.ChartCore.EO(1P 1S1, Boolean 1S2, Boolean 1S3) at SoftwareFX.ChartFX.ChartCore.EN(1P 1RY, Rectangle& 1RZ, Int32& 1S0) at SoftwareFX.ChartFX.ChartCore.EM(PaintBar 1RV, IGraphicsEx 1RW, Rectangle& 1RX) at SoftwareFX.ChartFX.ChartCore.GH(PaintBar 1UQ, IGraphicsEx 1UR, Rectangle& 1US) at SoftwareFX.ChartFX.Printer.PO(Object 2IP, PrintPageEventArgs 2IQ) at System.Drawing.Printing.PrintDocument.OnPrintPage(PrintPageEventArgs e) at System.Drawing.Printing.PrintDocument._OnPrintPage(PrintPageEventArgs e) at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document) at System.Drawing.Printing.PrintController.Print(PrintDocument document) at System.Drawing.Printing.PrintDocument.Print() at SoftwareFX.ChartFX.Printer.PrintDialog(Boolean fromTo) at SoftwareFX.ChartFX.04.87(Object 1CE, CommandsEventArgs 1CF) at SoftwareFX.ChartFX.CommandBar.S(Int32 7A, Int32 7B, Object 7C) at SoftwareFX.ChartFX.CommandBar.K(Object 6K, Int32 6L, ICommand 6M, Boolean 6N, Object 6O) at SoftwareFX.ChartFX.CommandBar.L(Object 6P, Int32 6Q, ICommand 6R, Point 6S, CommandEventHandler 6T, CommandMenuFlags 6U) at SoftwareFX.ChartFX.Base.ToolBar.1L(MouseEventArgs C0) at SoftwareFX.ChartFX.G.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.