Jump to content
Software FX Community

VekiPeki

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by VekiPeki

  1. Hi, did you manage to fix this? We are having this same problem in Cfx 7 for WinForms. It happens sometimes when we zoom a part of a chart. Chart is divided into 2 panes. Stack trace indicates that the exception is thrown sometimes during text rendering: at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format) at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, Single x, Single y, StringFormat format) at ChartFX.WinForms.Internal.GraphicsEx.DrawString(String s, Font font, Brush brush, Int32 x, Int32 y, StringFormat format) at ChartFX.WinForms.Internal.DrawText.a(IGraphicsEx A_0, Font A_1, Brush A_2, String A_3, Point A_4) at ChartFX.WinForms.Internal.DrawText.DrawString(IGraphicsEx gx, Font font, String text, Point pt) at ChartFX.WinForms.Axis.a(t A_0, AxisPaintInfo& A_1, Int32 A_2, Int32 A_3, SectionAttributes& A_4, Double A_5, Int32 A_6, Int32 A_7, Int32& A_8, Int32& A_9, Boolean A_10, Double A_11, Double A_12, Boolean A_13) at ChartFX.WinForms.Axis.a(PaintMarkBase A_0, Rectangle[] A_1, RepaintFlags A_2, AxisPaint A_3, SectionAttributes& A_4, AxisPaintInfo& A_5, Double A_6, Double A_7) at ChartFX.WinForms.Axis.a(t A_0, Rectangle[] A_1, RepaintFlags& A_2, AxisPaint A_3, AxisSection& A_4) at ChartFX.WinForms.AxisCollection.a(t A_0, Rectangle[] A_1, AxisPaint A_2) at ChartFX.WinForms.Pane.a(t A_0, Rectangle[] A_1, AxisPaint A_2) at ChartFX.WinForms.PaneCollection.a(t A_0, Rectangle[] A_1, AxisPaint A_2) at ChartFX.WinForms.t.b(Boolean A_0, Boolean A_1) at ChartFX.WinForms.t.a(IFrame A_0, PaintBar A_1, Int32& A_2) at ChartFX.WinForms.Chart.a(PaintBar A_0, IGraphicsEx A_1) at ChartFX.WinForms.al.a(PaintEventArgs A_0) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System.Windows.Forms.Control.WmPaint(Message& m) 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)
  2. Hello. Did you manage to resolve this? I am getting the same error in CFX 7 for WinForms. It happens sometimes when I zoom a part of a chart with multiple panes. Last few lines of the stack trace indicate that problem occurs during some text rendering:Stack trace: at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format) at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, Single x, Single y, StringFormat format) at ChartFX.WinForms.Internal.GraphicsEx.DrawString(String s, Font font, Brush brush, Int32 x, Int32 y, StringFormat format) at ChartFX.WinForms.Internal.DrawText.a(IGraphicsEx A_0, Font A_1, Brush A_2, String A_3, Point A_4) at ChartFX.WinForms.Internal.DrawText.DrawString(IGraphicsEx gx, Font font, String text, Point pt) at ChartFX.WinForms.Axis.a(t A_0, AxisPaintInfo& A_1, Int32 A_2, Int32 A_3, SectionAttributes& A_4, Double A_5, Int32 A_6, Int32 A_7, Int32& A_8, Int32& A_9, Boolean A_10, Double A_11, Double A_12, Boolean A_13) at ChartFX.WinForms.Axis.a(PaintMarkBase A_0, Rectangle[] A_1, RepaintFlags A_2, AxisPaint A_3, SectionAttributes& A_4, AxisPaintInfo& A_5, Double A_6, Double A_7) at ChartFX.WinForms.Axis.a(t A_0, Rectangle[] A_1, RepaintFlags& A_2, AxisPaint A_3, AxisSection& A_4) at ChartFX.WinForms.AxisCollection.a(t A_0, Rectangle[] A_1, AxisPaint A_2) at ChartFX.WinForms.Pane.a(t A_0, Rectangle[] A_1, AxisPaint A_2) at ChartFX.WinForms.PaneCollection.a(t A_0, Rectangle[] A_1, AxisPaint A_2) at ChartFX.WinForms.t.b(Boolean A_0, Boolean A_1) at ChartFX.WinForms.t.a(IFrame A_0, PaintBar A_1, Int32& A_2) at ChartFX.WinForms.Chart.a(PaintBar A_0, IGraphicsEx A_1) at ChartFX.WinForms.al.a(PaintEventArgs A_0) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System.Windows.Forms.Control.WmPaint(Message& m) 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)
  3. I am trying to implement a custom zoom solution for ChartFX, and the code looks something like this: private Point startPoint = Point.Empty; // On mouse down, save the starting point void chart_MouseDownEvent(object sender, _ChartEvents_MouseDownEvent e) { startPoint = new Point(e.args.X, e.args.Y); } // On mouse up, zoom to coordinates void chart_MouseUpEvent(object sender, _ChartEvents_MouseUpEvent e) { if (e.args.Button != ButtonLeft) return; // override regular functionality e.args.Handled = true; Point endPoint = new Point(e.args.X, e.args.Y); Axis xAxis = chart.AxisX; Axis yAxis = chart.AxisY; double minX = xAxis.PixelToValue(startPoint.X); double maxX = xAxis.PixelToValue(endPoint.X); double minY = yAxis.PixelToValue(startPoint.Y); double maxY = yAxis.PixelToValue(endPoint.Y); if (!axChart1.Zoom) axChart1.Zoom = true; xAxis.Zoom(Math.Min(minX, maxX), Math.Max(minX, maxX)); yAxis.Zoom(Math.Min(minY, maxY), Math.Max(minY, maxY)); } The problem is that, after I handle the event, zoom selection dashed rectangle remains visible (and active as I move the mouse). I bypassed the standard functionality (I did set the Handled property to true), but it seems like it still remains in this "in-the-middle-of-zoom" mode. Does anyone have any experience with implementing custom zoom functionality? Maybe someone has encountered this before. Thanks a lot!
  4. We found this problem in both Chart FX Client Server 6.2 and Chart FX 7 (Windows Forms). Chart FX behaves unexpectedly when zooming the chart with multiple panes. In certain cases, zooming in on one of the panes completely messes up the other pane's scroll position. First of all, zooming across two panes will zoom in both panes. This is probably the intended behavior, but we would rather zoom in only the axis which was clicked first. Is it possible to change this behavior easily? The actual problem The problem happens when one of the panes (the upper one) is already zoomed, and you try too zoom in the other pane (the lower one) somewhere near its top. It seems that ChartFX this also zooms the upper pane in its relative coordinates, making it scroll to some small lower portion. Again, we found the same problem in both .NET and COM versions. Screencaps First, we zoom in the upper pane: This works as expected: Now we try to zoom in the second pane (problem occurs when you zoom near the adjacent pane): Notice what happened to the first pane: Is there a workaround for this? Thanks!
  5. How do I anchor an annotation to a different pane if I have multiple panes? E.g. this code: Annotation annots = new Annotations(); chart.Extensions.Add(annots); AnnotationArrow arrow = new AnnotationArrow(); annots.List.Add(arrow); // these coordinates are relative to chart.Panes[0] axis arrow.Attach(left, top, right, bottom); will anchor the arrow annotation to Pane[0] (and coordinates must be expressed relative to Pane[0] axis coordinates). Is there a way to attach annotations to a specific Axis or Pane?
  6. Hello! We have a problem drawing area charts using Chart FX 7 for Windows Forms (7.0.3306.26568). The problem is that the area chart is incorrectly rendered when the chart is zoomed and scrolled. We have had this problem earlier with Chart FX Client Server 6.2, but a hotfix for this was never released. Since we presumed that you are no longer maintaining the COM version (and presumed this has been fixed in new versions), we have moved to Chart FX 7, but the same bug occurs nevertheless. This is the code we used: void Form1_Load(object sender, EventArgs e){ ListProvider data = new ListProvider(); data.List = new ArrayList(); IList xData = new DateTime[] { DateTime.Now, DateTime.Now.AddHours(1), DateTime.Now.AddHours(2), DateTime.Now.AddHours(3), DateTime.Now.AddHours(4) }; IList yDataFrom = new int[] { 1, 2, 3, 4, 5 }; IList yDataTo = new int[] { 2, 3, 4, 5, 6 }; data.List.Add(xData); data.List.Add(yDataFrom); data.List.Add(yDataTo); chart1.Data.Clear(); chart1.Data.Series = 1; chart1.Data.Points = 5; chart1.Series[0].Gallery = Gallery.Area; chart1.Series[0].Color = System.Drawing.Color.FromArgb(196, Color.SteelBlue); chart1.AxisX.LabelsFormat.Format = AxisFormat.Time; chart1.DataSourceSettings.Fields.Clear(); chart1.DataSourceSettings.Fields.Add(new FieldMap("Field1", FieldUsage.XValue)); chart1.DataSourceSettings.Fields.Add(new FieldMap("Field2", FieldUsage.FromValue)); chart1.DataSourceSettings.Fields.Add(new FieldMap("Field3", FieldUsage.Value)); chart1.DataSource = data;} This is how the chart looks when the form is first loaded: And this is what we get when we zoom in and scroll to the middle of the chart: We have provided a sample application also. Thanks a lot and best regards, Veki
  7. From my experience, their support sucks. You cannot get any help except from other members, with exception for completely trivial questions. COM version is even less supported, and they haven't released a hotfix for 3 years, with several known and annoying bugs still existing. Ahh.. needed to relieve my soul to someone. What error exactly do you get? You could check the event log for example, or the setup log if it exists.
  8. I am sending a simple Test app, hoping that someone will finally reply. It's a .NET C# app using Cfx Client Server 6.2. public Form1() { InitializeComponent(); this.Load += new EventHandler(Form1_Load); } void UpdateChart() { // clear chart chart.ClearData(ClearDataFlag.ClearDataFlag_AllData); // fill list data provider with some data ListDataProviderClass listProvider = new ListDataProviderClass(); object xAxisData = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; object yAxisData = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; listProvider.AddCollection(ref xAxisData); listProvider.AddCollection(ref yAxisData); // enable data editor chart.DataEditor = true; // bind chart.DataSource = listProvider; // zoom programatically chart.Zoom = true; chart.AxisX.Zoom(2, 8); chart.AxisY.Zoom(2, 8); } void Form1_Load(object sender, EventArgs e) { // call it twice UpdateChart(); UpdateChart(); } Note that I am deliberately calling the code twice, before it gets painted. Our app has an interface where user can select lots of data from a tree-view and in some cases, when chart is updated before it gets time to repaint, then it crashes with an access violation.
  9. I found out that this happens if I try to use Axis.Zoom(min, max) or Axis.SetScrollView(min, max), before Chart starts to actually paint itself. It then crashes on next repaint. If I set the axis zoom after the PostPaint event, it will flicker once before it's zoomed, so is there another way I can set the axis zoom programatically, before the chart is painted?
  10. Update: I have added the PrePaint, GetAxisLabel and PostPaint event handlers to see what gets executed, and I can see that when the exception is thrown, only PrePaint gets fired. In other cases, all three events are fired. The exception happens sometimes when I am switching tab pages in my form, just before the chart is painted.
  11. Dear Sirs, My managed application is using Cfx Client Server 6.2 through COM interop. It sometimes closes with an Access violation error. Managed stacktrace looks like this: Using WinDbg, I have found that the exception happens in ChartFX.ClientServer.Core.dll: Unmanaged stack is shown like this (although it may be incorrect since I don't have debug info): Can you tell me if it's possible to find out which .dll function gets called in that moment( in the COM dll)? This usually happens when switching tabs, so I guess it happens during repaint.I hope that by finding this I could narrow the problem (I am using constant lines, regions,multiple axes+panes, filled area between series, lots of stuff), so I hope that it may at leastbring me closer to the point of fault.
  12. VekiPeki

    UserLegendBox

    You should not overwrite actual Point object with your own, rather just change their properties, i.e. try to change this: redPoint.Color = RGB(255,0,0)...Chart1.Point(0,j) = redPoint to this: redColor = RGB(255,0,0)...Chart1.Point(0,j).Color = redColor (for all lines where you assign colors)
  13. Axis.LabelsFormat.CustomFormat does not support format strings like"HH:mm:ss.fff" (like String.Format method), so is it possible to show second fractions (milliseconds) in x-label in a different way?
  14. It just seemed easier -- you could avoid dealing with annototion x/y coodinates or handling the resize events. You also get mouse hover effects and tool tips without extra programming, and don't need to care about any painting or positioning - just pass the data and forget about it.
  15. Have you considered stacked bars? If Volume property is set to 100, and Stacked is set to Stacked100, they should fill the whole canvas.
  16. Thanks for you reply, we have sent a mail to Software FX Support. We however don't believe it is data related (after all, the sample provided in the first mail is taken from Samples & Resources center / Combinations samples / Line chart with Range Band), because it happens without any exceptions for all data we pass this way. We have also tried passing data using both DataSet and plain Arrays as data sources, and did not find any differences. It looks like it happens whenever the range data is scrolled partially past the border of the canvas.
  17. Should this be reported as a bug, in order to get a hotfix or something (if possible)? Our project should be entering the testing phase soon, and now we found a bug in something we feel is the core functionality of our application. We have several sets of min-max data which must be displayed as semitransparent bands on one or more panes, and the zoom function is a must.
  18. Sorry, I don't have .Net version installed. Try checking the samples in your Samples&Resources center. Basically you only have to open the Properties window for your ChartFX control, and set these two properties: Gallery --> GanttStacked --> Normal
  19. Does this work? (samples & resources center) chart1.Gallery = SoftwareFX.ChartFX.Gallery.Gantt; chart1.Stacked = SoftwareFX.ChartFX.Stacked.Normal;// Populate with random dataSystem.Random r;r=new System.Random ();int i,j;chart1.OpenData(SoftwareFX.ChartFX.COD.Values, 2, 6);for (i=0;i<2;i++) for (j=0;j<6;j++) { chart1.Value[i, j] = r.NextDouble() * 100; chart1.Legend[j] = "Prod " + j.ToString() ; }chart1.CloseData(SoftwareFX.ChartFX.COD.Values);// Visualchart1.Border = true;chart1.BorderEffect = SoftwareFX.ChartFX.BorderEffect.Raised;chart1.Grid = SoftwareFX.ChartFX.ChartGrid.Horz;
  20. You can use chart.GetPointLabel event to return custom point labels on the fly. This event must be enabled first by setting chart.Axis(n).Notify to true. It could degrade performance a bit if you have a large number of points, but if you need to show all the values all the time, it is the only way. If you don't have to show actual values all the time, you can hide them and override chart.GetTip to change the text shown in the tooltip, which does not affect performance.
  21. It should be set up something like this (depending on the version of ChartFx you're using, there might be some differences - following sample is for Client Server COM edition): chart1.Gallery = Cfx62ClientServer.Gallery.Gallery_Bar;chart1.Chart3D = true;chart1.View3D = true;chart1.AngleX = 45;chart1.AngleY = 45;chart1.Cluster = true;chart1.Perspective = 60; This was simply taken from Samples & Resources, and it works as stated. To get those nice transparent colors in COM Client Server edition (I don't know what's the difference with .NET versions), you can mask last byte of your uint32 color to give the level of transparency you want: uint originalColor = (uint)ColorTranslator.ToOle(Color.FromArgb(red, green, blue));chart1.Series[0].Color = (uint)(0x30000000 | originalColor); This is used in Client Server (COM edition) because Color property type is UInt32, not System.Drawing.Color (again, I don't know about .NET). Best regards, Veki
  22. It works ok, thanks! The only thing is I have to cast float to double for entire array, replacing NaNs with chart.Hidden which is of type double. I also expected Hidden to be a static field, but it's actually an instance field (at least in ChartFX Client Server) -- just in case someone has the same problem. Best regards, Veki
  23. Oops! Wrong forum! I am sorry, this was supposed to go to 6.2 Client Server (COM) edition, not .NET. If there is a way to move it, I would be happy. Sorry, Veki
  24. Hi! Is there a way to display something different than "0,-1" in Data editor when there is a float.NaN value in the middle of an array? Thanks, Veki
×
×
  • Create New...