Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
385
Adding multiple box primitives
posted

Hi,

Is it possible to add multiple Box primitives dynamically using the mouse events and fillsceneGraph event. Also, on mouse hover or click can I get the bounds of the selected box primitive.

Regards,

Uday 

 

  • 17605
    posted

    For your case you can add BoxAnnotations. For example:

    private void ultraChart1_MouseClick(object sender, MouseEventArgs e)

    {

    BoxAnnotation annotation = new BoxAnnotation();annotation.Text = "Annotation";

    annotation.Width = 50;

    annotation.Height = 50;

    annotation.FillColor =
    Color.Blue;annotation.Location.Type = Infragistics.UltraChart.Shared.Styles.LocationType.Pixels;

    annotation.Location.LocationX = e.X;

    annotation.Location.LocationY = e.Y;

    this.ultraChart1.Annotations.Add(annotation);

    }

    Also you can look at  WinForms Chart samples - Chart Interaction - Dragging Annotation sample.