Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

IntensityRangeAnnotation placement issue on the IntensityGraph

Hi,

 

I have a Intensity Graph, with a X/Y ranges of 2047/2047. I have a logic where i draw a rectangle on the graph.

Once I draw the rectangle on the graph, i add a IntensityRangeAnnotation to display a label on the graph. For eg: When I draw 3 rectangles, I name them as Subarray_1, Subarray_2, Subarray_3.

The issue i am facing here is when i draw a rectangle at the edges of the graph, the annotation is getting cut off and the label is not getting displayed properly. I am attaching the image of this. If you see Subarray_1, Subarray_2 are displayed properly and Subarray_3, Subarray_4, Subarray_5 rectangles annotation labels are getting cut off. Is there any way i can get the annotation to point downwards, as below?

 

But I can’t get the annotation to point downwards like:

                                                                                                \

                                                                                                  \

                                                                                                    \

                                                                                                      V

                                                                                                         Subarray_4

 

Below is the code, which i have been trying without success.

                    if (endY > 1800)

                    {

                        intensityRangeAnnotation.ArrowHeadAlignment = BoundsAlignment.TopLeft;

                        intensityRangeAnnotation.ArrowTailAlignment = BoundsAlignment.TopLeft;

                        Size size = new System.Drawing.Size(5,5);

                        intensityRangeAnnotation.ArrowTailSize = size;                       

                    } 

                    if (endX > 1800)

                    {

                        intensityRangeAnnotation.ArrowHeadAlignment = BoundsAlignment.TopLeft;

                        intensityRangeAnnotation.ArrowTailAlignment = BoundsAlignment.TopLeft;

                    }

                    intensityGraph1.Annotations.Add(intensityRangeAnnotation);

                }

0 Kudos
Message 1 of 4
(2,835 Views)

The WPF range annotation only includes options for an arrow head shape, not an arrow tail shape, so there is no built-in way to configure the arrow to point to the label.

 

The label itself can be positioned anywhere in the plot area using the LabelAlignment property. If you want to keep the label near the annotation, you can use an Alignment of None, and set the XOffset and YOffset screen values to shift the label. For a label near the right edge of the plot area, you would want a negative XOffset to keep it on screen: LabelAlignment="None: -25, -25".

~ Paul H
0 Kudos
Message 2 of 4
(2,815 Views)

Thanks Paul. Does this hold good for Winforms as well?

0 Kudos
Message 3 of 4
(2,811 Views)

In Windows Forms, the equivalent label positioning property is called CaptionAlignment. And you can use the ArrowTailStyle property to add a shape at the label-end of the arrow line.

~ Paul H
0 Kudos
Message 4 of 4
(2,806 Views)