calculating shape parameters

2 posts, 0 answers
  1. Rajkumar
    Rajkumar avatar
    9 posts
    Member since:
    May 2014

    Posted 14 Jul 2014 Link to this post


    Suppose I have a custom shape based out of EllipseGeometry.

    If I resize the diagram item in the diagram, only the Width and Height are updated. 

    If I need the actual RadiusX and RadiusY of the EllipseGeometry, what needs to be done ?
  2. Martin Ivanov
    Martin Ivanov avatar
    1408 posts

    Posted 15 Jul 2014 Link to this post

    Hello Rajkumar,

    The RadDiagramShapes doesn't listen for changes in the properties of their Geometries. This is why the RadiusX and RadiusY properties of your EllipseGeometry are not updated when you resize the shape.

    In order to update those properties you can subscribe for the SizeChanged event of the shape and modify them based on the shape's width and height in the event handler.
    private void RadDiagramShape_SizeChanged(object sender, SizeChangedEventArgs e)
        RadDiagramShape shape = sender as RadDiagramShape;
        if (shape != null)
            var geometry = shape.Geometry as EllipseGeometry;
            if (geometry != null)
                geometry.RadiusX = shape.ActualWidth / 2;
                geometry.RadiusY = shape.ActualHeight / 2;

    Please let me know if this works for you.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top