We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Syncfusions basic shapes show up as invisible in SfDiagram

Hello, I'm not sure if this is a bug or if I'm doing something wrong.

Basically I am creating nodes from a data source, and depending on certain properties I would like for the nodes to have different shapes.

Here's the snippet of code I'm focusing on:

if (bool)
{
     Node.UnitWidth = 150;
     Node.UnitHeight = 50;
     Node.Shape = Resources["Ellipse"];
     Node.ShapeStyle = Resources["ShapeStyle"] as Style;
}

if I change "Resources["Ellipse"];" to "new EllipseGeometry(new Rect(new Size(150, 50)));" then it appears correctly, otherwise it is invisible,
I would like to use other basic shapes other than Ellipse, so for them I don't really have a work around, any help is appreciated, thanks.

1 Reply

RT Ramya Thirugnanam Syncfusion Team May 1, 2019 05:32 PM UTC

Hi Jerod, 
 
Thanks for contacting Syncfusion support. 
 
Please set the “Stretch” as “Fill” for ShapeStyle as given below to show the Node with “Ellipse” Shape. 
 
 
 Code example: 
  <Style TargetType="Path" x:Key="ShapeStyle"> 
                <Setter Property="Fill" Value="DarkCyan"></Setter> 
                <Setter Property="Stroke" Value="Black"/> 
                <Setter Property="StrokeThickness" Value="2"></Setter> 
                <Setter Property="Stretch" Value="Fill"></Setter> 
            </Style> 
 
Regards, 
Ramya T 


Loader.
Live Chat Icon For mobile
Up arrow icon