Profile Picture

Assign different Anchor-Point to NRectangularCallout

Posted By joern kunze 9 Years Ago
Author
Message
joern kunze
Posted 9 Years Ago
View Quick Profile
Junior Member

Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)

Group: Forum Members
Last Active: 3 Months Ago
Posts: 86, Visits: 221
I use a NRectangularCallout together with a 2d-LineChart (just a couple of X-Y pairs) - the NRectangularCallout configuration:

    m_RectangularCallout.ArrowLength = new NLength(10, NRelativeUnit.ParentPercentage);
      m_RectangularCallout.StrokeStyle.Width = new NLength(1);  //disable Callout border: = 0
      m_RectangularCallout.UseAutomaticSize = true;
      m_RectangularCallout.Orientation = iLabelPos;
      m_RectangularCallout.Text = oLine.m_sLabel;

      _NevronChart.Panels.Add(m_RectangularCallout);

      // Anchor the callout to data point #0
      NDataPointAnchor anchor = new NDataPointAnchor(line, 0, ContentAlignment.MiddleCenter, StringAlignment.Center);
      m_RectangularCallout.Anchor = anchor;

This works as expected. But now I want to change the anchor for the Callout - I tried the following:

1- Approach: Anchor at DataPoint 2
 NDataPointAnchor anchor = new NDataPointAnchor(oNevronLineSeries, 1, ContentAlignment.MiddleCenter, StringAlignment.Center);

           oCallout.RecalcLayout(NevronChart.View.Context);

      oChart.Chart.RecalcLayout(NevronChart.View.Context);
      oChart.Chart.Refresh();


Unfortunatly, nothing happens at all. So how can I change the anchor for the Callout?
 
2. Approach: Using a ScaleAnchor:

           oCallout.Anchor = new NScalePointAnchor(oChart.Chart, 0, 0, 0, AxisValueAnchorMode.Show, new NVector3DD(42348.931761342596, 0.0, 0));

           oCallout.RecalcLayout(NevronChart.View.Context);
        
      oChart.Chart.RecalcLayout(NevronChart.View.Context);
      oChart.Chart.Refresh();

But same as approach 1: Nothing happens at all. So how do I change the anchor to a NScalePointAnchor?

Thanks for the help,
Best regards, Joern




Similar Topics


Reading This Topic