How to show length of rectangle in the chart


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

By shweta jain - 5 Years Ago
Hi,
I want to show length of rectangle as I design in attached snapshot by pen. How can I show length of rectangle like attached snapshot?
For creating rectangle I have used this code -
https://www.nevron.com/forum/uploads/images/1be0218a-d264-4ede-a576-d3f7.png
NGraphicsPathSeries pathSeries = new NGraphicsPathSeries();
    NGraphicsPath rectangle = new NGraphicsPath();
    rectangle.AddRectangle(xLocation, yLocation, 10, diameter);
    pathSeries.GraphicsPath = rectangle;
    _cartesianChart.Series.Add(pathSeries);
    pathSeries.DisplayOnAxis(StandardAxis.PrimaryY, true);
    pathSeries.DisplayOnAxis(StandardAxis.PrimaryX, false);
    pathSeries.DisplayOnAxis(visibleXAxis.AxisId, true);
By Nevron Support - 5 Years Ago
Hi Shweta,

Currently there is no way to achieve this with the built-in chart functionality, but you can implement this annotation using custom painting - for an example please check out:
All Examples \ Custom Painting examples.
Those examples show how you can use code to draw custom shapes / lines on the chart as well as how to convert between model and view coordinate spaces.


By shweta jain - 5 Years Ago
can u please provide link where i can find Custom painting examples.
By Nevron Support - 4 Years Ago
Hi Shweta,
Open the WinForms examples shipped with the control and navigate to:
All Examples \ Custom Painting

Let us know if you cannot locate it...