Home Forums WinForms controls Xceed Chart for WinForms Detecting when elements are not visible

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18801 |

    I have a chart where the user is allowed to add series to the graph on custom axis, a bit like the CustomAxesUC sample. The code I use is very straight forward:

    axis = chart.Axes.AddCustomAxis(Xceed.Chart.Core.AxisOrientation.Vertical,
    Xceed.Chart.Core.AxisPredefinedPosition.FrontLeft);
    chart_control.custom_axes.Add(custom_axis_no, axis);
    axis.PositionOffset = custom_axis_no * (-10);
    series.DisplayOnAxis(Xceed.Chart.Core.StandardAxis.PrimaryY, false);
    series.DisplayOnAxis(axis.AxisId, true);

    However as each custom axis the user adds is offset a little bit further pretty quickly the custom axis gets pushed off edge of the visiable area. Is there an easy way to detect when this has happen and adjust the position of the chart?

    Thanks,
    Rob

    Imported from legacy forums. Posted by Robert (had 2523 views)

    User (Old forums)
    Member
    Post count: 23064

    The only solution we see is to move the chart a bit to the right every time you add an axis. For example, you could add the following line of code in the snippet you provided :

    chart.Margins = new RectangleF( chart.Margins.X + ( float )2.5, chart.Margins.Y, chart.Margins.Width, chart.Margins.Height );

    Imported from legacy forums. Posted by André (had 3259 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.