Customising various aspects of the Org Chart


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

By Kevin Harrison - 8 Years Ago
Hi

I've been trying various methods which seem to have no effect, so please could you tell me how to change the following on the default Org Chart example:
1) Change the shapes from rectangles.
Changing Table in the line treeImporter.VertexShapesName = BasicShapes.Table.ToString(); results in nothing being drawn.
2) Remove the borders on the shapes, and/or change the border colours
3) Add arrowheads to the connecting lines.
4) How do I set a tooltip for each shape?
Thanks
Kevin
By Nevron Support - 8 Years Ago
Hi Kevin,

Regarding your questions about the Org Chart example:

1) This example requires using table shapes, because it shows an image and a text for each shape arranged in a tabular manner.

2) You can customize the style sheets used for the 2D shapes of the example by modifying the CreateStyleSheets method. More information about styles and style sheets is available in the documentation.

3) To customize the look of the connectors, you can create a style sheet for them and assign its name to the tree importer like this:

// Create style sheets for the edges
NStyleSheet edgeStyleSheet = new NStyleSheet("Edges");
NStyle.SetEndArrowheadStyle(edgeStyleSheet, new NArrowheadStyle(ArrowheadShape.Arrow, null,
    new NSizeL(6, 6), new NColorFillStyle(Color.White), new NStrokeStyle(Color.Black)));
document.StyleSheets.AddChild(edgeStyleSheet);

// Assign the style sheet name to the tree importer
treeImporter.EdgeStyleSheetName = edgeStyleSheet.Name;


4) You can assign a tooltip to each imported 2D shape in the event handler of the VertexImported event of the tree importer by assigning an interactivity style to the shape:

NStyle.SetInteractivityStyle(shape, new NInteractivityStyle("My Tooltip"));