How to avoid overlapping on Label by NAxisCursor


https://www.nevron.com/Forum/Topic14248.aspx
Print Topic | Close Window

By shweta jain - 3 Years Ago
Hello,

I am using NAxisCursor in the chart but it is overlapping on text like below image.
How can set NAxisCursor line in background of Label?
How can I avoid overlapping of line on Label ?

https://www.nevron.com/forum/uploads/images/aad90b68-c9de-4810-bf02-ed53.png
By Nevron Support - 3 Years Ago
Hi Shweta,

How do you create the label that is overlapped by the cursors?
By shweta jain - 3 Years Ago
Hi,
I want to avoid overlapping on label by cursor line.
Is any way to avoid overlapping on text of label by any object?
In chart, I have first added label on point then created cursor using these below lines.
_verticalAxisCursor.BeginEndAxis = (int)StandardAxis.PrimaryY;
    _verticalAxisCursor.ValueSnapper = new NAxisRulerClampSnapper();
    _cartesianChart.Axis(StandardAxis.PrimaryX).Cursors.Add(this._verticalAxisCursor);
    _verticalAxisCursor.SynchronizeOnMouseAction = MouseAction.Move | MouseAction.Hover;
    _verticalAxisCursor.StrokeStyle = new NStrokeStyle((float) crossAxisLineStyle.Width, crossAxisLineStyle.Color.WindowsFormColor());
    _verticalAxisCursor.ValueChanged += new EventHandler(this.OnValueChanged);
    _horizontalAxisCursor.BeginEndAxis = (int)StandardAxis.PrimaryX;
    _horizontalAxisCursor.ValueSnapper = new NAxisRulerClampSnapper();
    _cartesianChart.Axis(StandardAxis.PrimaryY).Cursors.Add(this._horizontalAxisCursor);
    _horizontalAxisCursor.SynchronizeOnMouseAction = MouseAction.Move | MouseAction.Hover;
    _horizontalAxisCursor.StrokeStyle = new NStrokeStyle((float) crossAxisLineStyle.Width, crossAxisLineStyle.Color.WindowsFormColor());
    _horizontalAxisCursor.ValueChanged += new EventHandler(this.OnValueChanged);


By Nevron Support - 3 Years Ago
Hi Shweta,

We did some additional investigation and currently, there is no way to render text above the cursors, because they are rendered in an overlay on top of the other chart elements. We modified the control to support chart cursors so that they can display attached texts and this feature will be available in the 2021 release coming out soon. For the time being, you can work around this issue using custom overlay painting - check out the following example:
All Examples \ Custom Painting \ Painting in Overlay

We hope this helps - let us know if you have any questions.