# Syncfusion

## Documentation

# How to Visualize the Hidden Series When Two Fields Have the Same Data

##### How to Visualize Hidden Series in a Chart Widget with Overlapping Data Points
When two series in a chart widget have the same data points, one series may be rendered behind the other, making it difficult to visualize the hidden series. This article will guide you in visualizing the hidden series when two series have the same data.

##### Steps to Visualize Hidden Series
1. Identify the overlapping series in the chart widget.
2. Change the chart type control to visualize the hidden series better.
3. Consider using different chart types for each series to differentiate them.
4. Use the Legend toggle to display the data points for each series.

###### Changing other Chart Type control
Change the chart type to visualize the hidden series better. For example, use a stacked column chart or a 100% stacked column chart to display the overlapping data points in separate columns.
![image.png](https://support.syncfusion.com/kb/attachment/article/966/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ5MzMiLCJvcmdpZCI6IjMiLCJpc3MiOiJzdXBwb3J0LnN5bmNmdXNpb24uY29tIn0.NICiBziTCFP17ZIUMVmFgJXn9mhwIJE0KFT179pkb5k)

###### Using Different Chart Types for Each Series
Another option is to use different chart types for each series. For example, use a line chart for one series and a column chart for the other. This will help differentiate the two series and make it easier to visualize the hidden series.
![image.png](https://support.syncfusion.com/kb/attachment/article/966/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ5MzQiLCJvcmdpZCI6IjMiLCJpc3MiOiJzdXBwb3J0LnN5bmNmdXNpb24uY29tIn0.NiCAXXckdd4nDptS7sF-jisIBCPvE_nHaaYivy7TU4w)

###### Using Legend Toggle
The legend can be used to display the data points for each series. When you click on the legend, the series will be hidden from the chart control. If you want to enable the series, again click on the disabled legend.
![image.png](https://support.syncfusion.com/kb/attachment/article/966/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ5MzUiLCJvcmdpZCI6IjMiLCJpc3MiOiJzdXBwb3J0LnN5bmNmdXNpb24uY29tIn0.3TU-yC2-pirnFKoryxA2baJkjp36tJs9G2wI8Rqq6Ns)

##### Conclusion
Visualizing hidden series in a chart widget with overlapping data points can be challenging. By adjusting the chart type or settings, using different chart types for each series, and utilizing legend, visualize the hidden series better and make your data more accessible.

##### Additional References
- [BoldBI Chart Widget Documentation](https://help.boldbi.com/embedded-bi/working-with-widgets/chart-widget/)


# How to implement drill down effect in WinForms Chart?

Drill-down functionality in charts allows users to interact with a data point and view more detailed information related to that point. In [Syncfusion WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "https://www.syncfusion.com/winforms-ui-controls/chart"), this can be achieved by handling the [ChartRegionClick](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ChartRegionClick "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ChartRegionClick") event, identifying the clicked data point, and dynamically updating the chart with a new series that presents detailed data.

**Steps to implement the drill down effect in** **WinForms Chart:**

1. Create an initial chart series of any chart type (e.g., Column, Line)
2. Handle the [ChartRegionClick](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ChartRegionClick "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ChartRegionClick") event to detect which data point was clicked.

    chartControl1.ChartRegionClick += ChartControl1_ChartRegionClick;

3. Retrieve the [PointIndex](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartRegion.html#Syncfusion_Windows_Forms_Chart_ChartRegion_PointIndex "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartRegion.html#Syncfusion_Windows_Forms_Chart_ChartRegion_PointIndex") from the event arguments to identify the selected data point.

    private void chartControl1_ChartRegionClick(object sender, Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs e)
    {
        if (e.Region.IsChartPoint)
        {
            if (!isDrilledDown)
            {
                InitializeDrillDownChart(e.Region.PointIndex);
            }
            else
            {
                InitializeChart();
            }
    
            isDrilledDown = !isDrilledDown;
        }
    
        this.chartControl1.Refresh();
    }

4. Generate a new chart series (can be of a different chart type) based on the selected point.

    private void InitializeDrillDownChart(int index)
    {
        ChartSeries series1 = new ChartSeries("Market Breakdown");
    
        // ...
        // ...
    
        int count = this.chartControl1.Series[0].Points[index].YValues.Length - 1;
        for (int i = 0; i < count; i++)
        {
            series1.Points.Add(i, this.chartControl1.Series[0].Points[index].YValues[i + 1]);
            series1.Styles[i].Text = labelArray[i] + " - " + this.chartControl1.Series[0].Points[index].YValues[i + 1].ToString() + " %";
        }
    
       // ...
       // ...
    
        series1.Type = ChartSeriesType.Pie;
    }

5. Update the chart control with the new series and labels to reflect the drill-down data:

    private void InitializeDrillDownChart(int index)
    {
        // ...
        // ...
        this.chartControl1.Series.Clear();
        this.chartControl1.Series.Add(series1);
    }

**Output:**

**![Drill down effect in WinForms Chart](https://support.syncfusion.com/kb/attachment/article/1017/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUyMjY4Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.yZAJe5DiJRmrTYcVIq5HOX63KIeLNH_CNOwIbAiiLZA)**

For more details, please refer to the project on [GitHub sample.](https://github.com/SyncfusionExamples/How-to-Implement-Drill-Down-Effect-in-WinForms-Chart "https://github.com/SyncfusionExamples/How-to-Implement-Drill-Down-Effect-in-WinForms-Chart")

**Conclusion**

I hope you enjoyed learning about how to implement drill down effect in WinForms Chart.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to implement Multiple Axes in WinForms Chart?

In [Winforms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "https://www.syncfusion.com/winforms-ui-controls/chart"), multiple Axes can be implemented by creating new axis and adding it to the chartcontrol. This is done by using ChartAxis class. You can also set the range for newly created axis and position the new axis opposite to that of the regular axis. Finally you can load the series into the new axis.

    private ChartAxis secXAxis = new ChartAxis();
    this.chartControl1.Axes.Add(this.secXAxis);
    this.chartControl1.Indexed=false;
    this.secXAxis.Range = new MinMaxInfo(0, 10, 1);
    this.secXAxis.OpposedPosition = true;
    this.chartControl1.Series[0].XAxis = this.secXAxis;

Private secXAxis As ChartAxis = New ChartAxis()
    Me.chartControl1.Axes.Add(Me.secXAxis)
    Me.chartControl1.Indexed=False
    Me.secXAxis.Range = New MinMaxInfo(0, 10, 1)
    Me.secXAxis.OpposedPosition = True
    Me.chartControl1.Series(0).XAxis = Me.secXAxis
**Conclusion**

I hope you enjoyed learning about how to implement
Multiple Axes in WinForms Chart.

You can refer to our [WinForms
Charts feature tour](https://www.syncfusion.com/winforms-ui-controls/chart) page to know
about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how
to quickly get started for configuration specifications. You can also
explore our [WinForms Charts example](https://github.com/syncfusion/winforms-demos/tree/master/chart)to understand how to create and manipulate
data.

For current customers, you can check
out our components from the [License and Downloads](https://www.syncfusion.com/sales/pricing) page. If you are new to Syncfusion, you can try
our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to
check out our other controls.

If you have any queries or require
clarifications, please let us know in the comments section below. You can
also contact us through our [support forums](https://www.syncfusion.com/forums/windowsforms?control=chart), [Direct-Trac](https://support.syncfusion.com/create),
or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always
happy to assist you!

# How to customize axis labels using ChartFormatAxisLabel event in WinForms Chart?

The [ChartFormatAxisLabel](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartFormatAxisLabelEventArgs.html "ChartFormatAxisLabel") event can be used to customize labels for any axis within Syncfusion® [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts"). The following code snippet demonstrates how to append **"XX"** to all labels on the X-axis.

    this.chartControl1.ChartFormatAxisLabel += new ChartFormatAxisLabelEventHandler(this.chartControl1_ChartFormatAxisLabelEventHandler);
    private void chartControl1_ChartFormatAxisLabelEventHandler(object sender, ChartFormatAxisLabelEventArgs args)
    {
        if (args.IsAxisPrimary && args.AxisOrientation == ChartOrientation.Horizontal)
        {
            args.Label = args.Value.ToString() + "XX";
            args.Handled = true;
        }
    }

    AddHandler Me.chartControl1.ChartFormatAxisLabel, AddressOf Me.chartControl1_ChartFormatAxisLabelEventHandler
    Private Sub chartControl1_ChartFormatAxisLabelEventHandler(sender As Object, args As ChartFormatAxisLabelEventArgs)
        If args.IsAxisPrimary AndAlso args.AxisOrientation = Orientation.Horizontal Then
            args.Label = args.Value.ToString() + "XX"
            args.Handled = True
        End If
    End

**Output:**

![customize axis labels](https://support.syncfusion.com/kb/attachment/article/1019/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0ODAxIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.xo8pgnOGztZkboLGbcfIRQ2g3E3sKa1-G55ylV7XGiU)

**Conclusion**

I hope you enjoyed learning about how to customize axis labels using [**ChartFormatAxisLabel**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartFormatAxisLabelEventArgs.html "ChartFormatAxisLabel") event in [**WinForms Chart**](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to implement VS.NET like content dividers support for VB.NET like code in WinForms SyntaxEditor (EditControl)?

## Content dividers

The SyntaxEditor (EditControl) supports content dividers just like VB.NET code in Visual Studio.NET. This feature can be enabled simply by setting [ShowContentDivider](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Edit.EditControl.html#Syncfusion_Windows_Forms_Edit_EditControl_ShowContentDividers) field to true within its lexem definition in the configuration file.

Reference link: [https://help.syncfusion.com/windowsforms/syntaxeditor/text-visualization#content-dividers](https://help.syncfusion.com/windowsforms/syntaxeditor/text-visualization#content-dividers)

# How to zoom a chart at run-time?

You can zoom the chart at run-time by using the built-in context menu of the chart. Right-click the chart. In the context menu, select Zooming. A Zooming control kit will be displayed at the top-left corner of the chart. Make sure that the bool property IsContextMenuEnabled is set to true.

The zooming control kit has the following 4 buttons with unique functionalities:

- Zoom Close
- Zoom In
- Zoom Out
- Zoom Reset

Using these buttons, the chart can be zoomed in and out as needed.

# How to control the number of connections that can be drawn from/to the port?

## How to control the number of connections that can be drawn from/to the port?

This can be done by using the port''s ConnectionsLimit property value. By default 10 connections can be drawn to/from a port of a node.

[Syncfusion® Inc.](https://www.syncfusion.com/)

# How to zoom a chart programmatically?

You can zoom the chart programmatically using the ZoomFactor property of ChartAxis class. The function mulzoomcenter also can be used to zoom the chart by passing the zoomfactor value as parameter.

The following code is the example for zooming a chart using mulzoomcenter function.

**C#**

    // To zoom in
    
    Chart1.Areas[0].Axes[0].MulZoomCenter(0.5);
    
    Chart1.Areas[0].Axes[1].MulZoomCenter(0.5);
    
    //To Zoom out
    
    Chart1.Areas[0].Axes[0].MulZoomCenter(2);
    
    Chart1.Areas[0].Axes[1].MulZoomCenter(2);

# Overview of the Diagram in WinForms

Essential® Diagram is a native .NET UI library for creating interactive diagramming applications on Windows Forms and ASP.NET WebForms. Essential® Diagram can be used with any .NET language including C#, VB.NET, and managed C++. Essential® Diagram is designed for ease of use, flexibility, and high performance. It can be used to create a wide range of applications. Listed below are examples of applications that can be built using the Essential® Diagram:

• Flowcharts

• Workflow models

• Telecommunications network visualization

• Software engineering

• Architectural, engineering, and construction

• Commercial interior design

• Data visualization

• Simulation

• Electrical circuit and computer chip design

# The Diagram.ChildrenChangeComplete event does not let me access the FromNode and ToNode for a new link. Why?

## The Diagram.ChildrenChangeComplete event does not let me access the FromNode and ToNode for a new link. Why?

When the ChildrenChangeComplete event is generated, the newly added link nodes will not have their From and To connections established. Use the Diagram.Model.ConnectionsChanging and Model.ConnectionsChangeComplete events to intercept or obtain information about the state of any newly added/removed links.

# How can I implement drag-and-drop from other controls onto the Diagram?

## How can I implement drag-and-drop from other controls onto the Diagram?

The sample included in this KnowledgeBase demonstrates how you can implement drag and drop support in an Essential® Diagram application.

- An image from a Windows Forms PictureBox control can be dragged and dropped onto the Diagram. A node of type BitmapNode is created.
- A node from the Essential® Tools TreeViewAdv control can be dragged and dropped onto the Diagram. A node of type TextNode is created.
Note:
This sample uses the TreeViewAdv control from Essential® tools.

C#

private void diagram1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
      {
       //Allow Drop Cursor only if it is a Diagram Node or a Bitmap
       if ( (e.Data.GetDataPresent(typeof(NodeCollection))) | (e.Data.GetDataPresent(DataFormats.Bitmap))|(e.Data.GetDataPresent(typeof(TreeNodeAdv))))
       {
        e.Effect = DragDropEffects.All;
       }
       else
        e.Effect = DragDropEffects.None;
      }
       private void diagram1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
      {
       Point pt = this.diagram1.PointToClient(new Point(e.X, e.Y));
       //if this is a bitmap then insert a BitmapNode in Diagram
       if (e.Data.GetDataPresent(DataFormats.Bitmap))
       {
        BitmapNode bmpnode = new BitmapNode((Bitmap)e.Data.GetData(DataFormats.Bitmap));
        InsertNodesCmd insCmd = new InsertNodesCmd( this.diagram1.Model, bmpnode, this.diagram1.View.DeviceToView( pt ) );
    diagram1.Controller.ExecuteCommand(insCmd);
       }
       else if(e.Data.GetDataPresent(typeof(TreeNodeAdv)))
       {
        TreeNodeAdv treenode = (TreeNodeAdv) e.Data.GetData(typeof(TreeNodeAdv));
        TextNode textnode = new TextNode();
        textnode.Text = treenode.Text;
        textnode.SizeToText(new SizeF(0,0));
        textnode.Location = this.diagram1.View.DeviceToView( pt );
    this.diagram1.Model.AppendChild(textnode);
        this.diagram1.Refresh();
       }
      }

VB

Private Sub diagram1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles diagram1.DragEnter
    'Allow Drop Cursor only if it is a Diagram Node or a Bitmap
    If e.Data.GetDataPresent(GetType(NodeCollection)) Or e.Data.GetDataPresent(DataFormats.Bitmap) Or e.Data.GetDataPresent(GetType(TreeNodeAdv)) Then
    e.Effect = DragDropEffects.All
    Else
    e.Effect = DragDropEffects.None
    End If
    End Sub 'diagram1_DragEnter
    Private Sub diagram1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles diagram1.DragDrop
    Dim pt As Point = Me.diagram1.PointToClient(New Point(e.X, e.Y))
    'if this is a bitmap then insert a BitmapNode in Diagram
    If e.Data.GetDataPresent(DataFormats.Bitmap) Then
    Dim bmpnode As BitmapNode = New BitmapNode(CType(e.Data.GetData(DataFormats.Bitmap), Bitmap))
    Dim insCmd As InsertNodesCmd = New InsertNodesCmd(Me.diagram1.Model, bmpnode, Me.diagram1.View.DeviceToView(pt))
    diagram1.Controller.ExecuteCommand(insCmd)
    ElseIf e.Data.GetDataPresent(GetType(TreeNodeAdv)) Then
    Dim treenode As TreeNodeAdv = CType(e.Data.GetData(GetType(TreeNodeAdv)), TreeNodeAdv)
    Dim textnode As TextNode = New TextNode
    textnode.Text = treenode.Text
    textnode.SizeToText(New SizeF(0, 0))
    textnode.Location = Me.diagram1.View.DeviceToView(pt)
    Me.diagram1.Model.AppendChild(textnode)
    Me.diagram1.Refresh()
    End If
    End Sub 'diagram1_DragDrop

**Conclusion**

I hope you enjoyed learning about how you can implement drag-and-drop from other controls onto the Diagram.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# Will WinForms Diagram allow end users to create custom shapes and group them into libraries?

The WinForms Diagram SymbolDesigner makes it very simple to create custom symbols and group them into diagram palettes that may be imported and used by diagramming applications. The SymbolDesigner utility (found under the '..Diagram.Windows\Symbol Designer folder) is an integrated design environment that allows users to design symbols and save them as Essential® Diagram symbol palettes (\*.edp files). The palette files can then be imported by any application that uses Essential® Diagram and allows the consuming application to create diagram symbols from the symbol models in the palette.

You can view this approach by first designing a few symbols using the SymbolDesigner utility and then importing them into the '..Diagram.Windows\...Samples\InDepth\DiagramBuilder' sample through the sample's 'File\AddPalette' menu command. The sample displays the imported symbols using a palette-like GroupView control, from which they may be dragged and dropped onto the diagram. The 'SymbolDesigner' utility ships with full source code, and you can customize it as required to provide your users with a more tailored design experience.

It is also possible to define symbols programmatically as demonstrated in the '..\Samples\QuickStart\DynamicSymbol', '..\Samples\InDepth\OrgLayout', '..\Samples\InDepth\Expander' and several other samples that ship with the product.

# How can diagram shapes be grouped together in WinForms Diagram?

## Can diagram shapes be grouped together to form complex shapes? Can I create a library of such shapes?

Essential® **[WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram "https://www.syncfusion.com/winforms-ui-controls/diagram")** Symbols, the building blocks of a diagram, are essentially composite nodes that are created by combining one or more shapes, labels, and ports.

Please refer to the following link for additional information on symbol libraries:

**Conclusion**

I hope you enjoyed learning about how diagram shapes can be grouped together to form complex shapes and how you can create a library of such shapes.

You
can refer to our[WinForms
Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its
other groundbreaking feature representations. You can also explore our [documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started) to
understand how to create and manipulate data.

For
current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you
are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other
controls.

If
you have any queries or require clarifications, please let us know in the
comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are
always happy to assist you!
http://www.syncfusion.com/Support/article.aspx?id=10574

# How do I customize the behavior of a user interface tool?

## How do I customize the behavior of a user interface tool?

User interface tools may be customized by either subclassing and overriding the behavior of a base tool, or by implementing a new Tool type that derives from the Syncfusion.Windows.Forms.Diagram.Tool base class, and is modeled after an existing Tool type.

The following code shows the outline of a new symbol insert tool that is modeled after the standard Syncfusion.Windows.Forms.Diagram.SymbolInsertTool. The custom insert tool differs from the base tool by displaying a message box instead of the BoundaryConstraintsException when the insertion point violates the boundary, and lets you re-insert the symbol at a new location.

C#

/// Custom InsertSymbolTool that displays a message when the symbol insertion point violates the
    /// diagram's boundary constraints.
    public class MyInsertSymbolTool : Tool, IMouseEventReceiver
    {
    public MyInsertSymbolTool() : base("MyInsertSymbolTool")
    {
    }
    public MyInsertSymbolTool(string name) : base(name)
    {
    }
    public MyInsertSymbolTool(string name, System.Type symbolType) : base(name)
    {
    this.symbolType = symbolType;
    }
    /// Called when the tool is activated.
    protected override void OnActivate()
    {
    ...
    }
    /// Called when the tool is deactivated.
    protected override void OnDeactivate()
    {
    ...
    }
    /// Called when a mouse down event occurs.
    void IMouseEventReceiver.MouseDown(System.Windows.Forms.MouseEventArgs e)
    {
    ...
    }
    /// Called when a mouse move event occurs.
    void IMouseEventReceiver.MouseMove(System.Windows.Forms.MouseEventArgs e)
    {
    ...
    }
    /// Called when a mouse up event occurs.
    void IMouseEventReceiver.MouseUp(System.Windows.Forms.MouseEventArgs e)
    {
    ...
    }
    }
To replace an existing Tool with the new Tool type, you will have to first use the Syncfusion.Windows.Forms.Diagram.Controller.UnRegisterTool(Tool tool) method to unregister the previously registered default Tool, and then use the Controller.RegisterTool(...) method to register your newly defined Tool.

C#

// Check whether the standard InsertSymbolTool is registered with the Controller, and
    // unregister the tool it if present.
    Tool[] regtools = this.diagramComponent.Controller.GetAllTools();
    foreach(Tool regtool in regtools)
    {
    if(regtool.Name == "InsertSymbolTool")
    {
    this.diagramComponent.Controller.UnRegisterTool(regtool);
    break;
    }
    }
    // Register the custom insert symbol tool
    this.diagramComponent.Controller.RegisterTool(new MyInsertSymbolTool());

VB

' Check whether the standard InsertSymbolTool is registered with the Controller, and
    ' unregister it if present.
    Dim regtools() As Tool = Me.diagramComponent.Controller.GetAllTools()
    Dim regtool As Tool
    For Each regtool In regtools
    If regtool.Name = "InsertSymbolTool" Then
    Me.diagramComponent.Controller.UnRegisterTool(regtool)
    End If
    Next
    ' Register the custom insert symbol tool
    Me.diagramComponent.Controller.RegisterTool(New MyInsertSymbolTool)
The attached file contains the full C# and VB source code for the MyInsertSymbolTool class. The definitions for the standard tools that ship with Essential® Diagram can be found under the 'Essential Studio\...\Base\Diagram.Base\Src\Tools\' folder. Referring to these classes will give a better idea on to how to go about implementing your custom tools.

**Conclusion**

I hope you enjoyed learning about how to customize the behavior of a user interface tool.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# Does WinForms Diagram support snapping and gluing shapes together?

Yes, disparate diagram entities (shapes, text nodes, etc.) can be grouped together to act as a composite whole. Grouped objects will function as a single diagram node and can be moved around, selected, cut, copied or pasted like you would any other node on the diagram. Grouping and ungrouping are affected through the Diagram.Group and Diagram.UnGroup commands or using the Group and UnGroup interactive tools.

# How to perform database binding in the WinForms Diagram?

Our WinForms Diagram has no pre-built support for binding diagram nodes to a database. Any binding layer that is required will have to be implemented at the application level using custom symbols and leveraging the diagram's support for the dynamic configuration of the diagram model.

The OrgLayout sample that ships with Essential® Diagram shows the creation of an organizational structure diagram based on employee information sourced from a Microsoft Access database using an ADO.NET DataReader. An alternate approach using an XML Document for accessing XML-formatted data is also demonstrated.

# Can I set an image as the background for the Diagram Web Control?

## Can I set an image as the background for the Diagram Web Control?

Yes, it is possible to set an image as the background for the DiagramWebControl. The DiagramWebControl shares its architecture with the Windows Forms version of the product, and most of the functionality available in the Windows version of Essential Diagram is available in the Web Control as well.

The following code shows how to set a background image for the Diagram Web Control,

**C#**

    private void Page_Load(object sender, System.EventArgs e)
    {
        if(this.IsPostBack == false)
        {
            // To Set a background image for the DiagramWebControl...
            // First create a Bitmap object for the background image
            string path = Server.MapPath("/syncfusion/");
            path = path + @"\Web\Diagram.Web\Samples\ScriptyClient\CS\bin\suiteimage.jpg";
            System.Drawing.Bitmap background = new Bitmap(path);
            // Now assign the image to the diagram model's BackgroundStyle property
            this.DiagramWebControl1.Model.BackgroundStyle.Type = BackgroundStyle.BackgroundType.Texture;
            this.DiagramWebControl1.Model.BackgroundStyle.TextureWrapMode = System.Drawing.Drawing2D.WrapMode.Tile;
            this.DiagramWebControl1.Model.BackgroundStyle.Texture = background;
         }
    }

**VB**

    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
    If Me.IsPostBack = False Then
    
    ' Create a Bitmap object for the background image
    
    Dim path As String = Server.MapPath("/syncfusion/")
    
    path = path + "\Web\Diagram.Web\Samples\ScriptyClient\CS\bin\suiteimage.jpg"
    
    Dim background As System.Drawing.Bitmap = New Bitmap(path)
    
    ' Assign the image to the diagram model's BackgroundStyle property
    
    Me.DiagramWebControl1.Model.BackgroundStyle.Type = BackgroundStyle.BackgroundType.Texture
    
    Me.DiagramWebControl1.Model.BackgroundStyle.TextureWrapMode = System.Drawing.Drawing2D.WrapMode.Tile
    
    Me.DiagramWebControl1.Model.BackgroundStyle.Texture = background
    
    End If
    
    End Sub

# Can event handlers be assigned to certain types of diagram objects to respond to drag/drop or mouse events?

## Can event handlers be assigned to certain types of diagram objects to respond to drag/drop or mouse events?

Yes, it is possible to intercept and handle any of the events that act on a diagram node. Essential® Diagram's Model-View-Controller (MVC) architecture, wherein all user-actions are routed through the controller, makes it very easy for applications to hook into the event flow pathways and tailor it as required.

# Is there support for animated shapes?

## Is there support for animated shapes?

There is no built in support for animated objects in Essential Diagram. This will have to be done programmatically using custom shapes and/or by manipulation of the diagram content at run-time. A simple animated shape is demonstrated in the DynamicSymbol sample that ships with the product, wherein a symbol changes colors depending on the mouse hover. Essential Diagram also supports the addition of VSA compliant scripts written in C#, VB.NET, or JavaScript to a diagram. This feature can be leveraged as well to add cursory animation in a diagram.

# How do I add a better looking icon for my symbols in WinForms Diagram?

## How do I add a better-looking icon for my symbols?

The Essential® [WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram "https://www.syncfusion.com/winforms-ui-controls/diagram")Symbol Designer allows you to add small (16x16) and large (32x32) icons to symbol models. When you are not in the Symbol Designer and you select the symbol icon in the Symbol Palette window, the properties of the symbol model are shown in the Properties window.

There you'll see the SmallIcon and LargeIcon properties. You can click on those properties, browse to the file system, and select a graphic to use as the icon for the symbol. When the symbol is displayed in the Symbol Palette control, the icon used will be the one you selected.

**Conclusion**

I
hope you enjoyed learning about how to add a better-looking icon for my symbols in WinForms Diagram.

You
can refer to our [WinForms Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its
other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started
for configuration specifications. You can also explore our [WinForms Diagram example](https://github.com/syncfusion/winforms-demos/tree/master/diagram)to understand
how to create and manipulate data.

For
current customers, you can check out our components from the [License and
Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try
our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to
check out our other controls.

If
you have any queries or require clarifications, please let us know in the
comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create),
or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to extend the Link types present in the Diagram in WinForms?

To create a new Link class or to customize the drawing for an existing link type, implement a subclass of Syncfusion.Windows.Forms.Diagram.Link class with an appropriate override of the Link.CreateLinkShape(Link.Shapes shapeType, PointF[] pts) method. The CreateLinkShape method is called by the Link constructor and it is up to your override to suitably interpret the method parameters and return a valid implementation of the Syncfusion.Windows.Forms.Diagram.IPoints interface. A sample override is shown below:

**C#**

// A subclass of the Syncfusion.Windows.Forms.Diagram.Link class
    public class CustomLink : Syncfusion.Windows.Forms.Diagram.Link
    {
        // Override the Link.CreateLinkShape method to create a link for the specified type
        // and with the given points
        protected override IPoints CreateLinkShape(Link.Shapes shapeType, PointF[] pts)
        {
            Shape linkShape = null;
            if (shapeType == Link.Shapes.OrthogonalLine)
            {
                OrthogonalLine orthogonalLine = new OrthogonalLine();
                orthogonalLine.AutomaticHeadings = true;
                linkShape = orthogonalLine;
            }
            if (linkShape != null)
            {
                linkShape.SetPoints(pts);
            }
            return linkShape;
        }
    }

Now all that is required to use this Link type is to provide to the LinkTool a LinkFactory delegate that instantiates this newly defined Link type when the tool is activated. A sample implementation is shown below:

**C#**

// Create a Link tool for the custom link type
    LinkTool customLinkTool = new LinkTool("CustomLinkTool");
    customLinkTool.LinkFactory = new LinkFactory(this.CreateCustomLink);
    // Register this tool with the Diagram Controller
    this.diagram.Controller.RegisterTool(customLinkTool);
    // LinkFactory delegate for instantiating the CustomLink
    protected Link CreateCustomLink(PointF[] pts)
    {
        CustomLink mylink = new CustomLink(Link.Shapes.OrthogonalLine, pts);
        return mylink;
    }
**Conclusion**

I hope you enjoyed learning about how to extend the Link types present in the Diagram in WinForms.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# What is the difference between a symbol and a SymbolModel?

## What is the difference between a symbol and a SymbolModel?

A symbol is a node in a diagram that has child nodes and that can have ports and labels. Symbols are what the end-user typically manipulates on a diagram. A SymbolModel is an object that contains design-time information describing a type of symbol. The Symbol Designer utility creates and edits symbol models, which it stores in a SymbolPalette. SymbolModels can also be created programatically.

A SymbolPalette is a collection of SymbolModel objects. The SymbolModel class has a CreateInstance() method for creating symbols based on the model.

The PaletteGroupView control displays a list of the SymbolModel objects in a given SymbolPalette. Each time you start dragging an entry from the list in a PaletteGroupView, SymbolModel.CreateInstance() is called to create an instance of the symbol.

# How do I create a connection programmatically?

**How do I create a connection programmatically?**

Typically, symbols and links are connected together using the interactive LinkTool UI tool or the LinkCmd command class. Sometimes it is useful to create connections programmatically. For example, you might be generating a diagram from data in a database or possibly even writing your own custom link tool. You might even create a connection between two symbols directly without having a link in between.

The following code creates a link and connects it to the center ports of two symbols:

[C#]

public Link LinkSymbols(Symbol sym1, Symbol sym2) {     
    Link link = new Link(Link.Shapes.Line);    
    sym1.Connect(sym1.CenterPort, link.TailPort);     
    sym2.Connect(link.HeadPort, sym2.CenterPort);    
     return link; }

[VB.NET]

Public Function LinkSymbols(ByVal sym1 As Symbol, ByVal sym2 As Symbol) As Link    
     Dim link As Link =  New Link(Link.Shapes.Line)    
     sym1.Connect(sym1.CenterPort, link.TailPort)    
     sym2.Connect(link.HeadPort, sym2.CenterPort)     
    Return link End Function

**Conclusion**

I hope you enjoyed learning about how to create a connection programmatically.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How can I create a directional Link?

**How can I create a directional Link?**

Links can be provided with endpoint decorators to convey direction. The following code snippet shows how to create a directional link by adding a 'Filled Arrow' endpoint visual to the head port edge of the Link:

[C#]

    // Create a directional link
    
    Link link = new Link(pts); EndPointDecoratorModel decoratorMdl = Global.EndPointDecoratorPalette["Filled Arrow"];if (decoratorMdl != null) {  link.EndPoints.LastEndPointDecorator = decoratorMdl.CreateInstance(); }

[VB.NET]

    // Create a directional link
    
    Dim link As New Link(pts) Dim decoratorMdl As EndPointDecoratorModel = Global.EndPointDecoratorPalette("Filled Arrow") If Not (decoratorMdl Is Nothing) Then  link.EndPoints.LastEndPointDecorator = decoratorMdl.CreateInstance() End If

**Conclusion**

I hope you enjoyed learning about how to create a directional Link.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# What are connections and how do they work?

Essential® Diagram supports connecting symbols and links together. Typically, symbols and links are connected together using the interactive LinkTool. Connections can also be created programmatically.

Here is some terminology that is important to know in order to understand connections:

Connection - An object that binds together two ports

Port - A location on a symbol or link at which connections to other ports can be established

Port Container - Any object that contains ports and supports connections to those ports (symbols and links are port containers)

Symbol - A node in a diagram that has child nodes and that supports ports and labels (symbols are port containers)

Link - A special type of symbol that has two endpoints, a direction, and a port anchored to each endpoint to support connections to symbols (links are port containers)

Ports determine where on a symbol or link that connections can be docked. All symbols have a center port that can either be enabled or disabled. Symbols can also have any number of ports elsewhere within their bounds. Each port can have zero or more connections on it at any given time.

Connections are the glue that holds ports together. Each connection has a reference to two ports. Port containers keep track of both ports and the connections to those ports. Both port containers involved in a given connection keep a reference to the connection object. Removing the connection from one port container will automatically remove it from the other port container.

A port container refers to its own port on a given connection as the local port. That simply means it is the port that it owns and not the port belonging to the other port container involved in the connection. The port belonging to the other port container involved in the connection is referred to as the foreign port. The terms "local" and "foreign" are simply a way to identify one of the two ports on a connection with respect to one of the port containers involved in the connection.

The IPortContainer interface contains many useful methods for navigating the ports and connections belonging to a symbol or link. Both the symbol and link classes implement this interface.

**Conclusion**

I hope you enjoyed learning about what connections are and how they work.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to customize line connector's decorator in Diagram?

## Customize line connector's decorator in Diagram

To add a custom decorator shape for the connectors, the Load() method of the Decorator class is used. The Load() method is used to load a new custom graphics path.

**C#**

OrthogonalConnector link = new OrthogonalConnector(rec1.PinPoint, rec2.PinPoint,
    MeasureUnits.Pixel);
    link.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow;
    link.TailDecorator.Load(this.CreateCustomDecorator());
    this.diagram1.Model.AppendChild(link);
    private GraphicsPath CreateCustomDecorator()
    {
    GraphicsPath gpPath = new GraphicsPath();
    gpPath.AddEllipse(0, 0, 10, 20);
    return gpPath;
    }

**VB**

Dim link As OrthogonalConnector = New OrthogonalConnector(rec1.PinPoint, rec2.PinPoint,
    MeasureUnits.Pixel)
    link.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow
    link.TailDecorator.Load(Me.CreateCustomDecorator())
    Me.diagram1.Model.AppendChild(link)
    Private Function CreateCustomDecorator() As GraphicsPath
    Dim gpPath As GraphicsPath = New GraphicsPath()
    gpPath.AddEllipse(0, 0, 10, 20)
    Return gpPath
    End Function

Sample :

[https://help.syncfusion.com/support/samples/kb/diagram.windows/kb\_customdecorator/DiagramSample.zip](http://help.syncfusion.com/support/samples/kb/diagram.windows/kb_customdecorator/DiagramSample.zip)

# How do I add a Diagram to a form?

## Using the designer:

First, make sure you have added both the Syncfusion.Shared (namespace: Syncfusion.Windows.Forms) and Syncfusion.Diagram (namespace: Syncfusion.Windows.Forms.Diagram) controls to your toolbox. You do this by right-clicking on your toolbox and selecting all the components in these namespaces that you find listed under .NET Framework Components.

Once you have the Diagram components in your tool box, drag-and-drop the Diagram component onto your form. The model, view, and controller objects are available as properties under the MVC category in the Properties window.

## From code:

    using Syncfusion.Drawing;
    
    using Syncfusion.Windows.Forms.Diagram;  
    
     ....    private Syncfusion.Windows.Forms.Diagram.Controls.Diagram diagram1;  
    
     ....    // minimal code to create a diagram on a form
    
     this.diagram1 = new Syncfusion.Windows.Forms.Diagram.Controls.Diagram();
    
    // add the Diagram control to the Form's control list
    
    this.Controls.Add(this.diagram1);

    Imports Syncfusion.Drawing
    
    Imports Syncfusion.Windows.Forms.Diagram
    
     ....   Private diagram1 As Syncfusion.Windows.Forms.Diagram.Controls.Diagram  
    
     ....   ' minimal code to create a diagram on a form
    
     Me.diagram1 = New Syncfusion.Windows.Forms.Diagram.Controls.Diagram()
    
      'add the Diagram control to the Form's control list
    
    Me.Controls.Add(Me.diagram1)

**Conclusion**

I hope you enjoyed learning about how to add a Diagram to a form.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# Is it possible to add new attributes to certain shapes based on their type?

## Is it possible to add new attributes to certain shapes based on their type?

An example for this would be associating an Age and Gender property if the shape under consideration happens to be of type Person.

Essential® Diagram implements a property model that supports late-binding and run-time inheritance that makes it very simple for adding/removing properties at run-time. This property model, implemented through the Diagram.IPropertyContainer interface, defines methods for storing, retrieving, adding, removing and enumerating the property values of objects without the need for compile-time knowledge of the object type.

# Can diagrams be created and saved as reuseable diagram templates?

## Can diagrams be created and saved as reuseable diagram templates?

Essential® Diagram does not have support for creating Visio-style diagram templates. The product, however, has full support for serializing diagrams and symbol models and your application can leverage this functionality for creating reuseable diagram templates.

# How do I set Diagram to ReadOnly state in WinForms Diagram?

## How do I set the Diagram to a ReadOnly state, but still retain certain features like Zooming?

Diagram user interactivity is enabled through the interactive Tools registered with the Diagram's Controller. To disable interactivity, you will have to iterate through the list of Tools and selectively enable/disable each tool depending on the functionality that you want to retain. The following code shows how to disable all but the Zoom and Pan tools:

C#

// Get the collection of registered Tools, and disable those that are not required
    Syncfusion.Windows.Forms.Diagram.Tool[] tools = this.diagramComponent.Controller.GetAllTools();
    foreach (Tool tool in tools)
    {
        // Retain the Enabled state for the Zoom and Pan tools
        if ((tool.Name == "ZoomTool") || (tool.Name == "PanTool"))
            continue;
        tool.Enabled = false;
    }
    this.diagramComponent.AllowDrop = false;

VB

Dim tools As Syncfusion.Windows.Forms.Diagram.Tool() = Me.diagramComponent.Controller.GetAllTools()
    Dim tool As tool
    For Each tool In tools
    ' Retain the Enabled state for the Zoom and Pan tools
    If Not (tool.Name = "ZoomTool") And Not (tool.Name = "PanTool") Then
    tool.Enabled = False
    End If
    Next
    Me.diagramComponent.AllowDrop = False

**Conclusion**

I hope you enjoyed learning about how to set the Diagram to a ReadOnly state in WinForms Diagram.

You can refer to
our [WinForms Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to know about its other groundbreaking
feature representations. You can also explore our[WinForms Diagram documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started) to understand how to create and manipulate data.

For current
customers, you can check out our components from the [License and
Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to
Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have any
queries or require clarifications, please let us know in the comments section
below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback
portal](https://www.syncfusion.com/feedback/winforms?searchtext=diagram). We are always happy to assist you!

# Is exporting finished diagrams to an image format supported?

## Is exporting finished diagrams to an image format supported?

Exporting the diagram as a bitmap image is supported and is demonstrated in the 'Essential Diagram\..QuickStart\ExportImage' sample.

# Is alpha blending and/or transparency supported?

## Is alpha blending and/or transparency supported?

Both alpha blending (using an alpha blending factor) and transparency (using fill colors) are supported for rendering fill operations.

# How to extend functionality of TextNode and RichTextNode classes  in WinForms Diagram?

The first step is to create the custom Text or RichText node types in your application by subclassing the base Essential® Diagram TextNode or RichTextNode classes. Once the custom text node has been defined, you will have to initialize the Diagram Text/RichTextTool to use this class in place of the default TextNode/RichTextNode. This is done by accessing the TextTool/RichTextTool from the Diagram's Controller using the Controller.GetTool(string toolName) with 'TextTool'/'RichTextTool' as the tool name, and initializing its TextTool.TextFactory/RichTextTool.RichTextFactory property with a delegate that creates the derived TextNode/RichTextNode type. A sample factory delegate is shown below:

**C#**

// Factory method for creating rich text nodes for the RichTextTool.
    protected RichTextNode MyRichTextFactory(RectangleF bounds, string text)
    {
        Syncfusion.Windows.Forms.Diagram.RichTextNode rtfNode = new MyRichTextNode("Rich Text");
        rtfNode.Bounds = bounds;
        return rtfNode;
    }

**VB**

' Factory method for creating rich text nodes for the RichTextTool.
    Protected Function MyRichTextFactory(ByVal bounds As RectangleF, ByVal text As String) As RichTextNode
        Dim rtfNode As Syncfusion.Windows.Forms.Diagram.RichTextNode = New MyRichTextNode("Rich Text")
        rtfNode.Bounds = bounds
        Return rtfNode
    End Function

**Conclusion**

I hope you enjoyed
learning about how to extend the functionality of TextNode and RichTextNode classes in WinForms Diagram.

You can refer to
our [WinForms Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to know about its other groundbreaking
feature representations. You can also explore our[WinForms Diagram documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started) to understand how to create and manipulate data.

For current
customers, you can check out our components from the [License and
Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to
Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have any
queries or require clarifications, please let us know in the comments section
below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback
portal](https://www.syncfusion.com/feedback/winforms?searchtext=diagram). We are always happy to assist you!

# How do I get hold of Links entering and leaving in WinForms Diagram?

## How do I get hold of the Links that are entering and leaving a Symbol?

You can use the Symbol.EdgesEntering and Symbol.EdgesLeaving properties to get hold of the Links that are entering and leaving a Symbol. The Symbol.Edges property will get you the collection of all Links that are entering or leaving a Symbol. Once you have access to the Link, the Link.FromNode and Link.ToNode properties can be used to determine the symbols that lie on either end of the link.

**Conclusion**

I hope you enjoyed learning about how to get hold of Links entering and leaving in WinForms Diagram.

You can refer to
our [WinForms Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to know about its other groundbreaking
feature representations. You can also explore our[WinForms Diagram documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started) to understand how to create and manipulate data.

For current
customers, you can check out our components from the [License and
Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to
Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have any
queries or require clarifications, please let us know in the comments section
below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback
portal](https://www.syncfusion.com/feedback/winforms?searchtext=diagram). We are always happy to assist you!

# How to customize the order of the legend in a WinForms Chart?

The
order of the [chart legend](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegend.html "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegend.html") in Syncfusion® can be customized through the
[FilterItems](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegend.html#Syncfusion_Windows_Forms_Chart_ChartLegend_FilterItems "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegend.html#Syncfusion_Windows_Forms_Chart_ChartLegend_FilterItems") event of the legend. You can reverse the order of legend items by
adding them to the [ChartLegendItemsCollection](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegendCollection.html "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegendCollection.html") class in reverse order.

    this.chartControl1 = new ChartControl();
    . . .
    
    this.chartControl1.ShowLegend = true;
    this.chartControl1.Legend.FilterItems += new LegendFilterItemsEventHandler(Legend_FilterItems);
    
    private void Legend_FilterItems(object sender, ChartLegendFilterItemsEventArgs e)
    {
        //This creates an new instance of the ChartLegendItemCollection
    
        ChartLegendItemsCollection item = new ChartLegendItemsCollection();
    
        for(int i = e.Items.Count - 1; i >= 0; i--)
    
         item.Add(e.Items[i]);
    
        e.Items = item;
    }

    Me.chartControl1 = New ChartControl()
    . . .
    
    Me.ChartControl1.ShowLegend = True
    AddHandler chartControl1.Legend.FilterItems, AddressOf Legend_FilterItems
    
    Private Sub Legend_FilterItems(ByVal sender As Object, ByVal e As ChartLegendFilterItemsEventArgs)
        ' Creates a new instance of the ChartLegendItemsCollection
        Dim item As ChartLegendItemsCollection = New ChartLegendItemsCollection()
    
        Dim i As Integer
        For i = e.Items.Count - 1 To 0 Step -1
            item.Add(e.Items(i))
        Next
    
        e.Items = item
    End Sub

For more details, refer to the WinForms Chart [documentation](https://help.syncfusion.com/windowsforms/chart/chart-legend-and-legend-items?search=ChartLegendFilterItemsEventArgs#customizing-items-through-event).  
**Before:**

![](https://support.syncfusion.com/kb/attachment/article/1050/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU3ODk0Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.NpcN5RLOtu_hRhBlsKyO3_9E5xEIT3vGMT4i4gNs1aQ)

**After:**

![](https://support.syncfusion.com/kb/attachment/article/1050/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU3ODk4Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.PjWlD-KUCbg7622kkE7hVgbMMiUuPOafnAgsZZSSCj0)

**Conclusion**

I hope you
enjoyed learning about how to customize the order of the legend in Chart.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to export Diagram into image and Word document?

Essential® Diagram allows exporting the diagram to a Word document and an image.

- Exporting as Image can be achieved by using Diagram.ExportDiagramAsImage() and saving as Image.

- Exporting into Word document can be achieved by saving the diagram in standard image formats such as bitmaps, enhanced metafiles , SVG format files and these images can be exported to word document using Essential® DocIO. For this it is neccessary to have Essential® DocIO to be installed.

## Exporting as Image

**C#**

ImageFormat imgformat = ImageFormat.Bmp;
    Image img = this.diagram1.View.ExportDiagramAsImage(true);
    img.Save("MyDiagram.bmp", imgformat);

**VB**

Dim imgformat As ImageFormat = ImageFormat.Bmp
    Dim img As Image = Me.diagram1.View.ExportDiagramAsImage(True)
    img.Save("MyDiagram.bmp", imgformat)

## Exporting into Word Document

**C#**

System.Drawing.Image diagramimage = new Bitmap(1, 1, PixelFormat.Format24bppRgb);
    Graphics grfx = Graphics.FromImage(diagramimage);
    IntPtr hdc = grfx.GetHdc();
    Metafile emf = new Metafile(hdc, EmfType.EmfOnly);
    Graphics emfgrfx = Graphics.FromImage(emf);
    this.diagram1.View.ExportDiagramToGraphics(emfgrfx,true);
    grfx.ReleaseHdc(hdc);
    grfx.Dispose();
    emfgrfx.Dispose();
    diagramimage.Dispose();
    WordDocument document = new WordDocument();
    // Adding a new section to the document.
    IWSection section = document.AddSection();
    // Adding a paragraph to the section
    IWParagraph paragraph = section.AddParagraph();
    WPicture mImage = (WPicture)paragraph.AppendPicture(emf);
    document.Save("Sample.doc", Syncfusion.DocIO.FormatType.Doc);
    System.Diagnostics.Process.Start("Sample.doc");

**VB**

Dim diagramimage As System.Drawing.Image = New Bitmap(1, 1, PixelFormat.Format24bppRgb)
    Dim grfx As Graphics = Graphics.FromImage(diagramimage)
    Dim hdc As IntPtr = grfx.GetHdc()
    Dim emf As Metafile = New Metafile(hdc, EmfType.EmfOnly)
    Dim emfgrfx As Graphics = Graphics.FromImage(emf)
    Me.diagram1.View.ExportDiagramToGraphics(emfgrfx,True)
    grfx.ReleaseHdc(hdc)
    grfx.Dispose()
    emfgrfx.Dispose()
    diagramimage.Dispose()
    Dim document As WordDocument = New WordDocument()
    'Adding a new section to the document.
    Dim section As IWSection = document.AddSection()
    'Adding a paragraph to the section
    Dim paragraph As IWParagraph = section.AddParagraph()
    Dim mImage As WPicture = CType(paragraph.AppendPicture(emf), WPicture)
    document.Save("Sample.doc", Syncfusion.DocIO.FormatType.Doc)
    System.Diagnostics.Process.Start("Sample.doc")

Sample :

[http://help.syncfusion.com/support/samples/kb/diagram.windows/kb\_exportingdiagram/ExportingSample.zip](http://help.syncfusion.com/support/samples/kb/diagram.windows/kb_exportingdiagram/ExportingSample.zip)

**Conclusion**

I hope you enjoyed learning about how to export a diagram into an image and a Word document.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to implement interactive cursor in WinForms Chart?

First,
initialize an instance of the [ChartInteractiveCursor](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartInteractiveCursor.html "ChartInteractiveCursor") class and specify the name
of the series for which the [InteractiveCursor](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartArea.html#Syncfusion_Windows_Forms_Chart_ChartArea_InteractiveCursors "InteractiveCursor") should be displayed. Finally,
add that cursor to the [ChartControl](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html") in [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts").

    ChartInteractiveCursor Icursor = new ChartInteractiveCursor (chartControl1.Series[0]);
    this.chartControl1.ChartArea.InteractiveCursors.Add(Icursor);

    Dim Icursor As ChartInteractiveCursor = New ChartInteractiveCursor(columnChart.Series(0))
    columnChart.ChartArea.InteractiveCursors.Add(Icursor)

**Output:**

![interactivecursor winforms chart](https://support.syncfusion.com/kb/attachment/article/1053/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0Nzg4Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.A1wsjP7XzLKgwdrAxalDGvTsraTQZx_rPlAYfkpUoEo)

**Conclusion**

I hope you enjoyed learning about how to implement [InteractiveCursor](https://help.syncfusion.com/windowsforms/chart/runtime-features#chartinteractivecursor-support-for-chart-area "InteractiveCursor") in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to set the name of the series at run time?

You can set the Text property of Series to get its name at run time.

**C#**

    // Setting series text
    
    this.ChartWebControl1.Series[0].Text = "Series 0";
    
    this.ChartWebControl1.Series[1].Text = "Series 1";

**VB**

    ' Setting series text
    
    Me.ChartWebControl1.Series(0).Text = "Series 0"
    
    Me.ChartWebControl1.Series(1).Text = "Series 1"

# How can I use DocIO in an ASP.NET application?

[.NET DocIO](https://www.syncfusion.com/document-processing/word-framework/net-core/word-library "https://www.syncfusion.com/document-processing/word-framework/net-core/word-library") can be used in both WinForms and WebForms applications without any changes to the code. The usage is the same for both WinForms and WebForms applications. The only difference in the case of a WebForms application is that the created document is streamed to the client browser. Here is the code snippet for streaming the generated document to the browser.

**C#**

    // Streaming the document to the client browser.
    
    document.Save("Sample.doc", FormatType.Doc , Response  HttpContentDisposition.InBrowser );
    
    // Streaming the document as an attachment.
    
    document.Save("Sample.doc", FormatType.Doc , Response, HttpContentDisposition.Attachment);

**VB**

    ' Streaming the document to the client browser.
    
    document.Save("Sample.doc", FormatType.Doc, Response, HttpContentDisposition.InBrowser)
    
    ' Streaming the document as an attachment.
    
    document.Save("Sample.doc", FormatType.Doc, Response, HttpContentDisposition.Attachment)

**Note:**

A new version of Essential®
Studio® for ASP.NET is available. Versions prior to the release of Essential®
Studio® 2014, Volume 2 will now be referred to as a classic versions.The new
ASP.NET suite is powered by [Essential® Studio® for JavaScript](https://www.syncfusion.com/javascript-ui-controls) for JavaScript, providing client-side rendering of HTML5-JavaScript controls, offering better performance and better support for touch interactivity. The new version includes all the features of the old version, so migration is easy.

The classic controls can be used in existing projects; however, if you are starting a new project, we recommend using the latest version of Essential® Studio® for ASP.NET. Although Syncfusion® will continue to support all classic versions, we are happy to assist you in migrating to the newest edition.

For current customers, you can check out
our components from the [License and
Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try
our 30-day [free trial](https://www.syncfusion.com/downloads) to
check out our other controls. If you have any queries or require
clarifications, please let us know in the comments section below.

# How to display the ChartArea alone in ChartWebControl?

This can be achieved by setting Legend visibility property of ChartWebControl to false and Element spacing to zero.

**C#**

    this.ChartWebControl1.Text = "";
    
    this.ChartWebControl1.Legend.Visible = false;
    
    this.ChartWebControl1.ElementsSpacing = 0;

**VB**

    Me.ChartWebControl1.Text = ""
    
    Me.ChartWebControl1.Legend.Visible = False
    
    Me.ChartWebControl1.ElementsSpacing = 0

# How to  display the axes labels in a particular format ?

Using Format property of an axes, we can display the axes labels in a particular format.

For example, if you want to display the axes labels in decimals corrected upto two digits, you need to use following code.

**C#**

    this.ChartWebControl1.ChartWebArea.PrimaryXAxis.Format = "##.00";

**VB**

    Me.ChartWebControl1.ChartWebArea.PrimaryXAxis.Format = "##.00"

# How do I insert hidden bookmarks to the document?

Essential® DocIO supports inserting hidden bookmarks into the document. A bookmark text that is inserted and preceded with an underscore character [\_] is considered a hidden bookmark.

**C#**

    // Indicating hidden bookmark text start.
    
    paragraph.AppendBookmarkStart ("_HiddenText");
    
    // Writing bookmark text
    
    paragraph.AppendText ("Hidden Bookmark Text");
    
    // Indicating hidden bookmark text end.
    
    paragraph.AppendBookmarkEnd ("_HiddenText");

**VB**

    ' Indicating hidden bookmark text start.
    
    paragraph.AppendBookmarkStart ("_HiddenText")
    
    ' Writing bookmark text
    
    paragraph.AppendText ("Hidden Bookmark Text")
    
    ' Indicating hidden bookmark text end.
    
    paragraph.AppendBookmarkEnd ("_HiddenText")

Here is the sample.

[Hidden\_Bookmark.zip](https://www.syncfusion.com)

**Conclusion**

I hope you enjoyed learning about how to insert hidden bookmarks into the document.

You can refer to our [WinForms word feature
tour](https://www.syncfusion.com/document-processing/word-framework/net) page to learn about its other
groundbreaking features and [documentation](https://help.syncfusion.com/file-formats/docio/create-word-document-in-windows-forms), and
how to quickly get started for configuration specifications. You can also
explore our [WinForms word example](https://www.syncfusion.com/demos/fileformats/word-library) to understand how to create and manipulate data.

For current customers, you can check out
our components from the [License
and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can
try our 30-day [free
trial](https://www.syncfusion.com/downloads/fileformats)to check out our other controls.

If you have any queries or require clarifications, please
let us know in the comments section below. You can also contact us through
our [support forums](https://www.syncfusion.com/forums/) or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=docio). We are always happy to assist you!

# Preventing label text rotation on line connectors when the nodes are moved

## Preventing label text rotation on line connectors when the nodes are moved

On moving the nodes, the label text of the "LineConnector" connecting two node becomes upside down. That is on moving one of the two node to the opposite side of the other node from its current position in x direction will make the text to be drawn upside down. To avoid this a workaround has been created in which the label class is customized and a property called rotate is included in it which when set to true rotates the drawing of text by 180 degree.

The sample can be downloaded from the link provided below   
[http://files.syncfusion.com/support/Diagram.Web/Forums/F80107/main.htm](http://files.syncfusion.com/support/Diagram.Web/Forums/F80107/main.htm)

# How to display symbols with chart points and add shadow effects in WinForms Chart?

To customize symbols and shadows in a Syncfusion® [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts"), you first need to set the shape, size, and color for the symbol. You can then assign this symbol to the Symbol property exposed by the [ChartStyleInfo](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartStyleInfo.html "ChartStyleInfo") class.

To display a shadow for the chart control, set its [ChartAreaShadow](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ChartAreaShadow "ChartAreaShadow") property to true. Additionally, to display a shadow for a series, make the **DisplayShadow** property, also exposed by [ChartStyleInfo](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartStyleInfo.html "ChartStyleInfo"), true.

    // Displaying shapes in series
    series.Style.Symbol.Shape = ChartSymbolShape.Pentagon;
    series.Style.Symbol.Color = Color.Red;
    series.Style.Symbol.Size = new Size(15,15);
    
    // Display shadow in series
    series.Style.DisplayShadow = true;
    series.Style.ShadowOffset = new Size(5, 5);
    
    // Display shadow in chart area
    this.chartControl1.ChartAreaShadow = true;

    'Displaying shapes in series
    series.Style.Symbol.Shape = ChartSymbolShape.Pentagon
    series.Style.Symbol.Color = Color.Red
    series.Style.Symbol.Size = New Size(15, 15)
    
    'Display shadow in series
    series.Style.DisplayShadow = True
    series.Style.ShadowOffset = New Size(5, 5)
    
    'Display shadow in chart area
    Me.chartControl1.ChartAreaShadow = True

**Output:**

![display symbols chart points](https://support.syncfusion.com/kb/attachment/article/1060/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0Nzg3Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.WRDbMNoaZtNxtXPNmPV1vLOLmWk9PgfZHAp_BFT7JBM)

**Conclusion**

I hope you enjoyed learning about how to display symbols with chart points and add shadow effects in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart")**.**

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How do I insert nested bookmarks to the document?

Essential® DocIO supports inserting nested bookmarks into the document. Here is the code snippet to insert nested bookmarks.  

**C#**

    // Writing nested bookmarks
    
    paragraph.AppendBookmarkStart("Main");
    
    paragraph.AppendText(" Main data ");
    
         paragraph.AppendBookmarkStart("Nested");
    
         paragraph.AppendText(" Nested data ");
    
    paragraph.AppendBookmarkStart("NestedNested");
    
    paragraph.AppendText(" Nested Nested ");
    
    paragraph.AppendBookmarkEnd("NestedNested");
    
         paragraph.AppendText(" data Nested ");
    
         paragraph.AppendBookmarkEnd("Nested");
    
    paragraph.AppendText(" Data Main ");
    
    paragraph.AppendBookmarkEnd("Main");

**VB**

    ' Writing nested bookmarks
    
    paragraph.AppendBookmarkStart("Main")
    
    paragraph.AppendText(" Main data ")
    
    paragraph.AppendBookmarkStart("Nested")
    
         paragraph.AppendText(" Nested data ")
    
    paragraph.AppendBookmarkStart("NestedNested")
    
    paragraph.AppendText(" Nested Nested ")
    
    paragraph.AppendBookmarkEnd("NestedNested")
    
         paragraph.AppendText(" data Nested ")
    
    paragraph.AppendBookmarkEnd("Nested")
    
    paragraph.AppendText(" Data Main ")
    
    paragraph.AppendBookmarkEnd("Main")

Here is the sample.

[Nested\_Bookmarks.zip](http://www.syncfusion.com/support/user/uploads/nested_bookmarks_c71baf86.zip)

# How to manipulate the chart legend in WinForms Chart?

The chart legend in Syncfusion® [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "https://www.syncfusion.com/winforms-ui-controls/chart"), can be displayed by setting the Legend's **Visibile** property to true. The [ShowItemsShadow](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegend.html#Syncfusion_Windows_Forms_Chart_ChartLegend_ShowItemsShadow "ShowItemsShadow") property controls whether shadows are shown for the legend items. The [BackInterior](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegend.html#Syncfusion_Windows_Forms_Chart_ChartLegend_BackInterior "BackInterior")****property specifies the gradient and background style of the legend.

    // Displays Legend
    this.chartControl1.Legend.Visible = true;
    this.chartControl1.LegendAlignment = ChartAlignment.Center;
    this.chartControl1.Legend.Position = ChartDock.Top;
    this.chartControl1.LegendsPlacement = ChartPlacement.Outside;
    this.chartControl1.Legend.BackInterior = new BrushInfo(GradientStyle.ForwardDiagonal, Color.White, Color.LightBlue);
    
    // Setting Border Properties
    this.chartControl1.Legend.Border.ForeColor = Color.Blue;
    this.chartControl1.Legend.Border.DashStyle = DashStyle.Dot;
    this.chartControl1.Legend.Border.Width = 2;
    this.chartControl1.Legend.ShowBorder = true;
    this.chartControl1.Legend.ShowItemsShadow = false;
    this.chartControl1.Legend.ShowSymbol = false;
    
    // Setting Text Properties
    this.chartControl1.Legend.Text = "Legend";
    this.chartControl1.Legend.TextColor = Color.Brown;
    this.chartControl1.Legend.Font = new Font("Verdana", 8f, FontStyle.Bold);

    'Displays Legend
    columnChart.Legend.Visible = True
    columnChart.LegendAlignment = ChartAlignment.Center
    columnChart.Legend.Position = ChartDock.Top
    columnChart.LegendsPlacement = ChartPlacement.Outside
    columnChart.Legend.BackInterior = New BrushInfo(GradientStyle.ForwardDiagonal, Color.White, Color.LightBlue)
    
    'Setting border properties
    columnChart.Legend.Border.ForeColor = Color.Blue
    columnChart.Legend.Border.DashStyle = DashStyle.Dot
    columnChart.Legend.Border.Width = 2
    columnChart.Legend.ShowBorder = True
    columnChart.Legend.ShowItemsShadow = False
    columnChart.Legend.ShowSymbol = False
    
    'Setting Text properties
    columnChart.Legend.Text = "Legend"
    columnChart.Legend.TextColor = Color.Brown
    columnChart.Legend.Font = New Font("verdana", 8.0F, FontStyle.Bold)

**Output:**

****

![manipulate the chart legend](https://support.syncfusion.com/kb/attachment/article/1062/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0OTgyIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.PRIySazqywI3lRYQN8Cole1Vy523x26Qna7bOXGAaEY)

**Conclusion**

I hope you enjoyed learning about how to manipulate the Chart Legend in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to customize axes grid lines in Winforms Chart control?

In [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "https://www.syncfusion.com/winforms-ui-controls/chart") control, [grid lines](https://help.syncfusion.com/windowsforms/chart/chart-axes#chart-grid-lines "https://help.syncfusion.com/windowsforms/chart/chart-axes#chart-grid-lines") help visually separate axis intervals for better readability. You can customize grid lines on both primary X-axis and primary Y-axis using the following properties.

- [DrawGrid](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_DrawGrid "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_DrawGrid")- Enables or disables drawing of grid lines on the chart axis.
- [ForeColor](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.LineInfo.html#Syncfusion_Windows_Forms_Chart_LineInfo_ForeColor "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.LineInfo.html#Syncfusion_Windows_Forms_Chart_LineInfo_ForeColor") - Sets the foreground color of the grid lines.
- [BackColor](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.LineInfo.html#Syncfusion_Windows_Forms_Chart_LineInfo_BackColor "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.LineInfo.html#Syncfusion_Windows_Forms_Chart_LineInfo_BackColor") - Sets the background color of the grid lines.
- [DashStyle](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.LineInfo.html#Syncfusion_Windows_Forms_Chart_LineInfo_DashStyle "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.LineInfo.html#Syncfusion_Windows_Forms_Chart_LineInfo_DashStyle") - Defines the dash pattern for the grid lines (e.g., solid, dash, dot).
- [PenType](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.LineInfo.html#Syncfusion_Windows_Forms_Chart_LineInfo_PenType "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.LineInfo.html#Syncfusion_Windows_Forms_Chart_LineInfo_PenType") - Specifies the pen type used to draw the grid lines.
- [Width](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.LineInfo.html#Syncfusion_Windows_Forms_Chart_LineInfo_Width "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.LineInfo.html#Syncfusion_Windows_Forms_Chart_LineInfo_Width") - Determines the thickness of the grid lines.

    this.chartControl1 = new ChartControl();
    . . .
    // Primary X axis grid line customization.
    this.chartControl1.PrimaryXAxis.GridLineType.ForeColor = Color.BlanchedAlmond;
    
    this.chartControl1.PrimaryXAxis.GridLineType.Width = 5;
    
    // Disables the Primary Y axis grid line.
    this.chartControl1.PrimaryYAxis.DrawGrid = false;

    Me.ChartControl1 = New ChartControl()
    . . .
    ' Primary X axis grid line customization.
    Me.chartControl1.PrimaryXAxis.GridLineType.ForeColor = Color.BlanchedAlmond
    Me.chartControl1.PrimaryXAxis.GridLineType.Width = 5
    
    ' Disables the Primary Y axis grid line.
    Me.chartControl1.PrimaryYAxis.DrawGrid = false

**Output**

![](https://support.syncfusion.com/kb/attachment/article/1063/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0OTYzIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.1WHouUe2UQ8xNBQbQ-Wbaw_LPMGYjYJqldzUg8hw1ns)

**Conclusion**

I hope you
enjoyed learning about how to customize axes grid lines in Winforms Chart control.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How do I get the bookmarks present in the document?

The document.Bookmarks property holds the collection of bookmarks present in the current document. This is assigned to the BookmarkCollection class.

**C#**

    // Get the bookmarks collections in the document.
    
    BookmarkCollection bookmarks = document.Bookmarks;

**VB**

    ' Get the bookmarks collections in the document.
    
    Dim bookmarks As BookmarkCollection = document.Bookmarks

Here is the sample.

[BookMark\_Collection.zip](http://www.syncfusion.com/support/user/uploads/bookmark_collection_6b3e8bba.zip)

# How to set a custom origin for an axis in WinForms Chart?

In Syncfusion® [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Chart"), by default, the axis calculates its origin based on the data within the series. Utilizing the [CustomOrigin](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_CustomOrigin "CustomOrigin") property of an axis, you can modify this origin. To allow the origin to be set manually with the [Origin](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_Origin "Origin") property, ensure that CustomOrigin is set to true.

    //Assign the X and Y axes
    this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.Category;
    this.chartControl1.PrimaryYAxis.ValueType = ChartValueType.Double;
    
    //Configure the chart series
    CategoryAxisDataBindModel dataSeriesModel = new CategoryAxisDataBindModel(dataSource);
    dataSeriesModel.CategoryName = "Year";
    dataSeriesModel.YNames = new string[] { "Sales" };
    ChartSeries chartSeries = new ChartSeries("Sales");
    chartSeries.Type = ChartSeriesType.Column;
    chartSeries.CategoryModel = dataSeriesModel;
    
    //Assign a custom origin value for the Y-axis
    this.chartControl1.PrimaryYAxis.CustomOrigin = true;
    this.chartControl1.PrimaryYAxis.Origin = 30;

    'Assign the X and Y axes
    columnChart.PrimaryYAxis.ValueType = ChartValueType.Double
    columnChart.PrimaryXAxis.ValueType = ChartValueType.Category
    
    'Configure the chart series
    Dim chartdatabindmodel1 As CategoryAxisDataBindModel = New CategoryAxisDataBindModel(viewmodel.PlantDetails)
    chartdatabindmodel1.CategoryName = "Year"
    chartdatabindmodel1.YNames = New String() {"Sales"}
    Dim chartseries1 As ChartSeries = New ChartSeries("Sales")
    chartseries1.CategoryModel = chartdatabindmodel1
    chartseries1.Type = ChartSeriesType.Column
    columnChart.Series.Add(chartseries1)
    
    'Assign a custom origin value for the Y-axis
    columnChart.PrimaryYAxis.CustomOrigin = True
    columnChart.PrimaryYAxis.Origin = 30

**Output:**

****

![custom origin for an axis](https://support.syncfusion.com/kb/attachment/article/1065/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0ODkyIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.nwT8Is7mDpu8XNjbhQ7pUJApG4Aus7YPmEr4fOIMaeU)

**Conclusion**

I hope you enjoyed learning about how to set a custom origin for an axis in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to customize the appearance of chart axes in WinForms Chart?

This document provides instructions for customizing the appearance of chart axes in Syncfusion® [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Chart"). Customizations can include setting the color, width, and dash style of an axis.

- Use the ForeColor property of the axes to set the desired color.
- Utilize the LineType.Width() method to modify the width of the axis.
- Use the LineType.DashStyle() method to set the dash style of the axis.

    this.chartControl1.PrimaryXAxis.ForeColor = System.Drawing.Color.Blue;
    this.chartControl1.PrimaryXAxis.LineType.Width = 2;
    this.chartControl1.PrimaryXAxis.LineType.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
    
    this.chartControl1.PrimaryYAxis.ForeColor = System.Drawing.Color.Blue;
    this.chartControl1.PrimaryYAxis.LineType.Width = 2;
    this.chartControl1.PrimaryYAxis.LineType.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;

    columnChart.PrimaryXAxis.ForeColor = System.Drawing.Color.Blue
    columnChart.PrimaryXAxis.LineType.Width = 2
    columnChart.PrimaryXAxis.LineType.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash
    
    columnChart.PrimaryYAxis.ForeColor = System.Drawing.Color.Blue
    columnChart.PrimaryYAxis.LineType.Width = 2
    columnChart.PrimaryYAxis.LineType.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash

**Output:**

![Customize appearance of chart axes](https://support.syncfusion.com/kb/attachment/article/1066/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0NTYyIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.ERFxK0jP-Okpui9vwN6ROrHqyRZlG4KOzaDxNzvGHWU)

**Conclusion**

I hope you enjoyed learning
about how to customize the appearance of chart axes in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started).

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart)to know about its
other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with
configuration specifications. You can also explore our WinForms Chart
examples to understand how to create and manipulate data.

For current customers, you can
check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our
30-day [free trial](https://www.syncfusion.com/account/manage-trials/downloads) to check out our other controls.

If you have any queries or require
clarifications, please let us know in the comments section below. You can
also contact us through our [support
forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to create multiple legends for a chart control in WinForms?

In [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls "WinForms Charts"), the Essential Chart component supports the use of multiple legends within a single chart control. This feature is particularly useful for enhancing the clarity of legend items when there are a large number of series in the chart. To implement multiple legends, you need to create custom legends and assign the relevant series to each.

You can use custom legends alongside the default legend. If the default legend is not required, set the **Visible** property to false to hide it.

    this.chartControl1.Legend.Visible = false;
    this.chartControl1.LegendsPlacement = ChartPlacement.Outside;
    
    ChartLegend legend1 = new ChartLegend(chartControl1);
    legend1.Name = "Sales";
    legend1.Alignment = ChartAlignment.Center;
    legend1.Position = ChartDock.Top;
    legend1.Font = new Font("Segoe UI", 10f, FontStyle.Bold);
    
    ChartLegend legend2 = new ChartLegend(chartControl1);
    legend2.Name = "YValue";
    legend2.Alignment = ChartAlignment.Center;
    legend2.Position = ChartDock.Bottom;
    legend2.Font = new Font("Segoe UI", 10f, FontStyle.Bold);
    
    chartSeries1.LegendName = "Sales";
    chartSeries2.LegendName = "YValue";
    
    chartControl1.Legends.Add(legend1);
    chartControl1.Legends.Add(legend2);

    lineChart.Legend.Visible = False
    lineChart.LegendsPlacement = ChartPlacement.Outside
    
    Dim legend1 = New ChartLegend(lineChart)
    legend1.Name = "Sales"
    legend1.Alignment = ChartAlignment.Center
    legend1.Position = ChartDock.Top
    legend1.Font = New Font("Segoe UI", 10.0F, FontStyle.Bold)
    
    Dim legend2 = New ChartLegend(lineChart)
    legend2.Name = "YValue"
    legend2.Alignment = ChartAlignment.Center
    legend2.Position = ChartDock.Bottom
    legend2.Font = New Font("Segoe UI", 10.0F, FontStyle.Bold)
    
    ChartSeries1.LegendName = "Sales"
    ChartSeries2.LegendName = "YValue"
    
    lineChart.Legends.Add(legend1)
    lineChart.Legends.Add(legend2)

**Output:**

![create multiple legends for a chart](https://support.syncfusion.com/kb/attachment/article/1067/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1NDk1Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.gGGVDPxx_ISTChmchFrGDAIrMp7UB1z-m2d79duh8FU)

**Conclusion**

I hope you enjoyed learning about how to create multiple legends for a chart control in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# Why do I have trouble accessing my custom symbol from the Diagram.NodeDoubleClick event handler?

## Why do I have trouble accessing my custom symbol from the Diagram.NodeDoubleClick event handler?

The symbol object is a composite node that is made up of several other child nodes. Clicking on a symbol generates the Diagram.NodeDoubleClick event for each of these child nodes, and so attempting to directly cast the NodeMouseEventArgs.Node member to the symbol type will result in an invalid cast exception. This condition can be avoided by providing a simple type check for the required symbol class. The following code shows an implementation:

[C#]

private void diagram1_NodeDoubleClick(object sender, Syncfusion.Windows.Forms.Diagram.NodeMouseEventArgs evtArgs) {
        if ((evtArgs.Node != null) && (evtArgs.Node is MySymbol)) {
            MySymbol symbolClicked = evtArgs.Node as MySymbol;
            Trace.WriteLine("NodeDoubleClick");
        }
    }

[VB.NET]

Private Sub diagram1_NodeDoubleClick(ByVal sender As Object, ByVal evtArgs As Syncfusion.Windows.Forms.Diagram.NodeMouseEventArgs) Handles diagram1.NodeDoubleClick
        If Not (evtArgs.Node Is Nothing) AndAlso (TypeOf evtArgs.Node Is MySymbol) Then
            Dim symbolClicked As MySymbol = CType(evtArgs.Node, MySymbol)
            Trace.WriteLine(symbolClicked.Name)
        End If
    End Sub

**Conclusion**

I hope you enjoyed learning about why you have trouble accessing your custom symbol from the Diagram.NodeDoubleClick event handler.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# What are PinPoint and PinPointOffset properties?

## What are PinPoint and PinPointOffset properties?

- The PinPoint property defines the node''s position value.
- The PinPointOffset property defines the offset from pinpoint to node''s rendering origin.

# How can I display the view to the center of Winforms Diagram control?

**Display** **view to the center of diagram control?**

You can use the following code to display the view at the center of the diagram control.

    float locationX = (diagram1.Width - diagram1.View.Width) / 2;
    
    float locationY = (diagram1.Height - diagram1.View.Height) / 2;
    
    this.diagram1.View.Origin = new PointF(-locationX, -locationY);

**Conclusion:**

I hope you
enjoyed learning about how to center the view in the WinForms Diagram control.

You can
refer to our [WinForms
Diagram feature
tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to know
about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for
configuration specifications. You can also explore our [WinForms Diagram example](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For
current customers, you can check out our components from
the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can
try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you
have any queries or require clarifications, please let us know in the comments
section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback
portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy
to assist you!

# How to implement datetime values in a WinForms Chart?

To implement DateTime values in a [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts"), you must set the [ChartValueType](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartValueType.html "ChartValueType") to DateTime and set the interval type to days, months, or years using the [ChartDateTimeIntervalType](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartDateTimeIntervalType.html "ChartDateTimeIntervalType") class.

    //Configure the chart series
    ChartSeries chartSeries = new ChartSeries("Sales");
    chartSeries.Type = ChartSeriesType.Line;
    chartSeries.Style.DisplayText = true;
    chartSeries.Style.TextOrientation = ChartTextOrientation.Up;
    chartSeries.Style.Symbol.Shape = ChartSymbolShape.Circle;
    chartSeries.Style.Symbol.Color = Color.Blue;
    chartSeries.Style.Interior = new Syncfusion.Drawing.BrushInfo(Color.Blue);
    
    //Assign the X and Y Axes
    this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.DateTime;
    this.chartControl1.PrimaryXAxis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
    this.chartControl1.PrimaryXAxis.IntervalType= ChartDateTimeIntervalType.Months;
    this.chartControl1.PrimaryXAxis.DateTimeFormat = "MM/yyyy";
    this.chartControl1.PrimaryYAxis.ValueType = ChartValueType.Double;
    
    //Update the data points to the axis
    foreach (var data in dataSource)
    {
        chartSeries.Points.Add(data.Date, data.YValue);
    }
    this.chartControl1.Series.Add(chartSeries);

    'Configure the chart series
    ChartSeries1.Type = ChartSeriesType.Line
    ChartSeries1.Style.DisplayText = True
    ChartSeries1.Style.TextOrientation = ChartTextOrientation.Up
    ChartSeries1.Style.Symbol.Shape = ChartSymbolShape.Circle
    ChartSeries1.Style.Symbol.Color = Color.Blue
    ChartSeries1.Style.Interior = New Syncfusion.Drawing.BrushInfo(Color.Blue)
    
    'Assign the X and Y axes
    columnChart.PrimaryXAxis.ValueType = ChartValueType.DateTime
    columnChart.PrimaryXAxis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift
    columnChart.PrimaryXAxis.IntervalType = ChartDateTimeIntervalType.Months
    columnChart.PrimaryXAxis.DateTimeFormat = "MM/yyyy"
    columnChart.PrimaryYAxis.ValueType = ChartValueType.Double
    
    'Update the data points to the series
    For Each item In viewModel.PlantDetails
        ChartSeries1.Points.Add(item.Date1, item.YValue)
    Next
    columnChart.Series.Add(ChartSeries1)

**Output:**

![implement datetime values](https://support.syncfusion.com/kb/attachment/article/1071/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1MzMyIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.XJ5focup9nPzeLfQTcj10z4HNTEUVOFHut06iBygT9U)

**Conclusion**

I hope you enjoyed learning about how to implement datetime values in a [**WinForms Chart**](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart")**.**

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to specify the datetime display format in WinForms Chart?

To display both the hours and minutes together using Syncfusion® [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Chart"), you can utilize the [DateTimeFormat](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_DateTimeFormat "DateTimeFormat") property of the primary X-axis. By setting the [DateTimeFormat](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_DateTimeFormat "DateTimeFormat") to **"hh:mm"**, you can achieve the desired display format.

    //Assign the X and Y axes
    this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.DateTime;
    this.chartControl1.PrimaryYAxis.ValueType = ChartValueType.Double;
    this.chartControl1.PrimaryXAxis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
    
    //Update the data points to the chart series
    foreach(var item in dataSource)
    {
        chartSeries.Points.Add(item.Date, item.Sales);
    }
    this.chartControl1.Series.Add(chartSeries);
    
    //Assign the DateTime X axis format
    this.chartControl1.PrimaryXAxis.DateTimeFormat = "hh:mm";

    'Assign the X and Y axes
    columnChart.PrimaryYAxis.ValueType = ChartValueType.Double
    columnChart.PrimaryXAxis.ValueType = ChartValueType.DateTime
    columnChart.PrimaryXAxis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift
    
    'Update the data points to the chart series
    For Each item In viewModel.PlantDetails5
        ChartSeries1.Points.Add(item.Date1, item.Sales)
    Next
    columnChart.Series.Add(ChartSeries1)
    
    'Assign the DateTime X axis format
    columnChart.PrimaryXAxis.DateTimeFormat = "hh:mm"

**Output:**

![the datetime display format](https://support.syncfusion.com/kb/attachment/article/1072/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0OTc3Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.-oO9KeX1czVrI5IL9nsgUuPVVRau3GX4hJY5LYyG0Ok)

**Conclusion**

I hope you enjoyed learning about how to specify the datetime display format in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to retrieve the Port information of a particular symbol?

**How to retrieve the Port information of a particular symbol?**

We can retrieve the specific port information using HandlesHitTesting.GetConnectionPointAtPoint(Node, Point) method. This method has two parameters they are:

- Node : The symbol in which the port resides
- Point : The Point object that specifies the location of the port.

**C#**

    ConnectionPoint port = HandlesHitTesting.GetConnectionPointAtPoint(circle, new Point(120, 120));

**VB**

    Dim port As ConnectionPoint = HandlesHitTesting.GetConnectionPointAtPoint(circle, New Point(120, 120))

**Conclusion:**

I hope you enjoyed learning about How to retrieve the Port information of a particular symbol.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to bind a dataset with date values to a WinForms Chart?

To bind a dataset containing date values to a Syncfusion® [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts"), you should use the [ChartDataBindModel](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartDataBindModel.html "ChartDataBindModel") class. This involves creating a table with a Datetime column and then binding it to the dataset.

    //Create the DataSet and DataTable
    DataSet dataSet1 = new DataSet("DataSet1");
    DataTable demographicsTable = new DataTable("Demographics");
    
    demographicsTable.Columns.Add("ID", typeof(int));
    demographicsTable.Columns.Add("TimeStamp", typeof(DateTime)); 
    demographicsTable.Columns.Add("Population", typeof(int));
    demographicsTable.Rows.Add(1, new DateTime(2019, 1, 1), 8000000);
    demographicsTable.Rows.Add(2, new DateTime(2020, 1, 1), 12400000);
    demographicsTable.Rows.Add(3, new DateTime(2021, 1, 1), 11000000);
    demographicsTable.Rows.Add(4, new DateTime(2022, 1, 1), 8500000);
    demographicsTable.Rows.Add(5, new DateTime(2023, 1, 1), 6800000);
    demographicsTable.Rows.Add(6, new DateTime(2024, 1, 1), 4500000);
    dataSet1.Tables.Add(demographicsTable);
    
    //Configure the data binding model
    ChartDataBindModel model = new ChartDataBindModel(dataSet1, "Demographics");
    
    // XName is "ID"
    model.XName = "ID";
    
    // YNames is "Population"
    model.YNames = new string[] { "Population" };
    
    //Configure the chart series
    ChartSeries series = new ChartSeries();
    series.Type = ChartSeriesType.Line;
    series.Style.Symbol.Shape = ChartSymbolShape.Circle;
    series.Style.Symbol.Color = Color.Blue;
    series.Style.Interior = new Syncfusion.Drawing.BrushInfo(Color.Blue);
    series.SeriesModelImpl = model;
    this.chartControl1.Series.Add(series);
    
    ChartDataBindAxisLabelModel xAxisLabelModel = new ChartDataBindAxisLabelModel(dataSet1, "Demographics");
    
    //The columns that has the label values corresponding X values
    xAxisLabelModel.LabelName = "TimeStamp";
    this.chartControl1.PrimaryXAxis.LabelsImpl = xAxisLabelModel;
    this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.Custom;
    this.chartControl1.PrimaryXAxis.Range = new MinMaxInfo(1, 6, 1);
    this.chartControl1.PrimaryXAxis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;

    Dim dataSet1 As New DataSet("DataSet1")
    Dim demographicsTable As New DataTable("Demographics")
    
    demographicsTable.Columns.Add("ID", GetType(Integer))
    demographicsTable.Columns.Add("TimeStamp", GetType(DateTime))
    demographicsTable.Columns.Add("Population", GetType(Integer))
    
    'Add data rows with DateTime values
    demographicsTable.Rows.Add(1, New DateTime(2019, 1, 1), 8000000)
    demographicsTable.Rows.Add(2, New DateTime(2020, 1, 1), 12400000)
    demographicsTable.Rows.Add(3, New DateTime(2021, 1, 1), 11000000)
    demographicsTable.Rows.Add(4, New DateTime(2022, 1, 1), 8500000)
    demographicsTable.Rows.Add(5, New DateTime(2023, 1, 1), 6800000)
    demographicsTable.Rows.Add(6, New DateTime(2024, 1, 1), 4500000)
    dataSet1.Tables.Add(demographicsTable)
    
    'Configure the data binding model
    Dim model As New ChartDataBindModel(dataSet1, "Demographics")
    
    ' XName is "ID"
    model.XName = "ID"
    
    ' YNames is "Population"
    model.YNames = New String() {"Population"}
    
    'Configure the chart series
    Dim series As New ChartSeries()
    series.Type = ChartSeriesType.Line
    series.Style.Symbol.Shape = ChartSymbolShape.Circle
    series.Style.Symbol.Color = Color.Blue
    series.Style.Interior = New Syncfusion.Drawing.BrushInfo(Color.Blue)
    series.SeriesModelImpl = model
    lineChart.Series.Add(series)
    
    'Use ChartDataBindAxisLabelModel to display dates as axis labels
    Dim xAxisLabelModel As New ChartDataBindAxisLabelModel(dataSet1, "Demographics")
    
    ' The column that has the label values corresponding to the X values
    xAxisLabelModel.LabelName = "TimeStamp"
    lineChart.PrimaryXAxis.LabelsImpl = xAxisLabelModel
    
    'Configure the X-axis
    lineChart.PrimaryXAxis.ValueType = ChartValueType.Custom
    lineChart.PrimaryXAxis.Range = New MinMaxInfo(1, 6, 1)
    lineChart.PrimaryXAxis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift

**Output:**

![bind a dataset with date values to chart](https://support.syncfusion.com/kb/attachment/article/1074/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1MzIxIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.jbIHLsRA19HgD9-rdCBTQIll3zyemEsaiBe8nH1r-ZM)

**Conclusion**

I hope you enjoyed learning about how to bind a dataset with date values to a [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to display an image as the background of the chartarea in WinForms Chart?

To display an image as the background of the chart area in a Syncfusion® [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts"), you can create a new **Image** object with the image's filename and assign this object to the **ChartAreaBackImage** property of the Chart control.

    this.chartControl1.ChartAreaBackImage = Image.FromFile("D:\\WinForms\\Winforms_Chart_Sample\\images\\frame1.png");
    this.chartControl1.ChartAreaMargins = new ChartMargins(170,170,170,170);

    columnChart.ChartAreaBackImage = Image.FromFile("D:\\WinForms\\Winforms_Chart_VBSample\\images\\frame1.png")
    columnChart.ChartAreaMargins = New ChartMargins(170, 170, 170, 170)

**Output:**

![display an image as the background chart area](https://support.syncfusion.com/kb/attachment/article/1075/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1MzEzIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.qz-vx4aTprYKCScnScRBg_Avyxsa8D76X4H1SBwMp7M)

**Conclusion**

I hope you enjoyed learning about how to display an image as the background of the [ChartArea](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartArea.html "ChartArea") in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/windowsforms?control=chart), [Direct-Trac](https://support.syncfusion.com/create), or****[**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How can I print the WinForms Diagram in a single page?

## Print diagram in single page

The Essential® [WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram) printing implementation uses the size of your diagram model and the printer page setting for calculating the number of pages to be rendered. Even though you might have only one page worth of nodes in your diagram model, if the model bounds are larger, the diagram control will attempt to paginate and print the entire model.

To print the diagram in a single page, you have to temporarily modify the size of model.

## C#

// The desired page size is 21 x 29.7 centimeters
    // The margins are of size 1 inch or 25 mm
    int verticalMargin = 260;
    int horizontalMargin = 260;
    // The following units are in millimeters, so convert them to pixels
    float pageHeight = Diagram.MeasureUnitsConverter.Convert((2970 - (verticalMargin * 2)) / 10, MeasureUnits.Millimeter, MeasureUnits.Pixel);
    // float pageHeight = bounds.Height;
    float pageWidth = Diagram.MeasureUnitsConverter.Convert((2100 - (horizontalMargin * 2)) / 10, MeasureUnits.Millimeter, MeasureUnits.Pixel);
    // Set the model height to twice the page height
    diagram1.Model.DocumentSize.Height = (int)pageHeight / 2;
    // Set the model width to page width
    diagram1.Model.DocumentSize.Width = (int)pageWidth;
    this.PrintPreview( );

## VB

// The desired page size is 21 x 29.7 centimeters
    // The margins are of size 1 inch or 25 mm
    Dim verticalMargin As Integer = 260
    Dim horizontalMargin As Integer = 260
    // The following units are in millimeters, so convert them to pixels
    Dim pageHeight As Single = Diagram.MeasureUnitsConverter.Convert((2970 - (verticalMargin * 2)) / 10, MeasureUnits.Millimeter, MeasureUnits.Pixel)
    // float pageHeight = bounds.Height;
    Dim pageWidth As Single = Diagram.MeasureUnitsConverter.Convert((2100 - (horizontalMargin * 2)) / 10, MeasureUnits.Millimeter, MeasureUnits.Pixel)
    ' Set the model height to twice the page height
    diagram1.Model.Size = New SizeF(pageWidth, pageHeight / 2)
    Me.PrintPreview( )

## Conclusion

I hope you enjoyed learning about why the diagram prints four pages by default and how you can print the diagram on a single page.

You can refer to our [WinForms Diagram’s feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to know about its other groundbreaking feature representations. You can also explore our [WinForms Diagram documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started) to understand how to present and manipulate data.

For current customers, you can check out our WinForms components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our WinForms Diagram and other WinForms components.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to display the X and Y values while doing MouseMove on the chart?

You can display the X and Y values while doing any Mouse Events like MouseUp, MouseDown, MouseHover, MouseLeave on the chart by using the methods GetValueByPoint which returns the X and Y values of the ChartSeries calculated from the mousepoint and GetPointByValue which returns the X and Y values of the mousepoint calculated from the ChartPoint. Using tooltip we can display the above data. The following code snippet must be given under the Mouse Event handler

## C#

    private void chartControl1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
    {
          //This gives the corresponding X and Y coordinates of the mouse point.
          Point mousePoint = new Point( e.X, e.Y );
    
          //The GetValueByPoint method returns the X and Y values of the ChartSeries calculated from the mousepoint.
          ChartPoint chpt = chartControl1.ChartArea.GetValueByPoint( new Point( e.X, e.Y ) );
    
          //The GetPointByValue method returns the X and Y values of the mousepoint calculated from the ChartPoint.
          Point pt = chartControl1.ChartArea.GetPointByValue( chpt );
    
          string text = "Mouse point: " + mousePoint.ToString() + "\nResult of method GetValueByPoint: {" + chpt.X .ToString() + "," + chpt.YValues[0].ToString() + "}" + "\nResult of method GetPointByValue: " + pt.ToString();
    
          //As mouse moves over the chartcontrol this displays the values as ToolTip.
          toolTip1.SetToolTip(this.chartControl1,text);
    }

## VB

    Private Sub chartControl_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ChartControl1.MouseMove
    
    'This gives the corresponding X and Y coordinates of the mouse point.
    
    Dim mousePoint As Point = New Point(e.X, e.Y)
    
    'The GetValueByPoint method returns the X and Y values of the ChartSeries calculated from the mousepoint.
    
    Dim chpt As ChartPoint = ChartControl1.ChartArea.GetValueByPoint(New Point(e.X, e.Y))
    
    'The GetPointByValue method returns the X and Y values of the mousepoint calculated from the ChartPoint.
    
    Dim pt As Point = ChartControl1.ChartArea.GetPointByValue(chpt)
    
    Dim [text] As String = "Mouse point: " + mousePoint.ToString() + vbLf + "Result of method GetValueByPoint: {" + chpt.X.ToString() + "," + chpt.YValues(0).ToString() + "}" + vbLf + "Result of method GetPointByValue: " + pt.ToString()
    
    'As mouse moves over the chartcontrol this displays the values as ToolTip.
    
    ToolTip1.SetToolTip(Me.ChartControl1, text)
    
    End Sub

# How to set a custom border for chart series elements in WinForms Chart?

To set a custom border for chart series elements in a Syncfusion® [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts"), you can utilize the Border property of the **Style** class in chart series. This method allows you to define the border's DashStyle, Color, and Width.

    // Customize the series border
    chartSeries.Style.Border.Color = Color.Red;
    chartSeries.Style.Border.DashStyle = DashStyle.Solid;
    chartSeries.Style.Border.Width = 3;

    'Customize the series border
    series.Style.Border.Color = Color.Red
    series.Style.Border.DashStyle = DashStyle.Solid
    series.Style.Border.Width = 3

**Output:**

![custom border chart series](https://support.syncfusion.com/kb/attachment/article/1078/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0ODAzIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.xFDLdVMYDSe5AulcBZL6aVpu4cDuyajRkzdBXKHskNc)

**Conclusion**

I hope you enjoyed learning about how to set a custom border for chart series elements in [**WinForms Chart**](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How can I serialize the custom property of a node?

## Serialize custom property of a node

Essential® Diagram supports custom serialization. To serialize a custom property, you need to derive the Group class and create a custom node. You must override the GetObjectData() method, where you can add the custom property in the SerializationInfo. Please refer to the code snippet below.

## C#

[Serializable()]
    public class CustomNode : Group
    {
        protected CustomNode(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            this.m_nodeInformation = info.GetString("strDescription");
        }
        protected override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
            // Additional member variables are serialized here
            info.AddValue("strDescription", this.NodeInformation);
        }
    }

## VB

<Serializable()> _
    Public Class CustomNode
    Inherits Group
    Public Sub New()
    End Sub
    Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
    MyBase.New(info, context)
    Me.m_nodeInformation = info.GetString("strDescription")
    End Sub
    Protected Overrides Sub GetObjectData(ByVal info As SerializationInfo, ByVal context As StreamingContext)
    MyBase.GetObjectData(info, context)
    ' Additional member variables are serialized here
    info.AddValue("strDescription", Me.NodeInformation)
    End Sub
    End Class

Please refer to the attached sample that illustrates this.

[https://help.syncfusion.com/support/samples/kb/Diagram.Windows/Diagram_WF_SerializeProperty/Diagram_WF_SerializeProperty.zip](https://help.syncfusion.com/support/samples/kb/Diagram.Windows/Diagram_WF_SerializeProperty/Diagram_WF_SerializeProperty.zip)

## Conclusion

I hope you enjoyed learning about how can I serialize the custom property of a node.

You can refer to our [WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram)feature tour page to learn about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [WinForms Diagram example](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to set the Interior color for the Chart and the Chart series?

The [**WinForms Chart**](https://www.syncfusion.com/winforms-ui-controls/chart) control, to set the interior color of a chart, use the [**ChartInterior**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ChartInterior "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ChartInterior")property. This property allows you
to specify the interior of the chart, including the chart background and the
chart area background. For a series, use its [**Interior**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartStyleInfo.html#Syncfusion_Windows_Forms_Chart_ChartStyleInfo_Interior "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartStyleInfo.html#Syncfusion_Windows_Forms_Chart_ChartStyleInfo_Interior") property to set the solid
back color, gradient, or pattern style, including both the back and forecolor
of a chart point’s background.

You can set the interior color for:

- Entire Chart using [**ChartInterior**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ChartInterior "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ChartInterior") property
- Chart Background using [**BackInterior**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_BackInterior "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_BackInterior") property
- Chart Area using [**ChartArea.BackInterior**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartArea.html#Syncfusion_Windows_Forms_Chart_ChartArea_BackInterior "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartArea.html#Syncfusion_Windows_Forms_Chart_ChartArea_BackInterior") property
- Individual Series using [**Interior**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartStyleInfo.html#Syncfusion_Windows_Forms_Chart_ChartStyleInfo_Interior "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartStyleInfo.html#Syncfusion_Windows_Forms_Chart_ChartStyleInfo_Interior") property

For more details on customizing chart appearance, refer to the Winforms Chart [**documentation**](https://help.syncfusion.com/windowsforms/chart/chart-appearance "https://help.syncfusion.com/windowsforms/chart/chart-appearance").

    this.chartControl1 = new ChartControl();
    . . .
    
    //Specifies Chart Interior
    this.chartControl1.ChartInterior = new BrushInfo(GradientStyle.Vertical, Color.AntiqueWhite, Color.LightYellow);
    
    //Chart Background Interior
    this.chartControl1.BackInterior = new BrushInfo(GradientStyle.PathEllipse, Color.MistyRose, Color.LightYellow);
    
    // Chart Area Interior
    this.chartControl1.ChartArea.BackInterior = new BrushInfo(GradientStyle.ForwardDiagonal, Color.MistyRose, Color.LightYellow);
    
    //Specifies Series Interior Color
    this.chartControl1.Series[0].Style.Interior = new BrushInfo(175, new BrushInfo(GradientStyle.BackwardDiagonal, new BrushInfoColorArrayList(new Color[] { Color.SaddleBrown, Color.Salmon })));

    Me.ChartControl1 = New ChartControl()
    . . .
    
    'Specifies Chart Interior
    Me.ChartControl1.ChartInterior = New BrushInfo(GradientStyle.Vertical, Color.AntiqueWhite, Color.LightYellow)
    
    'Chart Background Interior
    Me.ChartControl1.BackInterior = New BrushInfo(GradientStyle.PathEllipse, Color.MistyRose, Color.LightYellow)
    
    ' Chart Area Interior
    Me.ChartControl1.ChartArea.BackInterior = New BrushInfo(GradientStyle.ForwardDiagonal, Color.MistyRose, Color.LightYellow)
    
    'Specifies Series Interior Color
    Me.ChartControl1.Series(0).Style.Interior = New BrushInfo(175, New BrushInfo(GradientStyle.BackwardDiagonal, New BrushInfoColorArrayList(New Color() {Color.SaddleBrown, Color.Salmon})))

**Output:**

![](https://support.syncfusion.com/kb/attachment/article/1080/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU2NTUzIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.b0gmmbnYhUUnzIkOyYJ4RZKXVKn8laWeFb88dBao884)

**Conclusion**

I hope you enjoyed learning how to set the Interior color
for the Chart and the Chart series.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to display series text at the top of data points in WinForms Chart?

In [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts"), you can display the series text at various positions, such as below, above, to the right, or to the left of the series point. This feature enables greater flexibility in the presentation of your **Chart Area**.

    series.Style.DisplayText= true;
    series.Style.TextOrientation = ChartTextOrientation.Up;

    series.Style.DisplayText= True
    series.Style.TextOrientation = ChartTextOrientation.Up

**Output:**

![display series text at top](https://support.syncfusion.com/kb/attachment/article/1081/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0Nzk5Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.ZfV-ivgpO8JFsTi3eH24gsW0-d7c7lBoVtX1l328Pqk)

**Conclusion**

I hope you enjoyed learning about how to display series text at the top of data points in [**WinForms Chart**](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# Why diagram nodes or connectors are not properly displayed in a web page?

**Why are diagram nodes or connectors not properly displayed on a web page?**

You should add the correct HTTP handler in the web.config file of your application for the model to render the nodes properly. Refer to the below code for a correct HTTP handler.

    <httphandlers>
    
    <add verb="*" path="ImgRequest.ashx" type="Syncfusion.Web.UI.WebControls.Diagram.NodeRenderHandler, Syncfusion.Diagram.Web, Version=7.103.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
    
    </httphandlers>
    
    For PaletteGroupBar and OverviewControl, you should add the following HTTP handlers.
    
    <add verb="*" path="PaletteImgRequest.ashx" type="Syncfusion.Web.UI.WebControls.Diagram.ThumbNodeRenderHandler, Syncfusion.Diagram.Web, Version=7.103.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
    
    <add verb="*" path="OverviewImgRequest.ashx" type="Syncfusion.Web.UI.WebControls.Diagram.OverviewDocumentRenderHandler, Syncfusion.Diagram.Web, Version=7.103.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>

**Conclusion**

I hope you enjoyed learning why diagram nodes or connectors are not properly displayed on a web page.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to create a range area chart?

Range area chart is a variation of a simple area chart that lets you plot bands of data on a chart such as bollinger bands and weather patterns. The only difference between the range area chart and area chart is that each point in the range area chart is specified by two individual y-values.

The sample attached with this article shows a range area chart.

# How to add custom axis labels with specified color, font, and value type in WinForms Chart

To customize the position of **TickLabels** on a specified axis in a [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts"), first set the drawing mode of the **TickLabels** to **UserMode**. This enables user-driven customization. Afterwards, clear the existing labels and add a new set of labels with the specified color, font, and **ValueType** to the labels collection of the chart axis.

    this.chartControl1.PrimaryXAxis.TickLabelsDrawingMode = ChartAxisTickLabelDrawingMode.UserMode;
    this.chartControl1.PrimaryXAxis.Labels.Clear();
    this.chartControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("a", Color.Purple, new Font("Symbol", 13), 0, "", ChartValueType.Custom));
    this.chartControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("b", Color.Red, new Font("Symbol", 13), 1, "", ChartValueType.Custom));
    this.chartControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("g", Color.Green, new Font("Symbol", 13), 2, "", ChartValueType.Custom));
    this.chartControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("d", Color.Crimson, new Font("Symbol", 13), 3, "", ChartValueType.Custom));
    this.chartControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("e", Color.Blue, new Font("Symbol", 13), 4, "", ChartValueType.Custom));
    this.chartControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("z", Color.Orange, new Font("Symbol", 13), 5, "", ChartValueType.Custom));
    this.chartControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("n", Color.Pink, new Font("Symbol", 13), 6, "", ChartValueType.Custom));
    this.chartControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("t", Color.RoyalBlue, new Font("Symbol", 13), 7, "", ChartValueType.Custom));
    this.chartControl1.PrimaryXAxis.Labels.Add(new ChartAxisLabel("s", Color.Gold, new Font("Symbol", 13), 8, "", ChartValueType.Custom));

    columnChart.PrimaryXAxis.TickLabelsDrawingMode = ChartAxisTickLabelDrawingMode.UserMode
    columnChart.PrimaryXAxis.Labels.Clear()
    columnChart.PrimaryXAxis.Labels.Add(New ChartAxisLabel("a", Color.Purple, New Font("Symbol", 13), 0, "", ChartValueType.Custom))
    columnChart.PrimaryXAxis.Labels.Add(New ChartAxisLabel("b", Color.Red, New Font("Symbol", 13), 1, "", ChartValueType.Custom))
    columnChart.PrimaryXAxis.Labels.Add(New ChartAxisLabel("g", Color.Green, New Font("Symbol", 13), 2, "", ChartValueType.Custom))
    columnChart.PrimaryXAxis.Labels.Add(New ChartAxisLabel("d", Color.Crimson, New Font("Symbol", 13), 3, "", ChartValueType.Custom))
    columnChart.PrimaryXAxis.Labels.Add(New ChartAxisLabel("e", Color.Blue, New Font("Symbol", 13), 4, "", ChartValueType.Custom))
    columnChart.PrimaryXAxis.Labels.Add(New ChartAxisLabel("z", Color.Orange, New Font("Symbol", 13), 5, "", ChartValueType.Custom))
    columnChart.PrimaryXAxis.Labels.Add(New ChartAxisLabel("n", Color.Pink, New Font("Symbol", 13), 6, "", ChartValueType.Custom))
    columnChart.PrimaryXAxis.Labels.Add(New ChartAxisLabel("t", Color.RoyalBlue, New Font("Symbol", 13), 7, "", ChartValueType.Custom))
    columnChart.PrimaryXAxis.Labels.Add(New ChartAxisLabel("s", Color.Gold, New Font("Symbol", 13), 8, "", ChartValueType.Custom))

**Output:**

![add custom labels](https://support.syncfusion.com/kb/attachment/article/1084/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0OTc0Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.CghYa_Tongy9WqqKA8ia4NZMNyKO19Ny-0bSE6xoLsM)

Conclusion

I hope you enjoyed learning about how to add custom axis labels with specified color, font, and value type in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to display images for data points in a WinForms Chart

In the [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "https://www.syncfusion.com/winforms-ui-controls/chart") control, you can display images for data points by using an ImageList control. This allows you to add images to series symbols by setting the [ChartSymbolShape](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSymbolShape.html "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSymbolShape.html")https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSymbolShape.html property to Image and specifying the image using the [ImageIndex](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSymbolInfo.html#Syncfusion_Windows_Forms_Chart_ChartSymbolInfo_ImageIndex "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSymbolInfo.html#Syncfusion_Windows_Forms_Chart_ChartSymbolInfo_ImageIndex") property within [ChartSymbolInfo](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSymbolInfo.html#properties "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSymbolInfo.html#properties") class.

**Steps to display Images for data points**

**Step 1:** Adding an **ImageList** control to your form.

    ImageList imageList = new ImageList(); 
    imageList.ImageSize = new Size(15, 15);
    imageList.Images.Add(Image.FromFile("Resources\\Flower.png")); 
    imageList.Images.Add(Image.FromFile("Resources\\Star.png"));

    Dim imageList As New ImageList()
    imageList.ImageSize = New Size(15, 15)
    imageList.Images.Add(Image.FromFile("Resources\Flower.png"))
    imageList.Images.Add(Image.FromFile("Resources\Star.png"))

**Step 2: Setting the** [ChartSymbolShape ****](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSymbolShape.html "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSymbolShape.html") **to Image**

    series.Style.Symbol.Shape = ChartSymbolShape.Image;

series.Style.Symbol.Shape = ChartSymbolShape.Image

**Step 3: Assigning images using the** **ImageIndex** **property of the** [**ChartSymbolInfo**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSymbolInfo.html#properties "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSymbolInfo.html#properties")******class.**

    series.Style.Images = new ChartImageCollection(imageList.Images);
    series.Style.Symbol.ImageIndex = 1; // Index of image in ImageList
    series.Style.Symbol.Size = new Size(15, 15);

series.Style.Images = New ChartImageCollection(imageList.Images)
    series.Style.Symbol.ImageIndex = 1 ' Index of image in ImageList
    series.Style.Symbol.Size = New Size(15, 15)
**Output:**

![Display images for data points in a WinForms Chart](https://support.syncfusion.com/kb/attachment/article/1085/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUxNTE0Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.08mRl8F2Z5M1PdOd6Wldz-23rI5VsulLnqbkuLA2Kls)

**Conclusion**

I hope you enjoyed learning about how to display images for data points in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started).

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart)to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our WinForms Chart examples to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/account/manage-trials/downloads) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How do I create custom rulers for use in my Diagram?

## How do I create custom rulers for use in my Diagram?

Essential® Diagram uses two classes - Syncfusion.Windows.Forms.Diagram.HorizontalRuler and Syncfusion.Windows.Forms.Diagram.VerticalRuler - that derive from the base Syncfusion.Windows.Forms.Diagram.Ruler class for implementing the standard horizontal and vertical rulers. The Syncfusion.Windows.Forms.Diagram.View class that implements the diagram control's 'View' component hosts the two rulers and uses them for rendering the ruler gradations while drawing the diagram document.

To customize the diagram rulers, you will have to subclass one of the default ruler classes or the base Ruler type and implement the requisite drawing algorithm from an override of the Ruler.Draw(Graphics) method that is summoned by the View for drawing the ruler.

Once the custom ruler implementation is complete, the next step is to instruct your Diagram control instance to use this Ruler type. This is done by subclassing the Syncfusion.Windows.Forms.Diagram.View class used by the Diagram control, overriding the View's CreateHorizontalRuler()/CreateVerticalRuler() methods, and returning instances of your custom ruler types. The final step is to instruct the Diagram control instance to use this subclassed View type. This is done by overriding the Syncfusion.Windows.Forms.Diagram.Controls.Diagram control's Diagram.CreateView() method and returning the View subclass that uses your custom rulers.

The appended schema of the HorizontalRuler class is a part of the 'Ruler.cs' file that ships with the Essential® Diagram source version. Referring to this implementation should give you an idea of how to go about creating custom ruler types.

[C#]

/// Horizontal ruler draws hash marks left to right.
    public class HorizontalRuler : Ruler {
      public HorizontalRuler(View containerView, IPropertyContainer propContainer) : base(containerView, propContainer) {
      }
      protected override string PropertyPrefix {
        get { return "HorizontalRuler"; }
      }
      public override System.Drawing.Rectangle Bounds {
        get {
          System.Drawing.Rectangle value;
          if (this.containerView != null)
            value = this.containerView.HorizontalRulerBounds;
          else
            value = System.Drawing.Rectangle.Empty;
          return value;
        }
      }
      /// Renders the ruler onto the graphics context.
      public override void Draw(Graphics grfx) {
      }
    }

**Conclusion**

I hope you enjoyed learning about how to create custom rulers for use in your Diagram.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How do I set up my application to add a palette automatically when loaded?

## How do I set up my application to add a palette automatically when loaded?

You can use the PaletteGroupBar's LoadPalette method to programmatically set up your application to load the desired palette. For example, in the QuickStart sample you could add the following code in the MainForm's Load event for the Electrical Symbols Palette that ships with Essential® Diagram to be automatically loaded when you run this application:

private void MainForm_Load(object sender, System.EventArgs e){     this.paletteGroupBar.LoadPalette("C:\\Program Files\\Syncfusion\\Essential Suite\\2.0.5.0\\Diagram\\Symbol Palettes\\Electrical Symbols.edp"); }

Private  Sub MainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Me.paletteGroupBar.LoadPalette("C:\\Program Files\\Syncfusion\\Essential Suite\\2.0.5.0\\Diagram\\Symbol Palettes\\Electrical Symbols.edp") End Sub

**Conclusion**

I hope you enjoyed learning about how to set up your application to add a palette automatically when loaded.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to add Print/Print Preview to my Diagram application in WinForms?

The following code sample shows how you can add Print and Print/Preview support to your Essential® Diagram application using the CreatePrintDocument Method:

[C#]

// Set up Print
    private void Print() {
        System.Drawing.Printing.PrintDocument printDoc = this.diagram1.CreatePrintDocument();
        PrintDialog printDlg = new PrintDialog();
        printDlg.Document = printDoc;
        if (printDlg.ShowDialog(this) == DialogResult.OK) {
            printDoc.Print();
        }
    }
    
    // Set up Print Preview
    private void PrintPreview() {
        System.Drawing.Printing.PrintDocument printDoc = this.diagram1.CreatePrintDocument();
        PrintPreviewDialog printPreviewDlg = new PrintPreviewDialog();
        printPreviewDlg.Document = printDoc;
        printPreviewDlg.ShowDialog(this);
    }
    
    // Print Preview Button
    private void printpreviewbutton_Click(object sender, System.EventArgs e) {
        this.PrintPreview();
    }
    
    // Print Button
    private void printtbutton_Click(object sender, System.EventArgs e) {
        this.Print();
    }

[VB.NET]

' Set up Print
    Private Sub Print()
        Dim printDoc As System.Drawing.Printing.PrintDocument = Me.diagram1.CreatePrintDocument()
        Dim printDlg As PrintDialog = New PrintDialog()
        printDlg.Document = printDoc
        If printDlg.ShowDialog(Me) = DialogResult.OK Then
            printDoc.Print()
        End If
    End Sub
    
    ' Set up Print Preview
    Private Sub PrintPreview()
        Dim printDoc As System.Drawing.Printing.PrintDocument = Me.diagram1.CreatePrintDocument()
        Dim printPreviewDlg As PrintPreviewDialog = New PrintPreviewDialog()
        printPreviewDlg.Document = printDoc
        printPreviewDlg.ShowDialog(Me)
    End Sub
    
    ' Print Preview Button
    Private Sub printpreviewbutton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Me.PrintPreview()
    End Sub
    
    ' Print Button
    Private Sub printtbutton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Me.Print()
    End Sub

**Conclusion**

I hope you enjoyed learning about how to add Print/Print Preview to your Diagram application in WinForms.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# Does the Diagram Web Control have any special provisions for printing large diagrams?

## Does the Diagram Web Control have any special provisions for printing large diagrams?

The Diagram ASP.NET Web Server Control does not have any special provisions for printing large diagrams spanning multiple pages. This is because the ASP.NET DiagramWebControl renders the diagram as a static or interactive image, and the print options available to the client are restricted by the browser's support for printing images. For complex printing needs your ASP.NET application will have to provide a printing service that uses the diagram library's printing infrastructure and provides the client browser with a series of page-sized images that can be printed. The Essential Diagram base library has comprehensive printing support built into it that covers features such as pagination, page layouts, margins, headers & footers, zooming, print-to-fit, preview, etc. While this functionality is geared towards the Windows Forms printing model, the implementation itself is built into the base Diagram library and can be accessed by the Diagram Web Control as well.

We will provide a sample demonstrating this approach in a future version of the product.

# How do I programmatically create symbols defined in WinForms Diagram?

## How do I programmatically create the symbols defined in a symbol palette file?

The Essential® Diagram symbol palette file (\*.edp file) is a serialized representation of the Syncfusion.Windows.Forms.Diagram.SymbolPalette class, a special type of diagram model that contains a collection of SymbolModel objects. The SymbolPalette can be retrieved from the palette file by deserializing the palette file as shown below,

**C#**

SymbolPalette palette = null;
    FileStream iStream = null;
    if (File.Exists(filename))
    {
        iStream = new FileStream(filename, FileMode.Open, FileAccess.Read);
        SoapFormatter formatter = new SoapFormatter();
        formatter.Binder = Syncfusion.Runtime.Serialization.AppStateSerializer.CustomBinder;
        formatter.AssemblyFormat = FormatterAssemblyStyle.Simple;
        try
        {
            System.AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(Syncfusion.DiagramBaseAssembly.AssemblyResolver);
            palette = (SymbolPalette)formatter.Deserialize(iStream);
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
            palette = null;
        }
        finally
        {
            iStream.Close();
            System.AppDomain.CurrentDomain.AssemblyResolve -= new ResolveEventHandler(Syncfusion.DiagramBaseAssembly.AssemblyResolver);
        }
    }

**VB**

Dim palette As SymbolPalette = Nothing
    Dim iStream As FileStream = Nothing
    If File.Exists(filename) Then
    iStream = New FileStream(filename, FileMode.Open, FileAccess.Read)
    Dim formatter As SoapFormatter = New SoapFormatter
    formatter.Binder = Syncfusion.Runtime.Serialization.AppStateSerializer.CustomBinder
    formatter.AssemblyFormat = FormatterAssemblyStyle.Simple
    Try
    AddHandler System.AppDomain.CurrentDomain.AssemblyResolve, AddressOf Syncfusion.DiagramBaseAssembly.AssemblyResolver
    palette = CType(formatter.Deserialize(iStream), SymbolPalette)
    Catch ex As Exception
    MessageBox.Show(ex.Message)
    palette = Nothing
    Finally
    iStream.Close()
    RemoveHandler System.AppDomain.CurrentDomain.AssemblyResolve, AddressOf Syncfusion.DiagramBaseAssembly.AssemblyResolver
    End Try
    End If

Once the SymbolPalette has been loaded, the SymbolPalette.Nodes property may be used to get hold of the collection of SymbolModels in that palette. SymbolModels serve as the design-time representation of symbols, and the symbol itself can be created using the SymbolModel.CreateInstance() method. The symbol can then be added to the diagram by:

a) Directly adding it to the diagram's Model.Nodes collection.  
b) Using the InsertSymbolTool or InsertNodeTool for interactive insertion.  
c) Using the InsertNodesCmd for programmatic insertion.

**Conclusion**

I hope you enjoyed learning about how to programmatically create symbols defined in WinForms Diagram.

You can refer to
our[WinForms Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking
feature representations. You can also explore our[WinForms Diagram documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started) to understand how to create and manipulate data.

For current
customers, you can check out our components from the [License and
Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to
Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have any
queries or require clarifications, please let us know in the comments section
below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback
portal](https://www.syncfusion.com/feedback/winforms?searchtext=diagram). We are always happy to assist you!

# Is it possible to programmatically change the geometry of the node(s) within a Symbol?

## Is it possible to programmatically change the geometry of the node(s) within a Symbol?

The Syncfusion.Windows.Forms.Diagram.ILocalPoints interface that all Essential® Diagram Shape objects implement can be used to dynamically access and change the geometry of the nodes that make up a symbol. The following code shows how to programmatically change the length of a Line node contained within a custom defined symbol.

**C#**

public class MySymbol : Symbol
    {
        public MySymbol()
        {
            // Custom symbol initialization
            // Original line segment in the symbol spanning points (20,30) to (40,30)
            this.innerLine = new Line(new PointF(20, 30), new PointF(40, 30));
            this.AppendChild(this.innerLine);
        }
    
         // Changing the geometry of a node in the symbol
        public void IncreaseLineLength()
        {
            // Use the ILocalPoints interface to dynamically access and change the line geometry
            // The following code changes the line's end point from (40,30) to (60,30)
            IServiceProvider svcprovider = this.innerLine as IServiceProvider;
            ILocalPoints localpoints = (ILocalPoints)svcprovider.GetService(typeof(ILocalPoints));
            Debug.Assert(svcprovider != null);
            PointF[] pts = localpoints.GetPoints();
            Trace.WriteLine(pts[0].ToString(), pts[1].ToString());
            // Set the new end point of the line to be PointF(60,30);
            localpoints.SetPoint(1, new PointF(60, 30));
        }
    }

**VB**

Public Class MySymbol Inherits Symbol
    Public Sub New()
    ' Custom Symbol initialization
    ' Original line segment in the custom symbol spanning points (20,30) to (40,30)
    Me.innerLine = New Line(New PointF(20, 30), New PointF(40, 30))
    Me.AppendChild(Me.innerLine)
    End Sub
    Public Sub IncreaseLineLength()
    ' Use the ILocalPoints interface to dynamically access and change the line geometry
    ' The following code changes the line's end point from (40,30) to (60,30)
    Dim svcprovider As IServiceProvider = Me.innerLine
    Dim localpoints As ILocalPoints = CType(svcprovider.GetService(GetType(ILocalPoints)), ILocalPoints)
    Debug.Assert( Not (svcprovider Is Nothing))
    Dim pts As PointF() = localpoints.GetPoints()
    Trace.WriteLine(pts(0).ToString(), pts(1).ToString())
    ' Set the new end point of the line to be PointF(60,30)
    localpoints.SetPoint(1, New PointF(60, 30))
    End Sub
    End Class 'MySymbol

Referring to the class reference documentation on the Syncfusion.Windows.Forms.Diagram.ILocalPoints interface will give a better idea on how to go about using it.

**Conclusion**

I hope you enjoyed learning about whether it is possible to programmatically change the geometry of the node(s) within a Symbol.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# Is there a way to smooth out the edges in WinForms Diagram?

## Is there a way to smooth out the edges of my diagram shapes?

The Diagram.Model.RenderingStyle.SmoothingMode property has a HighQuality rendering mode that will let you smooth out edges, lines and curves. Please refer to the Essential® Diagram class reference documentation on the Syncfusion.Windows.Forms.Diagram.RenderingStyle.SmoothingMode property and the MSDN documentation on the System.Drawing.Drawing2D.SmoothingMode enumeration for the anti-aliasing options that you can use to change the rendering quality.

**Conclusion**

I hope you enjoyed
learning about whether there is a way to smooth out the edges in WinForms Diagram.

You can refer to
our [WinForms Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to know about its other groundbreaking
feature representations. You can also explore our[WinForms Diagram documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started) to understand how to create and manipulate data.

For current
customers, you can check out our components from the [License and
Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to
Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have any
queries or require clarifications, please let us know in the comments section
below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback
portal](https://www.syncfusion.com/feedback/winforms?searchtext=diagram). We are always happy to assist you!

# How can I copy/paste Diagram nodes?

## How can I copy/paste Diagram nodes?

The following code sample demonstrates how you can copy and paste nodes (symbol, shape, or link) in Essential Diagram:

[C#]

// Copy Code
    this.diagram1.Controller.Copy();
    
    // Paste Code
    // If the data in the clipboard is of the type ClipboardNodeCollection
    // paste it onto the Diagram
    IDataObject clipboardData = Clipboard.GetDataObject();
    if (clipboardData.GetDataPresent(typeof(ClipboardNodeCollection))) {
        this.diagram1.Controller.Paste();
    }

[VB.NET]

' Copy Code
    Me.diagram1.Controller.Copy()
    
    ' Paste Code
    ' If the data in the clipboard is of the type ClipboardNodeCollection
    ' paste it onto the Diagram
    Dim clipboardData As IDataObject = Clipboard.GetDataObject()
    If clipboardData.GetDataPresent(Type.GetType(ClipboardNodeCollection)) Then
        Me.diagram1.Controller.Paste()
    End If

**Conclusion**

I hope you enjoyed learning about how to copy/paste Diagram nodes.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# Pressing the 'Delete' key in my application does not delete the nodes selected in the diagram. Why?

## Pressing the 'Delete' key in my application does not delete the nodes selected in the diagram. Why?

Deleting the selected nodes requires a call to the Diagram.Controller.Delete() method. The best way to go about this implementation is to use the approach demonstrated in the DiagramBuilder sample of providing a menu/toolbar command that calls the Delete() method when clicked, or in response to the 'Delete' key specified as the command item's shortcut. If your application requries only keyboard handling without a need for the menu/toolbar item, you could still retain the menu/toolbar item but keep it hidden thus availing of the shortcut support provided by the menuing framework. Another option would be to override the ProcessCmdKey(...) method in the Form or parent Control hosting the diagram and call the Diagram.Controller.Delete() method in response to the appropriate key press.

# Is there a way to temporarily prevent the diagram from redrawing itself?

## Is there a way to temporarily prevent the diagram from redrawing itself?

The Syncfusion.Windows.Forms.Diagram.Model.BeginUpdate()/EndUpdate(bool) methods may be employed to temporarily suspend diagram redraw. Please refer to the class reference documentation on these methods for additional information.

# How do I determine when a new symbol or shape has been added to or removed from the Diagram?

## How do I determine when a new symbol or shape has been added to or removed from the Diagram?

The Diagram.Model.ChildrenChangeComplete event can be used to determine when a new node (symbol, shape, or link) has been added or removed from the diagram. The event's **Diagram.NodeCollection.EventArgs** event argument provides information about the node and the ensuing operation, such as addition or removal.

The following code sample updates the label with information on the type of node that is added to or deleted from the Diagram:

[C#]

// Listen to the Diagram Model's ChildrenChangeComplete Event.
    this.diagram1.Model.ChildrenChangeComplete += new Syncfusion.Windows.Forms.Diagram.NodeCollection.EventHandler(Model_ChildrenChangeComplete);
    // ChildrenChangeComplete Event
    // Update Label2 depending on whether a Shape is added or deleted from the Diagram
    private void Model_ChildrenChangeComplete(object sender, Syncfusion.Windows.Forms.Diagram.NodeCollection.EventArgs evtArgs)
    {
        if (evtArgs.ChangeType.ToString() == "Insert")
        {
            this.label2.ForeColor = Color.Blue;
            this.label2.Text = "Last Node Added: " + evtArgs.Node.Name.ToString();
        }
        else if (evtArgs.ChangeType.ToString() == "Remove")
        {
            this.label2.ForeColor = Color.Red;
            this.label2.Text = "Last Node Removed: " + evtArgs.Node.Name.ToString();
        }
    }

[VB.NET]

' Listen to the Diagram Model's ChildrenChangeComplete Event.
    Me.diagram1.Model.ChildrenChangeComplete += New Syncfusion.Windows.Forms.Diagram.NodeCollection.EventHandler(Model_ChildrenChangeComplete)
    
    ' ChildrenChangeComplete Event
    ' Update Label2 depending on whether a Shape is added or deleted from the Diagram
    Private Sub Model_ChildrenChangeComplete(ByVal sender As Object, ByVal evtArgs As Syncfusion.Windows.Forms.Diagram.NodeCollection.EventArgs)
        If evtArgs.ChangeType.ToString() = "Insert" Then
            Me.label2.ForeColor = Color.Blue
            Me.label2.Text = "Last Node Added: " + evtArgs.Node.Name.ToString()
        ElseIf evtArgs.ChangeType.ToString() = "Remove" Then
            Me.label2.ForeColor = Color.Red
            Me.label2.Text = "Last Node Removed: " + evtArgs.Node.Name.ToString()
        End If
    End Sub

**Conclusion**

I hope you enjoyed learning about how to determine when a new symbol or shape has been added to or removed from the Diagram.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# Sometimes labels are drawn outside my symbol. Why?

## Sometimes labels are drawn outside my symbol. Why?

When you add a label to your symbol and specify its anchor using the **BoxPosition** Enumeration, you need to remember that the label's anchor point will be its center. Therefore, by specifying **BoxPosition.TopLeft**, you are setting the center/anchor point of the label to be the top left of your symbol. To ensure that the label text is within the symbol, you should set appropriate offsets, such as if you want the label to begin at the top left of your symbol:

[C#]

// Add new label to MySymbol 
    Label lbl = AddLabel("My Symbol", BoxPosition.TopLeft);
    
    // Offsets for the label 
    lbl.OffsetX = this.lbl.Width/2; 
    lbl.OffsetY = this.lbl.Height/2;

[VB.NET]

'Add new label to MySymbol 
    Dim lbl As Label =  AddLabel("My Symbol",BoxPosition.TopLeft)
       
    'Offsets for the label 
    lbl.OffsetX = Me.lbl.Width/2 
    lbl.OffsetY = Me.lbl.Height/2

**Conclusion**

I hope you enjoyed learning about why Sometimes labels are drawn outside my symbol.

You can refer to our [WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram)feature tour page to learn about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [WinForms Diagram example](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# Could we edit data in grid and make it reflect in chart?

Yes, we can edit data in grid and make it reflect the changes in a Grid control.

Please refer to the attached sample. The chart and grid controls are bound with the same observable collection. The changes done in the grid in run-time will reflect in the underlying data source (ObservableCollection), and this in turn reflects in the chart control.

# How to use connection lines in the Gantt Chart?

A Gantt chart is a graphical representation of the duration of tasks against the progression of time. This chart is excellent for planning the use of resources, and data can be plotted using a date-time scale or a numerical scale.

We have the direct support to connect the Gantt chart points using the property "RelatedPoints" and various customizing options are also available. Here is the sample code to do this.

**C#**

    //Indicates the connection lines between the points
    
    int[] ptIndices1 = new int[] { 1 };
    
    this.ChartWebControl1.Series[1].Styles[5].RelatedPoints.Points = ptIndices1;
    
    //Customizing options for the lines.
    
    this.ChartWebControl1.Series[1].Styles[5].RelatedPoints.Color = Color.Red;
    
    this.ChartWebControl1.Series[1].Styles[5].RelatedPoints.Alignment = System.Drawing.Drawing2D.PenAlignment.Center;
    
    this.ChartWebControl1.Series[1].Styles[5].RelatedPoints.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
    
    this.ChartWebControl1.Series[1].Styles[5].RelatedPoints.Width = 2f;

Below is the sample link demonstrating the connection lines in Gantt chart

[Gantt Chart with Connection lines](http://files.syncfusion.com/support/Chart.Web/7.1.0.21/GanttChart/main.htm)

# Can I display ToolTips for my symbols?

## Display tooltip for symbols

ToolTips can be displayed using the Model's **"NodeMouseEnter"** and **"NodeMouseLeave"** events. Here is a code snippet where ToolTips are displayed only for the Diagram's nodes.

[C#]

private void EventSink_NodeMouseEnter(object sender, NodeMouseEventArgs evtArgs) 
    {
        if (evtArgs.Node.GetType() == typeof(MySymbol)) 
        {
            this.toolTip1.SetToolTip(this.diagram1, evtArgs.Node.Name.ToString());
            this.toolTip1.Active = true;
        }
    }
    private void EventSink_NodeMouseLeave(object sender, NodeMouseEventArgs evtArgs) 
    {                                                              
        this.toolTip1.Active = false;                         
    }
[VB.NET]

Private Sub EventSink_NodeMouseEnter(ByVal sender As Object, ByVal evtArgs As NodeMouseEventArgs)  
        If evtArgs.Node.Name.StartsWith("MySymbol") Then  
            Me.toolTip1.SetToolTip(Me.diagram1, evtArgs.Node.Name.ToString())  
            Me.toolTip1.Active = True  
        End If 
    End Sub
    Private Sub EventSink_NodeMouseLeave(ByVal sender As Object, ByVal evtArgs As NodeMouseEventArgs)  
        Me.toolTip1.Active = False 
    End Sub

Here is a Sample for displaying ToolTips :

[Sample](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Sample-1055578402.zip)

**Conclusion**

I hope you enjoyed learning about how to display ToolTips for symbols.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to add Hyperlink to the symbols above the series?

We can add hyperlink to the symbols at the top of the series.

Here is a sample demonstrating this.

Sample Program

[http://files.syncfusion.com/samples/KB/Chart.Web/7.1.0.30/T620_KB/main.htm](http://files.syncfusion.com/samples/KB/Chart.Web/7.1.0.30/T620_KB/main.htm)

**Note:**

A new version of Essential
Studio for ASP.NET is available. Versions prior to the release of Essential
Studio 2014, Volume 2 will now be referred to as a classic versions.The new
ASP.NET suite is powered by [Essential Studio for
JavaScript](https://www.syncfusion.com/javascript-ui-controls) providing client-side rendering of HTML 5-JavaScript controls,
offering better performance, and better support for touch interactivity. The
new version includes all the features of the old version, so migration is easy.

The Classic controls can be
used in existing projects; however, if you are starting a new project, we
recommend using the latest version of Essential Studio for ASP.NET. Although
Syncfusion will continue to support all Classic Versions, we are happy to
assist you in migrating to the newest edition.

For current
customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/account/downloads) page. If
you are new to Syncfusion, you can try our 30-day [free trial](https://www.syncfusion.com/downloads) to check out
our other controls. If you have any queries or require clarifications, please
let us know in the comments section below.

You can also contact us
through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://www.syncfusion.com/support/directtrac/incidents/),
or [feedback portal](https://www.syncfusion.com/feedback/). We are always
happy to assist you!

# How to add Hyperlink to the labels above the series?

Currently, we don''t have direct hyperlink support for Labels, but we are having this support for symbols, near which the Labels are displayed. So, by applying the hyperlink to the symbols we can meet the hyperlink support for labels.

We can customize the locations of Labels and the Symbols by using the following properties so there is no problem to move the Symbols wherever the labels are present.

    this.ChartWebControl1.Series[0].Styles[i].Symbol.Offset = new Size(10,10);
    
    this.ChartWebControl1.Series[0].Styles[i].TextOrientation = ChartTextOrientation.Up;

**Sample Program**

[https://files.syncfusion.com/samples/KB/Chart.Web/7.1.0.30/T620\_KB/main.htm](http://files.syncfusion.com/samples/KB/Chart.Web/7.1.0.30/T620_KB/main.htm)

# How can I programmatically link two symbols?

## How can I programmatically link two symbols?

The Syncfusion.Windows.Forms.Diagram.LinkCmd command class can be used to programmatically form connections between symbols.

The following code sample shows how to create a link between the two symbols, symbol1 and symbol2:

[C#]

// Create a LinkCmd object
    LinkCmd linkcommand = new LinkCmd();
    linkcommand.Link = new Link(Link.Shapes.Line);
    // Set up the Source and Target ports for the Link
    linkcommand.SourcePort = symbol1.CenterPort;
    linkcommand.TargetPort = symbol2.CenterPort;
    // Execute the command to connect the two symbols
    this.diagram.Controller.ExecuteCommand(linkcommand);

[VB.NET]

' Create a LinkCmd object
    Dim linkcommand As New LinkCmd()
    linkcommand.Link = New Link(Link.Shapes.Line)
    ' Set up the Source and Target ports for the Link
    linkcommand.SourcePort = symbol1.CenterPort
    linkcommand.TargetPort = symbol2.CenterPort
    ' Execute the command to connect the two symbols
    Me.diagram.Controller.ExecuteCommand(linkcommand)

**Conclusion**

I hope you enjoyed learning about how to programmatically link two symbols.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How do I add ports to my symbol?

## How do I add ports to my symbol?

The following code sample shows how the ports were added to the custom symbol (MySymbol)

[C#]

private CirclePort leftport; 
    private CirclePort rightport;
    // Add these lines to MySymbol's Constructor
    // Port locations 
    leftport = new CirclePort(new PointF(0, this.Height / 2)); 
    rightport = new CirclePort(new PointF(this.Width, this.Height / 2));
    // Append CirclePorts to MySymbol 
    AppendChild(leftport); 
    AppendChild(rightport);
    // Make CenterPort visible 
    this.CenterPort.Visible = true;

[VB.NET]

Private leftport As CirclePort 
    Private rightport As CirclePort
    ' Add these lines to MySymbol's Constructor
    ' Port locations 
    leftport = New CirclePort(New PointF(0, Me.Height / 2)) 
    rightport = New CirclePort(New PointF(Me.Width, Me.Height / 2)) 
    ' Append CirclePorts to MySymbol 
    AppendChild(leftport) 
    AppendChild(rightport) 
    ' Make CenterPort visible 
    Me.CenterPort.Visible = True
**Conclusion**

I hope you enjoyed learning about how to add ports to my symbol.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!
http://www.syncfusion.com/Support/article.aspx?id=10493

# How units, scale, grid spacing, ruler units, and magnification relate in WinForms Diagram?

The default unit of measure used by Essentia**l®**[WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram "https://www.syncfusion.com/winforms-ui-controls/diagram") is the pixel, where one unit in the diagram model translates to one pixel on the display device. This is most suited for applications that do not require interpretation of the diagram model in terms of real-world measurement units and can tolerate a certain amount of variation depending on the resolution of the display device. The device-independent units that you can avail of are Inches, Millimeters, Document, and the Point. Besides the device independence that the real-world units offer, the choice of unit is purely tied to that which can most easily be interpreted by the application and is also meaningful to your end-user. Most applications should be well served by staying with the default Pixel units. The application will simply have to come up with a logical mapping for transferring the real-world units from its data model to Pixel values for use in your diagram.

For instance, a diagram that attempts to model a 100 square mile topographical map may utilize a logical scale that maps each square mile to a 100 X 100 pixel section of the diagram. The diagram model would then be set up with bounds that equal a width and height of 10000 Pixel units. You could then design your symbols and other diagram objects to conform to this logical scale. The diagram Rulers, Grid spacing, and Magnification are attributes tied to the diagram's View component and are purely visual aspects of the diagram. The Grid spacing uses the same units as those used by the Model, and the default grid will remain the same irrespective of the measurement unit chosen for your model. Rulers, however, use a separate unit of measure, as set by the Diagram.View.RulerUnits property, and you can adopt a ruler gradation that is best suited for your diagram's scale. Magnification is simply a question of mapping the diagram's model onto the view, and the model units do not affect this in any way.

​
**Conclusion**

I hope you enjoyed
learning about how units, scale, grid spacing, ruler units, and magnification relate in WinForms Diagram.

You can refer to
our [WinForms Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page
to learn about its other groundbreaking feature
representations and [documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started "https://help.syncfusion.com/windowsforms/diagram/getting-started"), and how to quickly get
started for configuration specifications.

For current customers, you
can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can
try our 30-day [free trial](https://www.syncfusion.com/downloads/fileformats/confirm)to check out our other controls.

If you have any
queries or require clarifications, please let us know in the comments section
below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# What are my options for creating a custom symbol? How do I make it respond to mouse events?

## What are my options for creating a custom symbol? How do I make it respond to mouse events?

The symbol can be defined using the Essential Diagram SymbolDesigner utility, in which case, the various drawing tools in the designer may be used for creating the shapes that will make up the symbol. Symbols built using the SymbolDesigner are saved as symbol palette files and loaded into an application using symbol palettes from which it can be dragged and dropped onto the diagram as shown in the ‘Diagram\Samples\In Depth\DiagramBuilder’ sample, or used directly through the Syncfusion.Windows.Forms.Diagram.SymbolPalette API for creating instances of the symbol. The ‘Samples\Quick Start\Text Symbols\Multiline’ sample shows similar symbols designed using the SymbolDesigner utility.

The entire symbol may also be defined using the Essential Diagram API. This approach involves defining a subclass of the Syncfusion.Windows.Forms.Diagram.Symbol class in your application (or in a library module), and creating and adding the above listed nodes as children of this symbol class. The ‘Samples\Quick Start\DynamicSymbol’ sample shows a programmatically defined symbol, and referring to this implementation will give a good idea on how to go about creating the symbol.

As for responding to mouse events - highlighting a section of the symbol when it is clicked on for instance - this is especially easy to do when defining the symbol programmatically. All that you have to do is override the custom Symbol’s OnClick method, check whether one of the text rectangles was clicked by examining the method’s NodeMouseEventArgs param, and if so provide a suitable highlight for the node by changing its FillStyle or any of the other style properties. In fact, the custom symbol used by the ‘Quick Start\DynamicSymbol’ sample shows node highlighting in response to mouse click events.

Mouse events may be handled for symbols defined using the SymbolDesigner as well. This is done by either sub-classing the symbol as shown in the ‘Samples\Quick Start\CustomSymbol’ sample, and providing an override for the symbol’s OnClick method, or by simply handling the Diagram.NodeClick event in your application, and determining whether one of the text rectangles in the symbol was clicked on, and if so, change the node’s FillStyle property to reflect the clicked state.

# How to add a couple of properties in the symbol model preferable in the designer?

The Essential®[WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram "https://www.syncfusion.com/winforms-ui-controls/diagram") SymbolModel class implements the Diagram.IPropertyContainer interface. To add properties that will be confined to programmatic access, you can use the IPropertyContainer.SetPropertyValue(String propertyname, object propertyvalue) method to add the required properties anytime after a SymbolModel instance is created by the SymbolDesigner. The SymbolDesigner creates a new SymbolModel in response to the 'Add Symbol' command from within the 'MainForm.SymbolAdd\_Click()' event handler found in the SymbolDesigner project.

// From the SymbolDesigner’s MainForm.SymbolAdd\_Click() handler

**C#**

private void SymbolAdd_Click(object sender, System.EventArgs e)
      {
       if(curPalette != null)
       {
        SymbolModel symbolMdl = curPalette.AddSymbol("New Symbol");
        symbolMdl.SetPropertyValue("Custom Property", "Test Value");
    curPalette.AppendChild(symbolMdl);
        SymbolDocument formSymbolDoc = new SymbolDocument(symbolMdl);
        //...
       }
      }

**VB**

Private Sub SymbolAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs)
       If Not curPalette Is Nothing Then
        Dim symbolMdl As SymbolModel = curPalette.AddSymbol("New Symbol")
        symbolMdl.SetPropertyValue("Custom Property", "Test Value")
    curPalette.AppendChild(symbolMdl)
        Dim formSymbolDoc As SymbolDocument = New SymbolDocument(symbolMdl)
        '...
       End If
    End Sub

This property will be persisted along with the SymbolModel and you can subsequently use the SymbolModel’s IPropertyContainer.GetPropertyValue(String propertyname) method to retrieve this property from the SymbolModel when creating the Symbol.

However to add properties to the SymbolModel that can be edited through the SymbolDesigner's property editor, you will have to first implement a subclass of the Diagram.SymbolModel type that defines the extra properties that you require. This custom SymbolModel should be implemented as a serializable class that includes the 'Serializable' attribute and implements the requisite serialization constructor and GetObjectData(SerializationInfo, StreamingContext) method. Now within the SymbolDesigner’s 'Add Symbol' event handler, in place of the default SymbolModel.AddSymbol() method, create an instance of your custom SymbolModel class, and append this custom symbol model instance to the SymbolPalette using the SymbolPalette.AppendChild(INode mysymbolmodel) method. Also initialize the SymbolDocument that you will be creating with this new instance of the SymbolModel. The following code shows the revised handler,

C#

private void SymbolAdd_Click(object sender, System.EventArgs e)
      {
       Cursor prevCursor = Cursor.Current;
       Cursor.Current = Cursors.WaitCursor;
       SymbolPalette curPalette = symbolPaletteGroupBar.CurrentPalette;
       if (curPalette != null)
       {
        CustomSymbolModel custsymbolmdl = new CustomSymbolModel();
    curPalette.AppendChild(custsymbolmdl);
        SymbolDocument formSymbolDoc = new SymbolDocument(custsymbolmdl);
        formSymbolDoc.MdiParent = this;
        this.propertyEditor.Diagram = formSymbolDoc.Diagram;
        formSymbolDoc.Show();
       }
       Cursor.Current = prevCursor;
      }

**VB**

Private Sub SymbolAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs)
       Dim prevCursor As Cursor = Cursor.Current
       Cursor.Current = Cursors.WaitCursor
       Dim curPalette As SymbolPalette = symbolPaletteGroupBar.CurrentPalette
       If Not curPalette Is Nothing Then
        Dim custsymbolmdl As CustomSymbolModel = New CustomSymbolModel()
    curPalette.AppendChild(custsymbolmdl)
        Dim formSymbolDoc As SymbolDocument = New SymbolDocument(custsymbolmdl)
        formSymbolDoc.MdiParent = Me
        Me.propertyEditor.Diagram = formSymbolDoc.Diagram
        formSymbolDoc.Show()
       End If
       Cursor.Current = prevCursor
    End Sub

The new properties for the SymbolModel will be available from the symbol model properties window, and may be accessed later on when using the SymbolModel to create a Symbol.

Please note that the subclassed SymbolModel type will have to be defined in a separate class library assembly, and both the SymbolDesigner and your application should link to this dll.

**Conclusion**

I hope you enjoyed learning about
how to add a couple of properties in the symbol model preferable in the
designer.

You can refer to our [WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram "https://www.syncfusion.com/winforms-ui-controls/diagram")[feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram "https://www.syncfusion.com/winforms-ui-controls/diagram") page to learn about its other groundbreaking feature
representations. You can also explore our [WinForms Diagram](https://help.syncfusion.com/windowsforms/diagram/getting-started "https://help.syncfusion.com/windowsforms/diagram/getting-started")[documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started "https://help.syncfusion.com/windowsforms/diagram/getting-started") to understand how to present and manipulate data.

For current customers, you can
check out our WinForms components from the [License and Downloads](https://www.syncfusion.com/account/downloads) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our WinForms Diagram and other WinForms components.

If you have any queries or
require clarifications, please let us know in comments below. You can also
contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# In the web Essential Diagram, is it possible to capture a click and key press event. Something like a shift click?

## In the web Essential Diagram, is it possible to capture a click and key press event. Something like a shift click?

The DiagramWebControl.NodeClick/NodeDoubleClick events do provide information about the state of certain keys such as the Shift, Alt and Ctrl.

Please check out the NodeClickEventArgs.AltKey/CtrlKey/ShiftKey properties to determine whether the specific key was pressed.

# How to protect a node from being edited?

How to protect a node from being edited?

- The EditStyle.AllowChangeWidth is used to indicate whether the node''s width can be changed.
- The EditStyle.AllowChangeHeight is used to indicate whether the node''s height can be changed
- The EditStyle.AllowDelete is used to indicate whether the can be deleted from its container.
- The EditStyle.AllowMoveX is used to indicate whether the node can be moved along x axis.
- The EditStyle.AllowMoveY is used to indicate whether the node can be moved along y axis.
- The EditStyle.AllowRotate is used to indicate whether the node can be rotated.
- The EditStyle.AllowSelect is used to indicate whether the node can be selected.
- The EditStyle.AllowVertexEdit is used to indicate whether the vertices of the node can be edited.
- The EditStyle.Enabled is used to specify the node is enabled.

# Changing a symbol's property does not apply it to the symbol's child nodes

## Changing a symbol's property does not apply it to the symbol's child nodes

Changing a Symbol's FillStyle property value such as the FillStyle.Color will propagate that property down through the symbol''s child nodes collection and will apply that particular property to all child nodes that support it. For example, in the case of a symbol composed of an outer Rectangle and an inner Ellipse shape, setting the Symbol.FillStyle.Color to Black will result in the property being applied to both the Rectangle and the Ellipse child nodes, thus giving the Symbol the resultant FillStyle color.

This property propagation mechanism will however work only if the symbol''s child nodes retain the default value for that particular property, and do not have an overriding assignment. If the child node''s FillStyle.Color property has been set to something other than the default, then that child node will retain its assigned property value, and will ignore the parent symbol''s fill style when it draws itself.

And so symbol's child nodes should retain their default property values for those attributes that you intend to change at the symbol level. If you want to change a non-default value for one of the symbol''s child nodes, then you will have to do this by directly the child node and applying the new property value directly to it.

# Is there a way to specify a minimum size for my symbols? Can I reset the symbol bounds from the Diagram.BoundsChanged event?

## Is there a way to specify a minimum size for my symbols? Can I reset the symbol bounds from the Diagram.BoundsChanged event?

The Diagram.BoundsChanged event is not a good place to change a node's bounds as doing so will set off a recursive sequence of events. A better option would be replace the diagram ResizeTool with a custom version that checks a node's bounds before resizing it and pre-empts the operation if the new size is less than a certain value.

Looking at the ResizeTool class and it's IMouseEventReceiver.MouseUp handler in particular will give you a good idea on how to go about creating a custom verison of the ResizeTool. You can find the ResizeTool.cs file under the Diagram.Base\Src\Tools folder (Diagram.Windows\Src\Tools if you are running the 4.1 beta).

The Diagram.Controller.RegisterTool()/UnRegisterTool methods can be used to replace the existing ResizeTool with your customized version.

# When I move a line near(over) a shape,the line gets connected with the shape, how can I disable this feature?

## When I move a line near(over) a shape,the line gets connected with the shape, how can I disable this feature?

This can be done by disabling the shape nodes EnableCentralPort property. (i.e) If you are moving the line near to a rectangle shape node, you can avoid connecting the line with the rectangle node by setting the Rectangle.EnableCentralPort property to false value.

# I tried to run one of the Diagram ASP.NET samples from a remote server, but the diagram fails to render. Why?

## I tried to run one of the Diagram ASP.NET samples from a remote server, but the diagram fails to render. Why?

It is very likely that the Essential Diagram application that you copied over to the remote server does not have the web.config file from the Essential Studio installation. Essential Diagram uses the web configuration file to specify the custom httphandler that it uses for rendering the diagram image. The sample when run from the default installation directory will pick up the configuration information from the '\Syncfusion\Essential Studio\3.2...\web.config' file that is shared by all the Syncfusion ASP.NET samples. Open the sample project on the remote server in VS.NET and use the Add New Item dialog to add a web.config file to the sample, and update it with a httphandler entry like the one present in the attached configuration file. Please be sure to specify the correct version information for the Syncfusion.Diagram.Web assembly. This should make the sample work as expected.

# Can I display a tooltip when the mouse is hovered over a diagram node?

**Can I display a tooltip when the mouse is hovered over a diagram node?**

Tooltips can be displayed by using an ALT element for the diagram node. The following code should give you an idea,

Add the following code snippet to Diagram.web\Samples\1.1\OrgLayout sample

**C#**

    protected void LoadNodeDisplayData()
    {
        EmployeeSymbol emplysymbol = new EmployeeSymbol();
        emplysymbol.EmployeeName = emplysymbol.EmployeeName;
        emplysymbol.EmployeeID = emplysymbol.EmployeeID;
    
        // Provide a tooltip for the employee symbol.
        emplysymbol.SetPropertyValue("ALT", String.Concat("Click to view ", emplysymbol.EmployeeName, "'s contact information."));
        this.DiagramWebControl1.Model.AppendChild(emplysymbol);
    }

**VB**

    Protected Sub LoadNodeDisplayData()
    
    Dim emplysymbol As EmployeeSymbol = New EmployeeSymbol()
    
    emplysymbol.EmployeeName = emplysymbol.EmployeeName
    
    emplysymbol.EmployeeID = emplysymbol.EmployeeID
    
    ' Provide a tooltip for the employee symbol.
    
    emplysymbol.SetPropertyValue("ALT", String.Concat("Click to view ", emplysymbol.EmployeeName, "'s contact information."))
    
    Me.DiagramWebControl1.Model.AppendChild(emplysymbol)
    
    End Sub

This approach is also implemented in Diagram.web\Samples\1.1\CustomDescriptor sample.

# How to control the ports visibility of a node in WinForms Diagram?

## How to control the ports visibility of a node?

This can be done by using the node''s DrawPorts property value in [WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram "https://www.syncfusion.com/winforms-ui-controls/diagram"). By default it has a TRUE value.

[Syncfusion® Inc.](https://www.syncfusion.com/)

https://www.syncfusion.com/

**Conclusion**

I hope you enjoyed learning about how to control the ports visibility of a node in WinForms Diagram.

You can refer to our[WinForms Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations. You can also explore our [documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# Can I create and new ports to a Symbol at runtime?

## Can I create and new ports to a Symbol at runtime?

Essential® Diagram allows you to create new ports and add them to a symbol at runtime. Creating a new port is simply a matter of instantiating the required port, adding it to your symbol's Symbol.Ports collection, and specifying the port location. The following code should give you an idea:

The Diagram.Windows\Samples\Symbol Design\PortsAhoy sample that ships with the product demonstrates how to create and add new ports to a symbol.

**C#**

Symbol mysymbol; // Symbol reference
    // Center the port on the symbol
    PointF pt = new PointF(mysymbol.X + mysymbol.Width / 2, mysymbol.Y + mysymbol.Height / 2);
    CirclePort port = new CirclePort(pt);
    mysymbol.Ports.Add(port);
    port.Location = pt;

**VB**

Private mysymbol As Symbol ' Symbol reference
    ' Center the port on the symbol
    Private pt As PointF = New PointF(mysymbol.X + mysymbol.Width / 2, mysymbol.Y + mysymbol.Height / 2)
    Private port As CirclePort = New CirclePort(pt)
    mysymbol.Ports.Add(port)
    Private port.Location = pt

**Conclusion**

I hope you enjoyed learning about creating and adding new ports to a Symbol at runtime.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How do I access the Palettes that are loaded Programmatically using the PaletteGroupBar.LoadPalette()?

## Load palettes programmatically

Palettes can be loaded programmatically through the PaletteGroupBar.LoadPalette(). This method returns the instance of the PaletteGroupView control that holds the palette. Once we have the instance of the PaletteGroupView control, it can be accessed easily.

This following code snippet shows the above mentioned informations.

**C#**

////////////////////////////////////////////////////////////////////////////////////////////////////
    /* Add the following code snippet to the DiagramBuilder Sample's MainForm_Load() event method */
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    // Create an instance for the PaletteGroupView class and let the instance hold the reference for the palette files.
    PaletteGroupView paletteGroupView = this.symbolPaletteGroupBar.LoadPalette(symbolpalettepath + "\Basic Shapes.edp");
    // Set the Back/Fore color for the palette files of your interest by making use of this PaletteGroupView object.
    paletteGroupView.BackColor = Color.Red;
    paletteGroupView.ForeColor = Color.White;
    // Set the BorderStyle and Font property of the palette files.
    paletteGroupView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
    paletteGroupView.Font = new Font("Arial", 12f, System.Drawing.FontStyle.Bold);
    // Set the HighlightItemColor property of the palette files.
    paletteGroupView.HighlightItemColor = Color.YellowGreen;

**VB**

////////////////////////////////////////////////////////////////////////////////////////////////////
    /* Add the following code snippet to the DiagramBuilder Sample's MainForm_Load() event method */
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    ' Create an instance for the PaletteGroupView class and let the instance hold the reference for the palette files.
    Private paletteGroupView As Syncfusion.Windows.Forms.Diagram.Controls.PaletteGroupView
    paletteGroupView = Me.symbolPaletteGroupBar.LoadPalette(symbolpalettepath & "\Basic Shapes.edp")
    ' Set the background color of the palette files of your interest by making use of this PaletteGroupView object.
    paletteGroupView.BackColor = System.Drawing.Color.Red
    paletteGroupView.ForeColor = System.Drawing.Color.White
    ' Set the BorderStyle and Font property of the palette files.
    paletteGroupView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
    paletteGroupView.Font = New Font("Arial", 12f, System.Drawing.FontStyle.Bold)
    ' Set the HighlightItemColor property of the palette files.
    paletteGroupView.HighlightItemColor = Color.YellowGreen

**Conclusion**

I hope you enjoyed learning about how to access the palettes that are loaded programmatically using the PaletteGroupBar.LoadPalette().

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to control the port's connection type,connection point can be connected with?

## How to control the port's connection type,connection point can be connected with?

This can be done by using the port's ConnectionPointType property value. By deafult it has IncomingOutgoing value. It means that the connection can be drawn to and from the port.

[Syncfusion® Inc.](https://www.syncfusion.com/)

# Is it possible to get a list of the nodes in a diagram in order of their position in the Z-Order?

Is it possible to get a list of the nodes in a diagram in order of their position in the Z-Order?

Accessing the diagram's child nodes through the model layers will let you get hold of the nodes according to their Z-order. Populating the 'nodesInZOrder' list in the manner shown below will set it up with the diagram's child nodes in order of increasing Z-order, i.e., the bottom-most node will be the first item in the list while the topmost node will be the last.

**C#**

ArrayList nodesInZOrder = new ArrayList();
    foreach (Layer layer in this.diagramComponent.Model.Layers)
    {
        IEnumerator inodes = layer.GetEnumerator();
        while (inodes.MoveNext())
        {
            nodesInZOrder.Add(inodes.Current);
        }
    }

**VB**

Dim nodesInZOrder As ArrayList = New ArrayList()
    Dim layer As Layer
    For Each layer In Me.diagramComponent.Model.Layers
        Dim inodes As IEnumerator = layer.GetEnumerator()
        While inodes.MoveNext()
            nodesInZOrder.Add(inodes.Current)
        End While
    Next

**Conclusion**

I hope you enjoyed learning about whether it is possible to get a list of the nodes in a diagram in order of their position in the Z-Order.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# I have a handler for a diagram node click event. How do I determine the identity of the node from the event argument?

## I have a handler for a diagram node click event. How do I determine the identity of the node from the event argument?

The node(s) referenced by a diagram node-related event, such as Diagram.NodeClick, Diagram.NodeMoved, etc., will be an instance of the actual object, and you can use the node's type information to ascertain its identity. If the node has been assigned a uniquely identifiable name at some point during creation, then the Node.Name property can be used as well to access a particular node instance. The following code should give an idea:

**C#**

// Handler for the Diagram.NodeClick event. Determine the node that was clicked on
    private void diagramComponent_NodeClick(object sender, Syncfusion.Windows.Forms.Diagram.NodeMouseEventArgs evtArgs)
    {
        // Check whether the node clicked is a custom symbol
        if (evtArgs.Node is MySymbol)
        {
            Trace.WriteLine("Node is a custom symbol type");
            MySymbol mysmbl = evtArgs.Node as MySymbol;
            MessageBox.Show(String.Concat("The custom symbol name is '", mysmbl.Name, "'"));
        }
        else if (evtArgs.Node is Symbol)
        {
            Trace.WriteLine("Node is a generic symbol");
            Symbol symbl = evtArgs.Node as Symbol;
            MessageBox.Show(String.Concat("The symbol name is '", symbl.Name, "'"));
        }
        else // Node is a non-Symbol node
        {
            // Ignore if the event is being generated for a Symbol's child node
            if ((evtArgs.Node.Parent != null) && !(evtArgs.Node.Parent is Symbol))
            {
                Trace.WriteLine(evtArgs.Node.GetType());
                MessageBox.Show(String.Concat("The node name is '", evtArgs.Node.Name, "'"));
            }
        }
    }

**VB**

' Handler for the Diagram.NodeClick event. Determine the node that was clicked on
    Private Sub diagramComponent_NodeClick(ByVal sender As Object, ByVal evtArgs As Syncfusion.Windows.Forms.Diagram.NodeMouseEventArgs)
        ' Check whether the node clicked is a custom symbol
        If TypeOf evtArgs.Node Is MySymbol Then
            Trace.WriteLine("Node is a custom symbol type")
            Dim mysmbl As MySymbol = evtArgs.Node As MySymbol
            MessageBox.Show(String.Concat("The custom symbol name is '", mysmbl.Name, "'"))
        ElseIf TypeOf evtArgs.Node Is Symbol Then
            Trace.WriteLine("Node is a generic symbol")
            Dim symbl As Symbol = evtArgs.Node As Symbol
            MessageBox.Show(String.Concat("The symbol name is '", symbl.Name, "'"))
        Else ' Node is a non-Symbol node
            ' Ignore if the event is being generated for a Symbol's child node
            If Not (evtArgs.Node.Parent Is Symbol) Then
                Trace.WriteLine(evtArgs.Node.GetType())
                MessageBox.Show(String.Concat("The node name is '", evtArgs.Node.Name, "'"))
            End If
        End If
    End Sub

**Conclusion**

I hope you enjoyed learning about having a handler for a diagram node click event and determining the identity of the node from the event argument.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How do I change the background of the diagram control?

## Change background of the diagram control

The diagram control''s background is provided by the Diagram''s Model component. To change the background you will have to provide suitable values for the diagram.Model.BackgroundStyle property.

To set an image for the background you can assign the image to the diagram.Model.BackgroundStyle.Texture property, set the BackgroundStyle.Type as Texture and the TextureWrapMode to Tile, Clamp or one of the other options. The fllowing code should give you an idea,

    this.diagramComponent.Model.BackgroundStyle.Texture = ((System.Drawing.Image)(resources.GetObject("diagramComponent.Model.BackgroundStyle.Texture")));
    
    this.diagramComponent.Model.BackgroundStyle.Type = Syncfusion.Windows.Forms.Diagram.BackgroundStyleType.Texture;

    Private Me.diagramComponent.Model.BackgroundStyle.Texture = (CType(resources.GetObject("diagramComponent.Model.BackgroundStyle.Texture"), System.Drawing.Image))
    
    Private Me.diagramComponent.Model.BackgroundStyle.Type = Syncfusion.Windows.Forms.Diagram.BackgroundStyleType.Texture

For additional information:

Please refer to the Class Reference documentation on the Syncfusion.Windows.Forms.Diagram.Model.BackgroundStyle property and the Syncfusion.Windows.Forms.Diagram.BackgroundStyle class for additional details on setting the diagram background.

**Conclusion**

I hope you enjoyed learning about how to change the background of the diagram control.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How do I set the document page margins in WinForms DocIO?

Syncfusion® Essential® DocIO is a [.NET Word library](https://www.syncfusion.com/document-processing/word-framework/net/word-library) used to create, read, and edit Word documents programmatically without Microsoft Word or interop dependencies. Using this library, you can set page margins for Word document through [MarginsF](https://help.syncfusion.com/cr/file-formats/Syncfusion.DocIO.DLS.MarginsF.html) class. You can set the document page margin settings like margin’s left, right, top and bottom. Then its object is assigned to [section.PageSetup.Margins](https://help.syncfusion.com/cr/file-formats/Syncfusion.DocIO.DLS.Margins.html) API.

## Set page margins for Word document programmatically in C#

C#

// Setting document page margins.
    MarginsF pagemargins = new MarginsF();
    pagemargins.Bottom = 100;
    pagemargins.Top = 100;
    pagemargins.Left = 75;
    pagemargins.Right = 75;
    // Assigning document page margins to the current section.
    section.PageSetup.Margins = pagemargins;
VB

' Setting document page margins.
    Dim pagemargins As MarginsF = New MarginsF()
    pagemargins.Bottom = 100
    pagemargins.Top = 100
    pagemargins.Left = 75
    pagemargins.Right = 75
    ' Assigning document page margins to the current section.
    section.PageSetup.Margins = pagemargins

A complete working example of how to set page margins for Word document in C# can be downloaded from [Page-Margins\_In-Word.zip](https://www.syncfusion.com/downloads/support/directtrac/general/ze/PageMarginsInWordDocument1883390882)

**Note:**
Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, include a license key in your projects. Refer to [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to learn about generating and registering Syncfusion® license key in your application to use the components without trail message.

**Conclusion**

I hope you
enjoyed learning about how do I set the document page margins in WinForms DocIO.

You
can refer to our [DocIo feature tour](https://www.syncfusion.com/document-processing/pdf-framework/net) page to know about its other groundbreaking
feature representations. You can also explore our[documentation](https://help.syncfusion.com/file-formats/docio/create-word-document-in-windows-forms) to understand how to create and manipulate data.

For current
customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try
our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have
any queries or require clarifications, please let us know in the comments
section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://support.syncfusion.com/create),
or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=docio). We are always happy to assist you!

# How to add and customize symbols in WinForms Chart?

To add symbols to a chart using Syncfusion® [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Chart"), you can use the following code snippet:

    this.ChartWebControl1.Series[0].Style.Symbol.Shape = ChartSymbolShape.InvertedTriangle;

    columnChart.Series(0).Style.Symbol.Shape = ChartSymbolShape.InvertedTriangle

You can also customize the color, size, and border width of the symbol with the following code:

    this.ChartWebControl1.Series[0].Style.Symbol.Color = Color.Red;this.ChartWebControl1.Series[0].Style.Symbol.Size = new Size(15,15);
    this.ChartWebControl1.Series[0].Style.Symbol.Border.Width = 2;

columnChart.Series(0).Style.Symbol.Color = Color.Red
    columnChart.Series(0).Style.Symbol.Size = New Size(15, 15)
    columnChart.Series(0).Style.Symbol.Border.Width = 2

**Output:**

![Chart series symbol customization ](https://support.syncfusion.com/kb/attachment/article/1123/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0NTg5Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.2mrWe1ba-ejGtl8gGq-Hg0gWeAnXKCrJEIgUizYsn1Y)

**Conclusion**

I hope you enjoyed learning about how to add and customize symbols in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How can I detect a right-click in a symbol?

## How can I detect a right-click in a symbol?

We will be implementing left and right mouse button click events that can be handled from within the Model instance similar to the current Model.Click events. Currently you can work around this by using the Diagram's MouseUp event as demonstrated by the following code sample:

[C#]

private void diagram1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e){   if (e.Button == MouseButtons.Right)   {       foreach (INode curNode in this.diagram1.Controller.NodesHit)       {            if (curNode.GetType() == typeof(MySymbol))                MessageBox.Show(String.Concat("Right Click on: ", curNode.Name));       }
       }}
[VB.NET]

Private  Sub diagram1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) If e.Button = MouseButtons.Right Then Dim curNode As INode For Each curNode In Me.diagram1.Controller.NodesHit If curNode.GetType() = Type.GetType(MySymbol) Then MessageBox.Show(String.Concat("Right Click on: ", curNode.Name)) End If Next   End If End Sub
**Conclusion**

I hope you enjoyed learning about how to detect a right-click in a symbol.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to add striplines to a chart?

Striplines can be added to chart using the StripLines property of the ChartAxis class. The Interior, Width, RepeatEvery, etc., properties have to be set for the striplines to be displayed in the chart.

The following code snippet is an example for adding striplines to a chart.

    <syncfusion:ChartArea>   <syncfusion:ChartArea.PrimaryAxis>     <syncfusion:ChartAxis syncfusion:ChartArea.ShowGridLines="False">       <syncfusion:ChartAxis.StripLines>         <syncfusion:ChartStripLine Interior="BlanchedAlmond" Width="1" RepeatEvery="1"/>       </syncfusion:ChartAxis.StripLines>     </syncfusion:ChartAxis>   </syncfusion:ChartArea.PrimaryAxis> </syncfusion:ChartArea>

# What are the chart types to which custom templates can be applied?

Custom Templates can be applied to any type of elements such as label, lines, text blocks, series etc., in any type of chart.

The following code snippet is a sample template for area chart.

XAML

&lt;DataTemplate x:Key="AreaTemplate1"&gt;       &lt;Canvas&gt;         &lt;Path Name="Path"  Data="{Binding Geometry}"  Fill="#65938866" Stroke="Black"/&gt;         &lt;Line X1="{Binding X1}"  X2="{Binding X2}"  Y1="{Binding Y1}"  Y2="{Binding Y2}"  StrokeThickness="1"  Stroke="Black"/&gt;       &lt;/Canvas&gt;    &lt;/DataTemplate&gt;

# What are the image formats to which a chart can be exported?

WPF Chart can be exported to following image formats

- Bitmap (.bmp)
- JPG
- PNG
- XPS
- GIF
- TIFF
- WDP

# How to print a chart?

You can print a whole chart or selected area in a chart using the print and SwitchPrinting commands, respectively. The CommandTarget property is bound to chart element.

The following code is used to print the chart.

XAML

&lt;Button Content="Print" Command="{x:Static ApplicationCommands.Print}" CommandTarget="{Binding ElementName=Chart1}" Height="22" Width="85" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;

&lt;Button Content="Printing Mode" Command="{x:Static syncfusion:ChartCommands.SwitchPrinting}" CommandTarget="{Binding ElementName=Chart1}" Height="22" Width="85" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;

# How to export a chart as an image?

A chart can be exported to an image format by using the Command and CommandTarget properties.

The following code is used to export a chart to an image format.

XAML

&lt;Button Content="Save" Command="{x:Static ApplicationCommands.Save}" CommandTarget="{Binding ElementName=Chart1}" Height="25" Width="100" HorizontalAlignment="Center" VerticalAlignment="Center"/&gt;

# Can I host Windows Forms Controls inside a Diagram?

Yes, Essential® Diagram has a Syncfusion.Windows.Forms.Diagram.ControlNode node class that allows you to host Windows Forms controls inside a diagram. The ControlNode type can serve as a container for almost any type of Windows Forms control and can be used as the child node of a symbol or as a top-level child of the diagram model itself. ControlNodes can be created and activated using the interactive Syncfusion.Windows.Forms.Diagram.ControlNodeTool. Control activation is determined by the ControlNode.ActivateStyle property.

The 'QuickStart\ControlsGalore' sample that ships with Essential® Diagram demonstrates the ControlNode and ControlNodeTool classes.

# How can I progammatically add a symbol from the palette?

## How can I programmatically add a symbol from the palette?

The following code sample demonstrates how you can programmatically add a symbol from the symbol palette to a Diagram.

[C#]

//New InsertNodesCmd InsertNodesCmd insCmd = new InsertNodesCmd();
    // Select the Symbol from the PaletteGroupView
    this.paletteGroupView1.SelectSymbolModel(this.paletteGroupView1.GroupViewItems[1].Text);
    SymbolModel symModel = this.paletteGroupView1.SelectedSymbolModel;
    // New NodeCollection
    NodeCollection nodes = new NodeCollection();
    // Add Symbol to the NodeCollection
    if (symModel != null)
    {
        Symbol triangle = symModel.CreateSymbol();
        nodes.Add(triangle);
    }
    insCmd.Nodes.Concat(nodes);
    insCmd.Location = new PointF(125, 125);
    // ExecuteCommand to add the Symbol
    this.diagram1.Controller.ExecuteCommand(insCmd);

[VB.NET]

' New InsertNodesCmd
    Dim insCmd As New InsertNodesCmd()
    ' Select the Triangle from the PaletteGroupView
    Me.paletteGroupView1.SelectSymbolModel(Me.paletteGroupView1.GroupViewItems(1).Text)
    Dim symModel As SymbolModel = Me.paletteGroupView1.SelectedSymbolModel
    ' New NodeCollection
    Dim nodes As New NodeCollection()
    ' Add Symbol to the NodeCollection
    If Not (symModel Is Nothing) Then
        Dim triangle As Symbol = symModel.CreateSymbol()
        nodes.Add(triangle)
    End If
    insCmd.Nodes.Concat(nodes)
    insCmd.Location = New PointF(125, 125)
    ' Execute the InsertNodesCmd
    Me.diagram1.Controller.ExecuteCommand(insCmd)

**Conclusion**

I hope you enjoyed learning about how can I programmatically add a symbol from the palette.

You can refer to our [WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram)feature tour page to learn about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [WinForms Diagram example](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to add hyperlinks to Gantt chart?

A Gantt chart is a graphical representation of the duration of tasks against the progression of time. This chart is excellent for planning the use of resources, and data can be plotted using a date-time scale or a numerical scale.

Hyperlink support in Gantt chart:

We can provide hyperlink support to gantt chart.

If we click any Gantt Chart region in the sample it will redirect to Syncfusion page. We can customize this link using ChartRegionLink event.

**C#**

    this.ChartWebControl1.ChartRegionLink += new ChartRegionLinkHandler(ChartWebControl1_ChartRegionLink);

In the sample link below, three real points are calculated for each two chart points to which the line is drawn.

[Gantt Chart with Connection lines](http://files.syncfusion.com/support/Chart.Web/7.1.0.21/GanttChart/main.htm)

# How to color the chart elements in run-time?

Essential chart allows you to color every part of the chart, such as series, labels, axis, etc., in run-time. The following code shows how a chart series, labels, axis, etc., can be colored when these elements are hit by mouse.

C#

//Events raised on series mouse click - Sets series interior

private void ChartSeries\_MouseClick(object sender, ChartMouseEventArgs e)

{

area.Series[0].Interior = Brushes.Green;

area.Series[1].Interior = Brushes.Blue;

ChartSeries series1 = sender as ChartSeries;

series1.Interior = Brushes.Orange;

}

C#

//Events raised on axis mouse down - Sets axis linestroke and label color

private void ChartAxis\_MouseDown(object sender, MouseButtonEventArgs e)

{

ChartAxis axis = sender as ChartAxis;

HitTestResult result = VisualTreeHelper.HitTest(area, e.GetPosition(area));

if (result != null)

{

FrameworkElement hitElement = result.VisualHit as FrameworkElement;

//Colors the Chart Axis labels

if (hitElement.GetType() == typeof(TextBlock))

{

TextBlock txtBlk = hitElement as TextBlock;

txtBlk.Foreground = Brushes.Orange;

}

//Colors the Axis linestroke

if (hitElement.GetType() == typeof(ChartCartesianAxisElement))

{

axis.LineStroke.Brush = Brushes.Orange;

}

}

}

Refer to the attached sample, which illustrates this feature.

# How do I create a custom symbol?

The following code sample demonstrates how you can create a custom symbol and use it in Essential Diagram:

1. Create the custom symbol:

[C#]

// Custom Symbol (MySymbol.cs)public class MySymbol : Symbol {  private Syncfusion.Windows.Forms.Diagram.Rectangle outerRect = null;  private Ellipse innerEllipse = null;                                    public MySymbol() {    //////////////////////////////////////////////////////////////////    // Add child nodes to the symbol programmatically    //////////////////////////////////////////////////////////////////     // Add an outer rectangle    this.outerRect = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 120, 80);    this.outerRect.Name = "Rectangle";    this.outerRect.FillStyle.Color = Color.Khaki;    this.AppendChild(outerRect);     // Add an inner ellipse    this.innerEllipse = new Ellipse(10, 10, 100, 60);    this.innerEllipse.Name = "Ellipse";    this.AppendChild(innerEllipse);     // Add Label    Label lbl = this.AddLabel("My Symbol", BoxPosition.Center);    lbl.BackgroundStyle.Color = Color.Transparent;  }}

[VB.NET]

' Custom Symbol (MySymbol.vb)Public Class MySymbol  Inherits Symbol   Private outerRect As Syncfusion.Windows.Forms.Diagram.Rectangle = Nothing  Private innerEllipse As Ellipse = Nothing   Public Sub New()     ' Add child nodes to the symbol programmatically     ' Add an outer rectangle    Me.outerRect = New Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 120, 80)    Me.outerRect.Name = "Rectangle"    Me.outerRect.FillStyle.Color = Color.Khaki    Me.AppendChild(outerRect)     ' Add an inner ellipse    Me.innerEllipse = New Ellipse(10, 10, 100, 60)    Me.innerEllipse.Name = "Ellipse"    Me.AppendChild(innerEllipse)     ' Add Label    Dim lbl As Label = Me.AddLabel("My Symbol", BoxPosition.Center)    lbl.BackgroundStyle.Color = Color.Transparent  End Sub ' NewEnd Class ' MySymbol

2. Using the symbol in the form:

[C#]

//Register InsertTool for MySymbol this.diagram1.Controller.RegisterTool(new InsertSymbolTool("InsertMySymbol", typeof(MySymbol)));
    //Activate InsertTool for MySymbol this.diagram1.ActivateTool("InsertMySymbol");

[VB.NET]

'Register InsertTool for MySymbol Me.diagram1.Controller.RegisterTool(New InsertSymbolTool("InsertMySymbol", GetType(MySymbol)))
    'Activate InsertTool for MySymbol Me.diagram1.ActivateTool("InsertMySymbol")

**Conclusion**

I hope you enjoyed learning about how to create a custom symbol.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# Can I copy and paste images from MS Office applications onto the Diagram?

## Can I copy and paste images from MS Office applications onto the Diagram?

Essential® Diagram does not have pre-built support for interfacing with clipboard copy/paste from the MS Office applications. The Diagram copy/paste implementation is confined to 'Node' type drawing objects that are native to the Essential® Diagram. To copy/paste an image, the Clipboard's data object should be an instance of the Diagram.ClipboardNodeCollection type populated with a Diagram.BitmapNode or a Diagram.MetafileNode that wraps the image. Since .NET uses its own format that is not compatible with the EnhancedMetafile format, you will have to use reflection to achieve this feature of copying and pasting images from MS Office applications like Excel, PowerPoint, Word, or Visio.

The sample provided in this Knowledge Base article demonstrates how you can add support to your Essential® Diagram application to allow copy/paste from MS Office.

[C#]

using System.Runtime.InteropServices;using System.Reflection;public const uint CF_METAFILEPICT = 3;public const uint CF_ENHMETAFILE = 14;[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]public static extern bool OpenClipboard(IntPtr hWndNewOwner);[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]public static extern bool CloseClipboard();[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]public static extern IntPtr GetClipboardData(uint format);[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]public static extern bool IsClipboardFormatAvailable(uint format);// Handle EnhancedMetafile format from the clipboard and insertprivate void OnDiagramKeyUp(object sender, KeyEventArgs e){    if (e.Control && e.KeyCode == Keys.V)    {                                       Metafile emf = null;        if (OpenClipboard(IntPtr.Zero))        {            if (IsClipboardFormatAvailable(CF_ENHMETAFILE))            {                var ptr = GetClipboardData(CF_ENHMETAFILE);                if (!ptr.Equals(IntPtr.Zero))                    emf = new Metafile(ptr, true);            }              // You must close it, or it will be locked            CloseClipboard();             MetafileNode metanode = new MetafileNode(emf, new RectangleF(100, 100, 500, 500));            diagram1.Model.AppendChild(metanode);        }    }}

[VB]

'INSTANT VB NOTE: This code snippet uses implicit typing. You will need to set 'Option Infer On' in the VB file or set 'Option Infer' at the project level:
     
     Public Const CF_METAFILEPICT As UInteger = 3
     Public Const CF_ENHMETAFILE As UInteger = 14
     
      <DllImport("user32.dll", CharSet := CharSet.Auto, ExactSpelling := True)>
      Public Shared Function OpenClipboard(ByVal hWndNewOwner As IntPtr) As Boolean
      End Function
     
      <DllImport("user32.dll", CharSet := CharSet.Auto, ExactSpelling := True)>
      Public Shared Function CloseClipboard() As Boolean
      End Function
     
      <DllImport("user32.dll", CharSet := CharSet.Auto, ExactSpelling := True)>
      Public Shared Function GetClipboardData(ByVal format As UInteger) As IntPtr
      End Function
     
      <DllImport("user32.dll", CharSet := CharSet.Auto, ExactSpelling := True)>
      Public Shared Function IsClipboardFormatAvailable(ByVal format As UInteger) As Boolean
      End Function
     
      Private Sub OnDiagramKeyUp(ByVal sender As Object, ByVal e As KeyEventArgs)
       If e.Control AndAlso e.KeyCode = Keys.V Then
     
        Dim emf As Metafile = Nothing
        If OpenClipboard(IntPtr.Zero) Then
         If IsClipboardFormatAvailable(CF_ENHMETAFILE) Then
          Dim ptr = GetClipboardData(CF_ENHMETAFILE)
          If Not ptr.Equals(IntPtr.Zero) Then
           emf = New Metafile(ptr, True)
          End If
         End If
     
         ' You must close ir, or it will be locked
         CloseClipboard()
     
         Dim metanode As New MetafileNode(emf, New RectangleF(100, 100, 500, 500))
         diagram1.Model.AppendChild(metanode)
        End If
       End If
      End Sub

[Sample](http://www.syncfusion.com/downloads/support/directtrac/general/ze/CopyPasteGroupNode-513395737.zip)

**Conclusion**

I hope you enjoyed learning about "Can I copy and paste images from MS Office applications onto the Diagram."

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to hide a line segment from rendering?

Using the extensible feature set of WPF, Essential Chart allows you to customize the segments rendering as desired. If you want to make an empty point in the desired Y value or to make a difference in a point, use template for the ChartSeries, which will render gaps for the specified empty points.

    <DataTemplate x:Key="Template1">   <Line Name="Line1" X1="{Binding X1}" X2="{Binding X2}" Y1="{Binding Y1}" Y2="{Binding Y2}" StrokeThickness="2" Stroke="{Binding Interior}" />     <DataTemplate.Triggers>       <DataTrigger Binding="{Binding Path=CorrespondingPoints[0].DataPoint.Y}" Value="6" >         <Setter Property="Stroke" Value="Transparent" TargetName="Line1" />       </DataTrigger>       <DataTrigger Binding="{Binding Path=CorrespondingPoints[1].DataPoint.Y}" Value="6" >         <Setter Property="Stroke" Value="Transparent" TargetName="Line1" />       </DataTrigger>     </DataTemplate.Triggers>   </DataTemplate>

Refer to the attached sample which illustrates this feature.

# Why do I encounter problems when attempting to serialize a custom symbol type?

## Why do I encounter problems when attempting to serialize a custom symbol type?

The Essential® Diagram base symbol type implements custom serialization and deserialization behavior through the ISerializable interface. Therefore all custom symbol classes that derive from this type will have to implement both the signature serialization Constructor(SerializationInfo info, StreamingContext context) and the ISerializable.GetObjectData(SerializationInfo information, StreamingContext context) method as well and call the respective base class methods.

During serialization, any serializable members belonging to the custom symbol class should be written to the SerializationInfo param in the GetObjectData() method and upon deserialization should be populated with the equivalent values from the SerializationInfo param provided by the serialization constructor.

The following sample shows the serialization implementation for a custom symbol class:

[C#]

///  /// The MySymbol class implements a custom Essential Diagram Symbol type.  ///  [  Serializable(),  TypeConverter(typeof(MySymbolConverter))  ]  public class MySymbol : Symbol  {
      Protected bool bClrFlag = false;
      ///   /// Default constructor.   ///   public MySymbol()   {   }   
      ///   /// Serialization constructor for the MySymbol class.   ///   /// Serialization state information   /// Streaming context information   protected MySymbol(SerializationInfo info, StreamingContext context) : base(info, context)   {    // The Serialization constructor is invoked during deserialization or during a drag & drop operation.    // If the MySymbol type has serializable members, then initialize them with the serialized data    // obtained from the SerializationInfo param
       // Read the bClrFlag member value from the SerializationInfo object    this.bClrFlag = info.GetBoolean("ColorFlag");   }
      // Override SymbolBase.GetObjectData() and populate the SerializationInfo param   // with the data (if any) that belongs to the MySymbol type . This data will be   // serialized as a part of the Symbol object.   protected override void GetObjectData(SerializationInfo info, StreamingContext context)   {    base.GetObjectData(info, context);
       // Populate the SerializationInfo object with the bClrFlag member data    info.AddValue("ColorFlag", this.bClrFlag);   }       }

[VB.NET]

Public Class MySymbol     Inherits Symbol
        Protected bClrFlag As Boolean         '/     '/ Default constructor.     '/     Public Sub New()     End Sub 'New               '/     '/ Serialization constructor for symbols.     '/     '/ Serialization state information     '/ Streaming context information     Protected Sub New(info As SerializationInfo, context As StreamingContext)         MyBase.New(info, context)
            ' The Serialization constructor is invoked during deserialization or during a drag & drop operation.         ' If the MySymbol type has serializable members, then initialize them with the serialized data         ' obtained from the SerializationInfo param
            ' Populate the bClrFlag member with the value read from the SerializationInfo object         Me.bClrFlag = info.GetBoolean("ColorFlag")     End Sub 'New
        ' Override SymbolBase.GetObjectData() and populate the SerializationInfo param     ' with the data (if any) that belongs to the MySymbol type. This data will be     ' serialized as a part of the MySymbol object.     Protected Overrides Sub GetObjectData(ByVal info As SerializationInfo, ByVal context As StreamingContext)         MyBase.GetObjectData(info, context)
            ' Populate the SerializationInfo object with the bClrFlag member data         info.AddValue("ColorFlag", Me.bClrFlag)     End Sub
        End Class 'MySymbol

**Conclusion**

I hope you enjoyed learning about why you encounter problems when attempting to serialize a custom symbol type.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How can I add a custom property to the Diagram? How can I display the property in the Property Editor?

**How can I add a custom property to the Diagram? How can I display the property in the Property Editor?**

The sample included in this Knowledge Base article demonstrates how you can add a custom property to the Diagram and also display it in the the Property Editor. This sample uses a derived Diagram (MyDiagram) whose CreateModel method is overridden to use a derived Model (MyModel). MyModel’s SetDefaultPropertyValues is overridden to add the new MyCustomProperty property using the SetPropertyValue method. This property is displayed under a new category and also includes a description.

When you build and run the sample you can now see the new property (MyCustomProperty) in the Property Editor in the MyProperties category.

[C#]

    // Derived Diagram
    public class MyDiagram : Syncfusion.Windows.Forms.Diagram.Controls.Diagram {
    
      public override Model CreateModel() {
    
      return new QuickStart.MainForm.MyModel();
    }
    }
    
    // Derived Model where the new property is added
    public class MyModel : Syncfusion.Windows.Forms.Diagram.Model {
    
      public override void SetDefaultPropertyValues() {
      base.SetDefaultPropertyValues();
      this.SetPropertyValue("MyCustomProperty", 0);
    }
    
      [
      Browsable(true),
      Category("MyProperties"),
      Description("Description for MyCustomProperty")
    ]
    public int MyCustomProperty {
      get {
      object value = this.GetPropertyValue("MyCustomProperty");
      if (value != null) {
    
        return (int)value;
    
        }
    
        return 0;
      }
    }
    }

[VB.NET]

// Derived Diagram
    Public Class MyDiagram
            Inherits Syncfusion.Windows.Forms.Diagram.Controls.Diagram
    
             Public Overrides Function CreateModel() As Model
                
                Return New QuickStart.MainForm.MyModel()
            End Function 'CreateModel
    End Class
    
    // Derived Model where the new property is added
    Public Class MyModel
            Inherits Syncfusion.Windows.Forms.Diagram.Model
    
             Public Overrides Sub SetDefaultPropertyValues()
                MyBase.SetDefaultPropertyValues()
                Me.SetPropertyValue("MyCustomProperty", 0)
            End Sub 'SetDefaultPropertyValues
    
             _
            Public ReadOnly Property MyCustomProperty() As Integer
                Get
                    Dim value As Object = Me.GetPropertyValue("MyCustomProperty")
                    If Not (value Is Nothing) Then
                        
                        Return Fix(value)
                    End If
                    
                    Return 0
                End Get
            End Property
    End Class 'MyModel

**Conclusion**

I hope you enjoyed learning about how to add a custom property to the Diagram and display it in the Property Editor.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to add a table in a bookmark location?

DocIO provides support for adding a table into an existing bookmark. The following code snippet illustrates how to insert a table into the specified bookmark.

**C#**

    // Create a new instance for Word document
    
    WordDocument document = new WordDocument();
    
    // Open the existing Word document containing a bookmark
    
    document.Open("Bookmark_Template.doc");
    
    // Create a new table
    
    IWTable table = new WTable(document);
    
    table.ResetCells(3, 2);
    
    table.Rows[0].Cells[0].AddParagraph().AppendText("Sno");
    
    table.Rows[0].Cells[1].AddParagraph().AppendText("Product");
    
    table.Rows[0].IsHeader = true;
    
    table.Rows[1].Cells[0].AddParagraph().AppendText("1.");
    
    table.Rows[1].Cells[1].AddParagraph().AppendText("Essential DocIO");        
    
    table.Rows[2].Cells[0].AddParagraph().AppendText("2.");
    
    table.Rows[2].Cells[1].AddParagraph().AppendText("Essential Pdf");
    
    // Create a new instance for Bookmark Navigator
    
    BookmarksNavigator bk = new BookmarksNavigator(document);
    
    // Move to the specified bookmark
    
    bk.MoveToBookmark("Table");
    
    // Insert the table into the specified bookmark location
    
    bk.InsertTable(table);
    
    document.Save("Sample.doc", FormatType.Doc);

**VB**

    'Create a new instance for Word document
    
    Dim document As New WordDocument()
    
    'Open the existing Word document containing a bookmark
    
    document.Open("Bookmark_Template.doc")
    
    'Create a new table
    
    Dim table As IWTable = New WTable(document)
    
    table.ResetCells(3, 2)
    
    table.Rows(0).Cells(0).AddParagraph().AppendText("Sno")
    
    table.Rows(0).Cells(1).AddParagraph().AppendText("Product")
    
    table.Rows(0).IsHeader = True
    
    table.Rows(1).Cells(0).AddParagraph().AppendText("1.")
    
    table.Rows(1).Cells(1).AddParagraph().AppendText("Essential DocIO")
    
    table.Rows(2).Cells(0).AddParagraph().AppendText("2.")
    
    table.Rows(2).Cells(1).AddParagraph().AppendText("Essential Pdf")
    
    'Create a new instance for bookmark navigator
    
    Dim bk As New BookmarksNavigator(document)
    
    'Move to the specified bookmark
    
    bk.MoveToBookmark("Table")
    
    'Insert the table into the specified bookmark location
    
    bk.InsertTable(table)
    
    document.Save("Sample.doc", FormatType.Doc)

Please refer to the sample in the link below which illustrates the above:

[http://help.syncfusion.com/samples/DocIO.Web/DocIOWebSamples/AddTableToBkMark/main.htm](http://help.syncfusion.com/samples/DocIO.Web/DocIOWebSamples/AddTableToBkMark/main.htm)

# Is it possible to set DateTime Range and DateTime Intervals?

Chart control has the ability to have date-time values. In addition to this, the axis range and interval can also be set for date-time values. Refer to the attached sample and the following code snippets for using this feature.

Date-time range can be set using the Axis.DateTimeRange property.

**C#**

    Chart1.Areas[0].PrimaryAxis.IsAutoSetRange = false;
    
    Chart1.Areas[0].PrimaryAxis.DateTimeRange = new DateTimeRange(new DateTime(2009, 2, 1, 0, 0, 0), new DateTime(2009, 2, 15, 0, 0, 0));

Date-time interval can be set using the Axis.DateTimeInterval property.

**C#**

    Chart1.Areas[0].PrimaryAxis.DateTimeInterval = new TimeSpan(2, 0, 0, 0);

Note:

Custom ranges set will be effective only when the Axis.IsAutoSetRange property is set to false as shown in the above codes.

# How to change the properties of chart axis header?

The properties of [WPF Chart](https://www.syncfusion.com/wpf-controls/charts "https://www.syncfusion.com/wpf-controls/charts") axis header such as Text, TextAlignment, FontFamily, FontSize, Forecolor, FontWeight, etc., can be changed using the Header property of ChartAxis.

The following code snippet is used to change the above mentioned properties.

    <syncfusion:ChartArea.PrimaryAxis>   <syncfusion:ChartAxis>     <syncfusion:ChartAxis.Header>       <TextBlock Text="Axis Header" TextAlignment="Center" FontFamily="Tahoma" FontSize="10" FontWeight="Bold" Foreground="Black"/>     </syncfusion:ChartAxis.Header>   </syncfusion:ChartAxis> </syncfusion:ChartArea.PrimaryAxis>

**Conclusion**

I
hope you enjoyed learning about how to change the properties of chart axis
header.

You
can refer to our[WPF Chart](https://www.syncfusion.com/wpf-controls/charts "https://www.syncfusion.com/wpf-controls/charts")[feature tour](https://www.syncfusion.com/wpf-controls/charts "https://www.syncfusion.com/wpf-controls/charts") page to know about its other groundbreaking
feature representations. You can also explore our [WPF Chart](https://help.syncfusion.com/wpf/charts/getting-started "https://help.syncfusion.com/wpf/charts/getting-started") to understand how
to present and manipulate data.

For
current customers, you can check out our WPF Controls from the [License and
Downloads](https://www.syncfusion.com/account/downloads) page. If you are new
to Syncfusion, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/wpf) to
check out our WPF Chart and other WPF controls.

If
you have any queries or require clarifications, please let us know in comments
below. You can also contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/wpf?control=chart). We are always happy to assist you!

# How do I access the Symbols connected by a Link?

## How do I access the Symbols connected by a Link?

The Link.FromNode and Link.ToNode properties can be used to access the Symbols on either end of a Link.

# Does WPF chart have high performance support?

Yes, [WPF chart](https://www.syncfusion.com/wpf-controls/charts "https://www.syncfusion.com/wpf-controls/charts") comes with high performance support. With the FastLine chart type, a chart can be loaded with very high performance.

The attached sample shows a chart with 10,000 data points loaded within seconds.

**Conclusion**

I hope you enjoyed learning about a high-performance support
of WPF Chart(sfchart) control.

You can refer to our [WPF Chart
feature tour](https://www.syncfusion.com/wpf-controls/charts "https://www.syncfusion.com/wpf-controls/charts") page
to know about its other groundbreaking feature representations. You can also
explore our [WPF Chart](https://help.syncfusion.com/wpf/olap-client/getting-started "https://help.syncfusion.com/wpf/olap-client/getting-started") to
understand how to present and manipulate data.

For current customers, you can check out our WPF Controls
from the [License and Downloads](https://www.syncfusion.com/account/downloads) page. If you are new to Syncfusion, you
can try our 30-day [free trial](https://www.syncfusion.com/downloads/wpf) to check out our WPF Chart and other
WPF controls.

If you have any queries or require clarifications, please let
us know in comments below. You can also contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/wpf?control=chart). We are always happy to assist you!

# How to add a series side by side?

Series can be placed side by side or overlapped using the SideBySideSeriesPlacement property.

This is especially used when multiple HiLo type series are used in a [WPF Chart](https://www.syncfusion.com/wpf-controls/charts "https://www.syncfusion.com/wpf-controls/charts"). Series that get stacked and plotted in this type could be separated and placed side by side using this property.

C#

    //Sets the series overlappedchartArea.SideBySideSeriesPlacement = false;//Sets the series side by sidechartArea.SideBySideSeriesPlacement = true;

**Conclusion**

I hope you enjoyed learning about how to add a series
side by side.

You can refer to our [WPF Chart](https://www.syncfusion.com/wpf-controls/charts "https://www.syncfusion.com/wpf-controls/charts")[feature tour](https://www.syncfusion.com/wpf-controls/charts "https://www.syncfusion.com/wpf-controls/charts") page to know about its other groundbreaking feature
representations. You can also explore our [WPF Chart](https://help.syncfusion.com/wpf/charts/getting-started "https://help.syncfusion.com/wpf/charts/getting-started") to understand how to
present and manipulate data.

For current customers, you can check out our WPF Controls
from the [License and Downloads](https://www.syncfusion.com/account/downloads) page. If you are new to Syncfusion, you can try
our 30-day [free trial](https://www.syncfusion.com/downloads/wpf) to check out our WPF Chart and other WPF controls.

If you have any queries or require clarifications,
please let us know in comments below. You can also contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/wpf?control=chart). We are always happy to assist you!

# How do I sub-class the model, view, and controller classes?

## How do I sub-class the model, view, and controller classes?

Creating derived model, view, and controller classes is a very useful technique for highly-specialized diagramming applications. For example, you might want to sub-class the model if the content of your diagrams is generated by or synchronized with data managed by your application. Sub-classing the controller is useful when you want to customize the diagramming user-interface.

Creating a new class derived from the model, view, and controller classes is very easy. Just write a new class and declare the model, view, or controller as the base class. You can override virtual methods in your derived classes and add new methods and properties.

The code below shows derived model, view, and controller classes:

C#

using Syncfusion.Windows.Forms.Diagram;
    using Syncfusion.Windows.Forms.Diagram.Controls;
    // Derived Diagram Model class
    [Serializable()]
    public class MyModel : Syncfusion.Windows.Forms.Diagram.Model
    {
    public MyModel()
    {}
    // Serialization constructor
    protected MyModel(SerializationInfo info, StreamingContext context):base(info, context)
    {}
    }
    // Derived Diagram View class
    [Serializable()]
    public class MyView : Syncfusion.Windows.Forms.Diagram.View
    {
    public MyView()
    {}
    // Serialization constructor
    protected MyView(SerializationInfo info, StreamingContext context):base(info, context)
    {}
    }
    // Derived Diagram Controller class
    public class MyController : Syncfusion.Windows.Forms.Diagram.DiagramController
    {
    public MyController()
    {}
    }

VB

Imports Syncfusion.Windows.Forms.Diagram
    Imports Syncfusion.Windows.Forms.Diagram.Controls
    ' Derived Model
    Public Class MyModel
    Inherits Syncfusion.Windows.Forms.Diagram.Model
    Public Sub New()
    End Sub
    ' Serialization constructor
    Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
    MyBase.New(info, context)
    End Sub 'New
    End Class
    ' Derived View class
    Public Class MyView
    Inherits Syncfusion.Windows.Forms.Diagram.View
    Public Sub New()
    End Sub
    ' Serialization constructor
    Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
    MyBase.New(info, context)
    End Sub 'New
    End Class
    ' Derived Controller class
    Public Class MyController
    Inherits Syncfusion.Windows.Forms.Diagram.DiagramController
    Public Sub New()
    End Sub
    End Class

The next step is to have the Diagram control use your new model, view, and controller classes. You must sub-class the Diagram control and override the CreateModel, CreateView, and CreateController methods.

C#

// Diagram control subclass
    public class MyDiagramControl : Syncfusion.Windows.Forms.Diagram.Controls.Diagram
    {
    public MyDiagramControl()
    {
    }
    public override Syncfusion.Windows.Forms.Diagram.Model CreateModel()
    {
    return new MyModel();
    }
    public override Syncfusion.Windows.Forms.Diagram.View CreateView()
    {
    return new MyView();
    }
    public override Syncfusion.Windows.Forms.Diagram.Controller CreateController()
    {
    return new MyController();
    }
    }

VB

' Diagram control subclass
    Public Class MyDiagram
    Inherits Syncfusion.Windows.Forms.Diagram.Controls.Diagram
    Public Sub New()
    End Sub
    Public Overrides Function CreateModel() As Syncfusion.Windows.Forms.Diagram.Model
    Return New MyModel
    End Function
    Public Overrides Function CreateView() As Syncfusion.Windows.Forms.Diagram.View
    Return New MyView
    End Function
    Public Overrides Function CreateController() As Syncfusion.Windows.Forms.Diagram.Controller
    Return New MyController
    End Function
    End Class

**Conclusion**

I hope you enjoyed learning about how to sub-class the model, view, and controller classes.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How can I fix line chart in ASP.NET Web Forms?

You can draw the chat with start of XAxis by using [ASP.NET Chart](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls/charts "https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls/charts"). Please refer the below code snippet which illustrates this:

**C#**

    this.ChartWebControl1.PrimaryXAxis.RangeType = ChartAxisRangeType.Set;
    
    this.ChartWebControl1.PrimaryXAxis.Range =new MinMaxInfo(0, 100, 20);
    
    this.ChartWebControl1.PrimaryYAxis.RangeType = ChartAxisRangeType.Set;
    
    this.ChartWebControl1.PrimaryYAxis.Range = new MinMaxInfo(0, 250, 50);

**VB**

    Me.ChartWebControl1.PrimaryXAxis.RangeType = ChartAxisRangeType.Set
    
    Me.ChartWebControl1.PrimaryXAxis.Range = New MinMaxInfo(0, 100, 20)
    
    Me.ChartWebControl1.PrimaryYAxis.RangeType = ChartAxisRangeType.Set
    
    Me.ChartWebControl1.PrimaryYAxis.Range = New MinMaxInfo(0, 250, 50)

Please refer the sample in the below link which illustrates the above:[http://help.syncfusion.com/support/samples/kb/chart.Web/6.1.0.34/71163/71163.zip](http://help.syncfusion.com/support/samples/kb/chart.Web/6.1.0.34/71163/71163.zip "http://help.syncfusion.com/support/samples/kb/chart.Web/6.1.0.34/71163/71163.zip")

**Note:**  
A
new version of Essential Studio for ASP.NET is available. Versions prior to the
release of Essential Studio 2014, Volume 2 will now be referred to as a classic
versions.The new ASP.NET suite is powered by [Essential
Studio for JavaScript](https://www.syncfusion.com/javascript-ui-controls) providing client-side rendering of HTML 5-JavaScript
controls, offering better performance, and better support for touch
interactivity. The new version includes all the features of the old version, so
migration is easy.

The Classic controls can be used in existing projects; however, if you are
starting a new project, we recommend using the latest version of [Essential
Studio for ASP.NET](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls/charts "https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls/charts"). Although Syncfusion will continue to support all Classic
Versions, we are happy to assist you in migrating to the newest edition.

For current customers, you can check out our components from the [License
and Downloads](https://www.syncfusion.com/account/downloads) page. If you are new to Syncfusion, you can try our
30-day [free trial](https://www.syncfusion.com/downloads) to check out our other
controls. If you have any queries or require clarifications, please let us know
in the comments section below.

You can also contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://www.syncfusion.com/support/directtrac/incidents/),
or [feedback portal](https://www.syncfusion.com/feedback/). We are always happy to
assist you!

# How to display and hide the minor gridlines in a chart?

The SmallTicksPerInterval property of the ChartAxis markup extension is used to mention the number of gridlines to be displayed per interval.

XAML

&lt;syncfusion:ChartAxis syncfusion:ChartArea.ShowGridLines="True" SmallTicksPerInterval="10"/&gt;

Minor gridlines can be disabled by setting the SmallTicksPerInterval property to 0.

# How can I save my Diagram as a bitmap?

## How can I save my Diagram as a bitmap?

The following code sample shows how you can export your diagram as an image such as a bitmap:

[C#]

// Cache the view's current origin and size PointF vieworigin = this.diagram1.View.Origin; Size viewsize = this.diagram1.View.Size;
    // Set the view''s origin and size to // encompass the whole diagram this.diagram1.View.Origin = new PointF(0, 0); this.diagram1.View.Size = new Size((int)this.diagram1.Model.Width, (int)this.diagram1.Model.Height);
    // Create a Bitmap equal to the model // dimensions and create a Graphics object // from the image Bitmap diagramimage = new Bitmap((int)this.diagram1.Model.Width, (int)this.diagram1.Model.Height); Graphics bmpgrfx = Graphics.FromImage(diagramimage);
    // Draw the Diagram.View''s contents onto // the Image Graphics object this.diagram1.View.Draw(bmpgrfx); bmpgrfx.Dispose();
    // The diagramimage is now a full rendering // of the Diagram contents and can be used // in any format diagramimage.Save("C:\\mydiagram.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
    // Restore the View''s origin and size this.diagram1.View.Origin = vieworigin; this.diagram1.View.Size = viewsize;

[VB.NET]

' Cache the view's current origin and size Dim vieworigin As PointF =  Me.diagram1.View.Origin Dim viewsize As Size =  Me.diagram1.View.Size   ' Set the view''s origin and size to ' encompass the whole diagram Me.diagram1.View.Origin = New PointF(0, 0) Me.diagram1.View.Size = New Size(CType(Me.diagram1.Model.Width, CType(Me.diagram1.Model.Height, int, Integer)))   ' Create a Bitmap equal to the model ' dimensions and create a Graphics object ' from the image Dim diagramimage As Bitmap =  New Bitmap(CType(Me.diagram1.Model.Width,CType(Me.diagram1.Model.Height, int, Integer))) Dim bmpgrfx As Graphics =  Graphics.FromImage(diagramimage)   ' Draw the Diagram.View''s contents onto ' the Image Graphics object Me.diagram1.View.Draw(bmpgrfx) bmpgrfx.Dispose()   ' The diagramimage is now a full rendering ' of the Diagram contents and can be used ' in any format diagramimage.Save("C:\\mydiagram.bmp", System.Drawing.Imaging.ImageFormat.Bmp)   ' Restore the View''s origin and size Me.diagram1.View.Origin = vieworigin Me.diagram1.View.Size = viewsize

**Conclusion**

I hope you enjoyed learning about how you can save your Diagram as a bitmap.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to apply adornments to a chart series?

The AdornmentsInfo property of ChartSeries can be used to apply adornments to a chart series. A chart adornment can take different values such as x-axis value, y-axis value, series name, etc.

The following code snippet is used to apply adornments to a chart series.

[XAML]

&lt;syncfusion:ChartSeries Name="Series 1" Type="Column"&gt;   &lt;syncfusion:ChartSeries.AdornmentsInfo&gt;     &lt;syncfusion:ChartAdornmentInfo LabelContentPath="DataPoint.X" Visible="True" VerticalAlignment="Bottom"/&gt;   &lt;/syncfusion:ChartSeries.AdornmentsInfo&gt; &lt;/syncfusion:ChartSeries&gt;

# How to enable/disable the zoom kit using C# ?

The zoom kit can be enabled using the following C# code.

C#

    ChartAreaCommands.SwitchZooming.Execute(null, Chart1.Areas[0]);

The following C# code will disable the zoom kit.

C#

    ChartAreaCommands.CancelZooming.Execute(null, Chart1.Areas[0]);

# How can I generate a thumbnail image of my Diagram?

## Generate thumbnail image in Diagram

If you want to display a thumbnail image of the Diagram:

1. Generate a Bitmap image.
2. Use the **GetThumbnailImage** method of the Image class to generate a thumbnail and set it to be the image of the PictureBox in which you want to display the thumbnail as shown below:

[C#]

    public bool ThumbnailCallback() {  return false; }
    
    //Generate Thumbnail and set it to be image of the PictureBox
    
    Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback);  this.pictureBox1.Image = (Bitmap) diagramimage.GetThumbnailImage(150,75,myCallback, IntPtr.Zero); GetThumbnailImage Method

[VB.NET]

    Public Function ThumbnailCallback() As Boolean  Return False End Function   'Generate Thumbnail and set it to be image of the PictureBox   Dim myCallback As Image.GetThumbnailImageAbort =  New Image.GetThumbnailImageAbort(ThumbnailCallback) Me.pictureBox1.Image = CType(diagramimage.GetThumbnailImage(150,75,myCallback, IntPtr.Zero), Bitmap)

**Conclusion**

I hope you enjoyed learning about how to generate a thumbnail image of your Diagram.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to draw the Y axis at the middle of the X axis in a WinForms chart?

In [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart), the Y-axis can be drawn at any custom position by using the [ChartAxisLocationType](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxisLocationType.html) class. Set the location type to `**Set`**for the Y-axis. By setting LocationType as `**Set`**, the axis position can be changed manually.

    this.chartControl1 = new ChartControl();
    . . .
    
    // Drawing Y axis mid of the X axis
    
    this.chartControl1.PrimaryYAxis.LocationType = ChartAxisLocationType.Set;
    
    // Set the location for the Primary Y-axis using pixel values
    this.chartControl1.PrimaryYAxis.Location = new PointF(550, 400);

    Me.chartControl1 = New ChartControl()
    . . .
    
    ' Drawing Y axis mid of the X axis
    
    Me.chartControl1.PrimaryYAxis.LocationType=ChartAxisLocationType.Set
    
    ' Set the location for the Primary Y-axis using pixel values
    Me.chartControl1.PrimaryYAxis.Location = New PointF(550, 400)

For more details, refer to the WinForms Chart [documentation](https://help.syncfusion.com/windowsforms/chart/chart-axes#illustrating-custom-axis-location).

![](https://support.syncfusion.com/kb/attachment/article/1152/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU2NjA2Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.Hn78MhOFjqaoZOS7M3v8-FgNzJ6nW7DuAHPDa6W5Bc4)

**Conclusion**

I hope you enjoyed learning about how to draw the Y axis at the middle of the X axis.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to set user defined values for X axis and Y axis?

To set user defined values for X axis and Y axis, first the ChartAxisRangeType has to be set as 'Set' and then the data range has to be set. Please refer the below code snippet which illustrates to set the DateTime value for the X axis.

**C#**

    private DateTime startDate = new DateTime(2007, 2, 28, 17, 5, 0);
    
    this.ChartWebControl1.PrimaryXAxis.ValueType = ChartValueType.DateTime;
    
    this.ChartWebControl1.PrimaryXAxis.RangeType = ChartAxisRangeType.Set;
    
    //Range of PrimaryXAxis
    
    this.ChartWebControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(startDate.AddDays(-1), startDate.AddDays(5), 1,ChartDateTimeIntervalType.Days);
    
    this.ChartWebControl1.PrimaryXAxis.DateTimeFormat = "dd/MM/yyyy";

**VB**

    Private startDate As DateTime = New DateTime(2007, 2, 28, 17, 5, 0)
    
    Me.ChartWebControl1.PrimaryXAxis.ValueType = ChartValueType.DateTime
    
    Me.ChartWebControl1.PrimaryXAxis.RangeType = ChartAxisRangeType.Set
    
    'Range of PrimaryXAxis
    
    Me.ChartWebControl1.PrimaryXAxis.DateTimeRange = New ChartDateTimeRange(startDate.AddDays(-1), startDate.AddDays(5), 1, ChartDateTimeIntervalType.Days)
    
    Me.ChartWebControl1.PrimaryXAxis.DateTimeFormat = "dd/MM/yyyy"

Sample:

[http://help.syncfusion.com/support/samples/kb/Chart.Web/6.1.0.34/CCaxes/Chart.zip](http://help.syncfusion.com/support/samples/kb/Chart.Web/6.1.0.34/CCaxes/Chart.zip)

# How do I determine when a new link has been added to or removed from the Diagram in WinForms?

## How do I determine when a new link has been added to or removed from the Diagram in WinForms?

The [WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram "https://www.syncfusion.com/winforms-ui-controls/diagram").Model.ConnectionsChangeComplete event can be used to determine when a new Link has been added or removed from the diagram.

The event's ConnectionCollectionEventArgs event argument provides information about the nature of the change and the connection(s) that were involved. Examining the Connection object's SourcePort and TargetPort properties for an object of type 'LinkPort' and accessing the LinkPort's Container property will let you get hold of the link that was involved in the connection. Once the link is available, the Link.FromNode and Link.ToNode properties may be used to get hold of the symbols that the link connects.

The following code sample demonstrates how to detect a new link being added to the Diagram. In the snippet we also examine the symbols that the new link connects, and if the symbols are found to be of the same type, remove the link from the diagram.

C#

// Use the Diagram.ConnectionsChangeComplete event to be notified of the creation of a new Link.// The Link.FromNode and Link.ToNode properties provide access to the symbols that the link connects.private void diagram1_ConnectionsChangeComplete(object sender, Syncfusion.Windows.Forms.Diagram.ConnectionCollectionEventArgs evtArgs){    if ((evtArgs.ChangeType == Syncfusion.Windows.Forms.Diagram.CollectionExChangeType.Insert) && (evtArgs.Connection != null))    {        Connection newconn = evtArgs.Connection;        Link newlink = null;        if (newconn.SourcePort is LinkPort)            newlink = newconn.SourcePort.Container as Link;        else if (newconn.TargetPort is LinkPort)            newlink = newconn.TargetPort.Container as Link;        if ((newlink != null) && (newlink.FromNode != null) && (newlink.ToNode != null))        {            Trace.WriteLine("A new link was added to the Diagram");            Symbol tailsymbol = newlink.FromNode as Symbol;            Symbol headsymbol = newlink.ToNode as Symbol;            if ((tailsymbol.Nodes.Count == headsymbol.Nodes.Count) && (tailsymbol.Nodes[0].Name == headsymbol.Nodes[0].Name))            {                // Comparing the symbol's child nodes count and child node type is a simplistic way                // to determine whether the two symbols are of the same type.                Trace.WriteLine("The two symbols are of the same type.");                // Use the RemoveNodesCmd to delete the new link                RemoveNodesCmd removecmd = new RemoveNodesCmd();                removecmd.Nodes.Add(newlink);                this.diagram1.Controller.ExecuteCommand(removecmd);            }        }    }}

VB

Private Sub diagram1_ConnectionsChangeComplete(ByVal sender As Object, ByVal evtArgs As Syncfusion.Windows.Forms.Diagram.ConnectionCollectionEventArgs) Handles diagram1.ConnectionsChangeComplete    If evtArgs.ChangeType = Syncfusion.Windows.Forms.Diagram.CollectionExChangeType.Insert AndAlso Not (evtArgs.Connection Is Nothing) Then        Dim newconn As Connection = evtArgs.Connection        Dim newlink As Link = Nothing        If TypeOf newconn.SourcePort Is LinkPort Then            newlink = newconn.SourcePort.Container        End If        If TypeOf newconn.TargetPort Is LinkPort Then            newlink = newconn.TargetPort.Container        End If        If Not (newlink Is Nothing) AndAlso Not (newlink.FromNode Is Nothing) AndAlso Not (newlink.ToNode Is Nothing) Then            Trace.WriteLine("A new link was added to the Diagram")            Dim tailsymbol As Symbol = newlink.FromNode            Dim headsymbol As Symbol = newlink.ToNode            If tailsymbol.Nodes.Count = headsymbol.Nodes.Count AndAlso tailsymbol.Nodes(0).Name = headsymbol.Nodes(0).Name Then                ' Comparing the symbol's child nodes count and child node type is a simplistic way                ' to determine whether the two symbols are of the same type.                Trace.WriteLine("The two symbols are of the same type.")                ' Use the RemoveNodesCmd to delete the new link                Dim removecmd As New RemoveNodesCmd                removecmd.Nodes.Add(newlink)                Me.diagram1.Controller.ExecuteCommand(removecmd)            End If        End If    End IfEnd Sub

**Conclusion**

I hope you enjoyed learning about how to determine when a new link has been added to
or removed from the Diagram in WinForms.

You can refer to our [WinForms Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page
to learn about its other groundbreaking feature representations. You can also explore our [documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started) to understand
how to create and manipulate data.

For current customers, you can check
out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to
Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our
other controls.

If you have any queries or require
clarifications, please let us know in the comments section below. You can
also contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://support.syncfusion.com/create),
or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are
always happy to assist you!

# How to change the format of chart axis labels?

The LabelFormat property in chartAxis can be used to chage the format of the labels. In case, if a label has DateTime value, then the LabelDateTimeFormat property can be used.

The following code snippet displays how the LabelFormat property can be used.

To change the format to currency - &lt;syncfusion:ChartAxis LabelFormat="0.00$"&gt;

To change the DateTimeFormat - &lt;syncfusion:chartaxis labeldatetimeformat="mm/dd/yyyy"&gt;

# How to apply template to chart adornments?

The LabelTemplate property in the ChartAdornmentsinfo can be used to specify the name of the template to be applied.

The following code example shows how a template can be applied to chart adornments.

Template for Chart Adornments Label

    <DataTemplate x:Key="Lbltxt1">   <TextBlock Name="TB1" Text ="{Binding}" FontSize="11" Foreground="White" TextAlignment="Center" VerticalAlignment="Center">     <TextBlock.LayoutTransform>       <RotateTransform Angle="270"/>    </TextBlock.LayoutTransform>   </TextBlock> </DataTemplate>

Applying template to chart adornments

    <syncfusion:ChartSeries Name="Series 1" Type="Column">   <syncfusion:ChartSeries.AdornmentsInfo>     <syncfusion:ChartAdornmentInfo LabelTemplate="{StaticResource Lbltxt1}" LabelContentPath="DataPoint.X" Visible="True" VerticalAlignment="Bottom"/>   </syncfusion:ChartSeries.AdornmentsInfo> </syncfusion:ChartSeries>

# Is it possible to print Chart without using the Toolbar in JS Chart?

It is possible to print the chart without using Toolbar in Essential Chart

**C#**

    Size chartSize = new Size((int)Math.Ceiling(this.ChartWebControl1.Width.Value),(int)Math.Ceiling(this.ChartWebControl1.Height.Value));
    
    Bitmap bmp = new Bitmap(chartSize.Width, chartSize.Height);
    
    ResourceHolder printHohlder = new ResourceHolder(this.Page);
    
    ImageResourceInfo iri = new ImageResourceInfo(bmp, ImageFormat.Png, this.ChartWebControl1.Parent.ID);
    
    this.ChartWebControl1.Draw(bmp);
    
    printHohlder.AddResource(iri);
    
    ChartUtils.PrintImageOnClient(this.Page, printHohlder.GetResourceUrl(iri));

**VB**

    Dim chartSize As Size = New Size(CInt(Math.Ceiling(Me.ChartWebControl1.Width.Value)), CInt(Math.Ceiling(Me.ChartWebControl1.Height.Value)))
    
    Dim bmp As Bitmap = New Bitmap(chartSize.Width, chartSize.Height)
    
    Dim printHohlder As ResourceHolder = New ResourceHolder(Me.Page)
    
    Dim iri As ImageResourceInfo = New ImageResourceInfo(bmp, ImageFormat.Png, Me.ChartWebControl1.Parent.ID)Me.ChartWebControl1.Draw(bmp)
    
    printHohlder.AddResource(iri)
    
    ChartUtils.PrintImageOnClient(Me.Page, printHohlder.GetResourceUrl(iri))

# How to display multiple chartcontrols as multiple chart areas in WinForms Chart?

In [Syncfusion WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "https://www.syncfusion.com/winforms-ui-controls/chart"), when you want to render more than one chart, the control supports multiple chart areas. Each ChartControl acts as a separate chart area. To align these charts visually and ensure consistent axis alignment, you need to follow the below steps.

**Steps to display multiple chart controls as multiple chart areas**

**1.** **Create multiple ChartControls**

Add two or more [ChartControl](https://help.syncfusion.com/windowsforms/chart/getting-started "https://help.syncfusion.com/windowsforms/chart/getting-started") components to your form. Each will represent a separate chart area.

**2. Set axes LocationType to** **Set**

For each chart control, set the axes [LocationType](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_LocationType "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_LocationType")  property to **Set**. This allows you to manually position the axes rather than letting the chart auto-align them.

    this.chartControl2.PrimaryXAxis.LocationType = ChartAxisLocationType.Set;

    Me.chartControl2.PrimaryXAxis.LocationType = ChartAxisLocationType.Set

**3.** **Align axes based on longest labels**

Identify which chart control has the longest axis labels (usually the one with larger values or longer text). Use its Axis [Location](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_Location "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_Location") as a reference and apply the same location to the other chart controls to ensure visual alignment.﻿﻿

    this.chartControl2.PrimaryXAxis.Location = chartControl1.PrimaryXAxis.Location;

    Me.chartControl2.PrimaryXAxis.Location = chartControl1.PrimaryXAxis.Location

**Output:**

![Multiple chart areas](https://support.syncfusion.com/kb/attachment/article/1158/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUxNzI2Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.Ev5CRFd5qWKv1slLlprnY6gDcKHs6yYPjaZFlT7jPbQ)

**Conclusion**

I hope you enjoyed learning about how to display multiple chart controls as multiple chart areas in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started).

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart)to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our WinForms Chart examples to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/account/manage-trials/downloads) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to Convert the Meta File Back to a Diagram Object in WinForms?

The current version of Essential® Diagram does not support the reverse conversion of metafiles into diagrams. We hope to provide this feature in a future version of the product. The only option at the time being would be to serialize the diagram document alongside your metafile and use this diagram file to restore the diagram.

# Is there any property used to rotate/to specify the rotation angle the node programmatically?

## Node RotationAngle property

Yes, Node.RotationAngle property can be used to specify the node's rotation angle.

[Syncfusion® Inc.](https://www.syncfusion.com/)

# How to add and customize titles for chart control, chart series, chart axes, and chart legend in WinForms Chart?

Essential Chart supports assigning titles to various objects within the Chart Control, such as the Chart, Series, Axes, and Legend. These titles can also be customized in [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts").

    this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.Category;
    
    //Update the X axis title
    this.chartControl1.PrimaryXAxis.Title = "Year";
    this.chartControl1.PrimaryXAxis.TitleAlignment = StringAlignment.Center;
    
    this.chartControl1.PrimaryYAxis.ValueType = ChartValueType.Double;
    
    //Update the Y axis title
    this.chartControl1.PrimaryYAxis.Title = "Sales Data";
    this.chartControl1.PrimaryYAxis.TitleAlignment = StringAlignment.Center;
    
    CategoryAxisDataBindModel dataSeriesModel = new CategoryAxisDataBindModel(dataSource);
    dataSeriesModel.CategoryName = "Year";
    dataSeriesModel.YNames = new string[] { "Sales" };
    ChartSeries chartSeries = new ChartSeries("Sales");
    chartSeries.Type = ChartSeriesType.Column;
    chartSeries.CategoryModel = dataSeriesModel;
    
    //Update the series title
    chartSeries.Text = "Product Sold";
    this.chartControl1.Series.Add(chartSeries);
    
    this.chartControl1.Legend.Visible = true;
    
    //Update the legend title
    this.chartControl1.Legend.Text = "Products";
    this.chartControl1.Legend.Font = new Font("Arial", 8f, FontStyle.Bold);
    this.chartControl1.LegendAlignment = ChartAlignment.Center;
    this.chartControl1.Legend.Position = ChartDock.Top;
    this.chartControl1.LegendsPlacement = ChartPlacement.Outside;
    
    //Update the chart title
    ChartTitle title = new ChartTitle();
    title.Visible = true;
    title.Text = "Sales Performance";
    title.Alignment = ChartAlignment.Center;
    title.ForeColor = Color.RoyalBlue;
    title.Font = new Font("Arial", 14.0f);
    title.ShowBorder = true;
    title.Border.ForeColor = Color.DarkBlue;
    title.Border.Width = 2;
    title.Border.DashStyle = DashStyle.Dot;
    this.chartControl1.Titles.Add(title);

    columnChart.PrimaryXAxis.ValueType = ChartValueType.Category
    
    'Update the X axis title
    columnChart.PrimaryXAxis.Title = "Year"
    columnChart.PrimaryXAxis.TitleAlignment = StringAlignment.Center
    
    columnChart.PrimaryYAxis.ValueType = ChartValueType.Double
    
    'Update the X axis title
    columnChart.PrimaryYAxis.Title = "Sales Data"
    columnChart.PrimaryYAxis.TitleAlignment = StringAlignment.Center
    
    Dim dataSeriesModel = New CategoryAxisDataBindModel(viewModel.PlantDetails)
    dataSeriesModel.CategoryName = "Year"
    dataSeriesModel.YNames = New String() {"Sales"}
    ChartSeries1.CategoryModel = dataSeriesModel
    
    'Update the chart series title
    ChartSeries1.Text = "Product Sold"
    
    columnChart.Series.Add(ChartSeries1)
    
    columnChart.Legend.Visible = True
    
    'Update the legend title
    columnChart.Legend.Text = "Products"
    columnChart.Legend.Font = New Font("Arial", 8.0F, FontStyle.Bold)
    
    columnChart.LegendAlignment = ChartAlignment.Center
    columnChart.Legend.Position = ChartDock.Top
    columnChart.LegendsPlacement = ChartPlacement.Outside
    
    'Configure the chart title
    Dim title = New ChartTitle()
    title.Visible = True
    title.Text = "Sales Performance"
    title.Alignment = ChartAlignment.Center
    title.ForeColor = Color.RoyalBlue
    title.Font = New Font("Arial", 14.0F)
    title.ShowBorder = True
    title.Border.ForeColor = Color.DarkBlue
    title.Border.Width = 2
    title.Border.DashStyle = DashStyle.Dot
    columnChart.Titles.Add(title)

**Output:**

![add and customize titles](https://support.syncfusion.com/kb/attachment/article/1161/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1MjIyIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.eBfEkCEOTSg-RWVSMf7yXZNruJg_gwlnx_xeH7bgKsA)

**Conclusion**

I hope you enjoyed learning about how to add and customize titles for Chart Control, Chart Series, Chart Axes, and Chart Legend in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# Can the fill style properties and the gradient effect can be applied to the text node's text?

## Can the fill style properties and the gradient effect can be applied to the text node's text?

Yes, the TextNode.FontColorStyle property allows you to apply the fill style properties and the gradient effect on the text node''s text.

[Syncfusion® Inc.](https://www.syncfusion.com/)

# How to add a chart control to a WPF application using XAML?

A chart can be added to a WPF application using the following chart tag.

&lt;syncfusion:Chart Name="Chart1" Background="White" Foreground="Black"&gt; &lt;/syncfusion:Chart&gt;

# Is it possible to resize the model bounds to fit its content?

## Is it possible to resize the model bounds to fit its content?

Yes. You can use the Model.SizeToContent property to resize the model bounds to fit its content. Please refer to the below code snippet to achieve this:

C#

// Resizes the model bounds to fit to its content.
    this.diagram1.Model.SizeToContent = true;

VB

' Resizes the model bounds to fit to its content.
    Me.diagram1.Model.SizeToContent = True
**Conclusion**

I hope you enjoyed learning about whether it is possible to resize the model bounds to fit its content.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# What are the namespaces to be included in a WPF application for Syncfusion chart?

After the successful installation of Essential Studio for WPF, you need to add the following references to the project:

- Syncfusion.Chart.WPF
- Syncfusion.Shared.WPF

The Syncfusion.Shared.WPF is optional for additional WPF features such as Vista Window, Chart themes, etc.

In XAML, the namespace can be included by using the following code.

xmlns:syncfusion="http://schemas.syncfusion.com/wpf"

# Can I draw a text node with some background color value?

## Draw a text node with background color value 

Yes, setting some color value to the **TextNode.BackgroundStyle.Color** property allows you to draw a text node with the specified background color.

By default, the **TextNode.BackgroundStyle.ColorAlphaFactor** is set to a **zero** value (i.e., the transparent value). So, in order to display the background color, you need to set some value other than zero to the ColorAlphaFactor property.

[Syncfusion® Inc.](https://www.syncfusion.com/)

**Conclusion**

I hope you enjoyed learning how to draw a text node with some background color value.

You can refer to [WinForms Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Diagram example](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to change the size of the circle of Scattered chart?

You can change the size of the circle by changing the size of the Symbol of chartStyleInfo.

**C#**

    void series2_PrepareStyle(object sender, ChartPrepareStyleInfoEventArgs args)
    {
        ChartSeries series = sender as ChartSeries;
        if (series != null)
        {
            args.Style.Text = string.Format("{0}", series.Points[args.Index].YValues[0]);
            args.Style.Symbol.Shape = ChartSymbolShape.Circle;
    
            //Change the size of symbol
            args.Style.Symbol.Size = new Size(50, 50);
        }
    }

**VB**

    Private Sub series2_PrepareStyle(ByVal sender As Object, ByVal args As ChartPrepareStyleInfoEventArgs)
    
     Dim series As ChartSeries = CType(IIf(TypeOf sender Is ChartSeries, sender, Nothing), ChartSeries)
    
       If Not series Is Nothing Then
    
       args.Style.Text = String.Format("{0}", series.Points(args.Index).YValues(0))
    
         args.Style.Symbol.Shape = ChartSymbolShape.Circle
    
          'Change the size of symbol
    
       args.Style.Symbol.Size = New Size(50, 50)
    
      End If
    
     End Sub

# How to work with WinForms Chart ToolBars?

Essential [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "https://www.syncfusion.com/winforms-ui-controls/chart") supports toolbars that can be
used to customize the chart at runtime. Toolbars can be enabled by setting the
[ShowToolbar](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControlActionList.html#Syncfusion_Windows_Forms_Chart_ChartControlActionList_ShowToolbar "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControlActionList.html#Syncfusion_Windows_Forms_Chart_ChartControlActionList_ShowToolbar") property to true. By default, the toolbar provides the following
options:

- A button to save the chart.
- A button to copy the chart.
- A button to print the chart.
- A button for print preview.
- A button to change the color palette at runtime.
- A button to customize the series properties at runtime.
- A button to change the chart type at runtime.
- A button to toggle the legend.

For more details on setting toolbar, refer to the WinForms Chart [documentation](https://help.syncfusion.com/windowsforms/chart/runtime-features#toolbars).

    this.chartControl1 = new ChartControl();
    . . .
    
    // Display ToolBar.
    this.chartControl1.ShowToolbar = true;
    this.chartControl1.ToolBar.DockingFree = true;

    Me.ChartControl1 = New ChartControl()
    . . .
    
    ' Display ToolBar.
    Me.ChartControl1.ShowToolbar = true
    Me.ChartControl1.ToolBar.DockingFree = true

**Output**

![](https://support.syncfusion.com/kb/attachment/article/1168/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU2NjA5Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.0llllaIKO6sogcx571vGoeLQVepVB7YZgISnn2tXCp4)

**Conclusion**

I hope you enjoyed learning about how to work with WinForms Chart Toolbars.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to add custom legend items to the legend instead of automated legend items?

In****[**WinForms Chart**](https://www.syncfusion.com/winforms-ui-controls/chart) control, it is possible to add
custom [**ChartLegendItem**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegendItem.html "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegendItem.html") to the Legend instead of the automated Legend items. For this
we have to use the event, [**Legend.FilterItems**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegend.html#Syncfusion_Windows_Forms_Chart_ChartLegend_FilterItems "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegend.html#Syncfusion_Windows_Forms_Chart_ChartLegend_FilterItems") of the [**ChartControl**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html"). This event is
raised before the legend items are rendered.

Here is the code snippet to add the custom legend,

    this.chartControl1 = new ChartControl();
    . . .
    
    this.chartControl1.Legend.FilterItems += new LegendFilterItemsEventHandler(Legend_FilterItems);
    . . .
    private void Legend_FilterItems(object sender, ChartLegendFilterItemsEventArgs e)
    {e.Items.Clear();ChartLegendItemsCollection items = new ChartLegendItemsCollection();ChartLegendItem l = new ChartLegendItem();ChartLegendItem l1 = new ChartLegendItem();l.ItemStyle.TextColor = Color.Orange;
            l.Text = "Test1";
            l1.ItemStyle.TextColor = Color.DarkBlue;l1.Text = "Test2";item.Add(l);item.Add(l1);e.Items = items;
    }

Me.ChartControl1 = New ChartControl()
    . . .
    
    AddHandler Me.ChartControl1.Legend.FilterItems, AddressOf ChartControl1_Legend_FilterItems
    . . .
    
    Private Sub ChartControl1_Legend_FilterItems(sender As Object, e As Syncfusion.Windows.Forms.Chart.ChartLegendFilterItemsEventArgs)
        e.Items.Clear()
    
        Dim items As New Syncfusion.Windows.Forms.Chart.ChartLegendItemsCollection()
    
        Dim l As New Syncfusion.Windows.Forms.Chart.ChartLegendItem()
        l.ItemStyle.TextColor = Color.Orange
        l.Text = "Test1"
    
        Dim l1 As New Syncfusion.Windows.Forms.Chart.ChartLegendItem()
        l1.ItemStyle.TextColor = Color.DarkBlue
        l1.Text = "Test2"
    
        items.Add(l)
        items.Add(l1)
    
        e.Items = items
    End Sub

**Output**

**![CustomLegend](https://support.syncfusion.com/kb/attachment/article/1169/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU3NTA4Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.dlX4KY0gP3O6Z0MxxtRQOxBwiFc9Ck05FRz-1hQocbg)**

**Conclusion**

I hope you
enjoyed learning about how to add custom legend items to the legend instead of automated legend items.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How can I set different bridge style in WinForms Diagram?

## BridgeStyle for connectors

Yes, the **ConnectorBase.BridgeStyle** property can be used to set the bridge style only for the selected connector.

Setting the **Model.BridgeStyle** property to a specific value applies it to all the connectors in the diagram model.

[Syncfusion® Inc.](https://www.syncfusion.com/)

https://www.syncfusion.com/

**Conclusion**

I hope you enjoyed
learning about how to set different bridge styles in the WinForms Diagram.

You can refer to
our [WinForms Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking
feature representations. You can also explore our[WinForms Diagram documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started) to understand how to create and manipulate data.

For current
customers, you can check out our components from the [License and
Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to
Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have any
queries or require clarifications, please let us know in the comments section
below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback
portal](https://www.syncfusion.com/feedback/winforms?searchtext=diagram). We are always happy to assist you!

# How to customize toolbar items in WinForms Chart control?

The [**WinForms Chart**](https://www.syncfusion.com/winforms-ui-controls/chart "https://www.syncfusion.com/winforms-ui-controls/chart") built-in toolbar can be displayed by setting the [**ShowToolbar**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ShowToolbar "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ShowToolbar")property to `true`. The toolbar can be customized by
adding or removing toolbar [**Items**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartToolBarInfo.html#Syncfusion_Windows_Forms_Chart_ChartToolBarInfo_Items "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartToolBarInfo.html#Syncfusion_Windows_Forms_Chart_ChartToolBarInfo_Items") and modifying its appearance.

**Customizing Toolbar Item Appearance**

The appearance of the chart
toolbar and its items can be customized using the following properties:

- ButtonBackColor
- ButtonForeColor
- Border style
- AutoSize
- ButtonSize
- Spacing
- ShowBorder

For more details on customizing toolbar, refer to the WinForms Chart [**documentation**](https://help.syncfusion.com/windowsforms/chart/runtime-features#toolbars).

this.chartControl1 = new ChartControl();
    . . .
    
    //Show the chart toolbar.
    this.chartControl1.ShowToolbar = true;
     
    // Specifes ToolBar style
    this.chartControl1.ToolBar.AutoSize = true;
    this.chartControl1.ToolBar.Border.ForeColor = Color.Blue;
    this.chartControl1.ToolBar.BackColor = Color.BlanchedAlmond;
    // Specifies the Toolbar Item Style.
    this.chartControl1.ToolBar.ButtonBackColor = Color.White;
    this.chartControl1.ToolBar.ButtonForeColor = Color.Maroon;

    Me.chartControl1 = New ChartControl()
    . . .
    
    ' Show the chart toolbar
    Me.chartControl1.ShowToolbar = True
    
    ' Specifies ToolBar style
    Me.chartControl1.ToolBar.AutoSize = True
    Me.chartControl1.ToolBar.Border.ForeColor = Color.Blue
    Me.chartControl1.ToolBar.BackColor = Color.BlanchedAlmond
    
    ' Specifies the Toolbar Item Style
    Me.chartControl1.ToolBar.ButtonBackColor = Color.White
    Me.chartControl1.ToolBar.ButtonForeColor = Color.Maroon

**Adding Items in chart Toolbar**

Add the custom toolbar items by using
the [**ChartToolBarCommandItem**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartToolBarCommandItem.html "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartToolBarCommandItem.html") in the Toolbar [**Items**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartToolBarInfo.html#Syncfusion_Windows_Forms_Chart_ChartToolBarInfo_Items "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartToolBarInfo.html#Syncfusion_Windows_Forms_Chart_ChartToolBarInfo_Items") collection as shown in the following code example to `ZoomIn` and
`ZoomOut`.

this.chartControl1.EnableXZooming = true;
    this.chartControl1.ZoomFactorX = 0.5;
    
    //Adding the custom Toolbar items.
    ChartToolBarCommandItem zoomIn = new ChartToolBarCommandItem();
    zoomIn.Command = ChartCommands.ZoomIn;
    zoomIn.ToolTip = "ZoomIn";
    this.chartControl1.ToolBar.Items.Add(zoomIn);
     
    ChartToolBarCommandItem zoomOut = new ChartToolBarCommandItem();
    zoomOut.Command = ChartCommands.ZoomOut;
    zoomOut.ToolTip = "ZoomOut";
    this.chartControl1.ToolBar.Items.Add(zoomOut);

    Me.chartControl1.EnableXZooming = True
    Me.chartControl1.ZoomFactorX = 0.5
    
    ' Adding the custom Toolbar items
    Dim zoomIn As New ChartToolBarCommandItem()
    zoomIn.Command = ChartCommands.ZoomIn
    zoomIn.ToolTip = "ZoomIn"
    Me.chartControl1.ToolBar.Items.Add(zoomIn)
    
    Dim zoomOut As New ChartToolBarCommandItem()
    zoomOut.Command = ChartCommands.ZoomOut
    zoomOut.ToolTip = "ZoomOut"
    Me.chartControl1.ToolBar.Items.Add(zoomOut)

**Output**

![Customized chart Toolbar with ZoomIn and ZoomOut toolbar items](https://www.syncfusion.com/uploads/user/kb/wf/wf-14091/wf-14091_img1.png)

**Conclusion**

I hope you enjoyed learning about how to customize toolbar items in Chart control.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How can I hide the PrimaryYaxis and show only the custom axis?

To display only the custom axis, please do the following steps.

1. You have to set the LayoutMode of both X and Y axis to stacking mode.

## C#

chartControl1.ChartArea.XAxesLayoutMode = ChartAxesLayoutMode.Stacking;

chartControl1.ChartArea.YAxesLayoutMode = ChartAxesLayoutMode.Stacking;

VB

chartControl1.ChartArea.XAxesLayoutMode = ChartAxesLayoutMode.Stacking

chartControl1.ChartArea.YAxesLayoutMode = ChartAxesLayoutMode.Stacking

2. You have to position the custom Y axis in LayoutCompleted event. Please refer to the following code snippet.

## C#

this.chartControl1.LayoutCompleted += new EventHandler(chartControl1\_LayoutCompleted);

void chartControl1\_LayoutCompleted(object sender, EventArgs e)

{

PositionAllYAxes();

}

ChartAxis a;

private void PositionAllYAxes()

{

for (int i = 0; i &lt; chartControl1.Axes.Count; i++)

{

a = chartControl1.Axes[i];

if (a != chartControl1.PrimaryYAxis && a.Orientation == ChartOrientation.Vertical)

{

a.LocationType = ChartAxisLocationType.Set;

a.Location = new PointF(chartControl1.PrimaryYAxis.Location.X, chartControl1.PrimaryYAxis.Location.Y);

}

}

}

## VB

AddHandler chartControl1.LayoutCompleted, AddressOf chartControl1\_LayoutCompleted

Private a As ChartAxis

Private Sub chartControl1\_LayoutCompleted(ByVal sender As Object, ByVal e As EventArgs)

PositionAllYAxes()

End Sub

Private Sub PositionAllYAxes()

Dim i As Integer = 0

Do While i &lt; chartControl1.Axes.Count

a = chartControl1.Axes(i)

If Not a Is chartControl1.PrimaryYAxis AndAlso a.Orientation = ChartOrientation.Vertical Then

a.LocationType = ChartAxisLocationType.Set

a.Location = New PointF(chartControl1.PrimaryYAxis.Location.X, chartControl1.PrimaryYAxis.Location.Y)

End If

End Sub

3. Then you have hide other axes in LayoutCompleted. Please refer to the following code snippet

C#

void chartControl1\_LayoutCompleted(object sender, EventArgs e)

{

HideOtherAxes(a);

}

private void HideOtherAxes(ChartAxis currentAxis)

{

int axesCount = this.chartControl1.Axes.Count;

for (int i = 0; i &lt; axesCount; i++)

{

ChartAxis a = this.chartControl1.Axes[i];

if (a != currentAxis && a.Orientation == ChartOrientation.Vertical)

{

a.DrawGrid = false;

a.TickLabelsDrawingMode = ChartAxisTickLabelDrawingMode.None;

}

}

currentAxis.DrawGrid = true;

currentAxis.TickLabelsDrawingMode = ChartAxisTickLabelDrawingMode.AutomaticMode;

currentAxis.Location = new PointF(this.chartControl1.PrimaryYAxis.Location.X, this.chartControl1.PrimaryYAxis.Location.Y);

currentAxis.ZoomFactor = this.chartControl1.PrimaryYAxis.ZoomFactor;

}

## VB

Private a As ChartAxis

Private Sub chartControl1\_LayoutCompleted(ByVal sender As Object, ByVal e As EventArgs)

HideOtherAxes(a);

End Sub

Private Sub HideOtherAxes(ByVal currentAxis As ChartAxis)

Dim axesCount As Integer = Me.chartControl1.Axes.Count

Dim i As Integer = 0

Do While i &lt; axesCount

Dim a As ChartAxis = Me.chartControl1.Axes(i)

If Not a Is currentAxis AndAlso a.Orientation = ChartOrientation.Vertical Then

a.DrawGrid = False

a.TickLabelsDrawingMode = ChartAxisTickLabelDrawingMode.None

End If

i += 1

Loop

currentAxis.DrawGrid = True

currentAxis.TickLabelsDrawingMode = ChartAxisTickLabelDrawingMode.AutomaticMode

currentAxis.Location = New PointF(Me.chartControl1.PrimaryYAxis.Location.X, Me.chartControl1.PrimaryYAxis.Location.Y)

currentAxis.ZoomFactor = Me.chartControl1.PrimaryYAxis.ZoomFactor

End Sub

Sample: [http://help.syncfusion.com/support/samples/Chart.Windows/HideYaxis/ChartSeries.zip](http://help.syncfusion.com/support/samples/Chart.Windows/HideYaxis/ChartSeries.zip)

# What is the heirarchy of chart control in WPF?

&lt;syncfusion:Chart&gt;   &lt;syncfusion:ChartArea&gt;      &lt;syncfusion:ChartAxis/&gt;      &lt;syncfusion:ChartSeries/&gt;       .       .   &lt;/syncfusion:ChartArea&gt; &lt;/syncfusion:Chart&gt;

# How to hide or remove a specific series among multiple series in a WinForms Chart?

**Hiding a Series**

In [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart) control, hide a particular series by setting its [Visible](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSeries.html#Syncfusion_Windows_Forms_Chart_ChartSeries_Visible) property to false. This will prevent the series from being rendered on the chart while keeping it available internally. Other series can be displayed normally by setting their [Visible](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSeries.html#Syncfusion_Windows_Forms_Chart_ChartSeries_Visible "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSeries.html#Syncfusion_Windows_Forms_Chart_ChartSeries_Visible") property to true.

    this.chartControl1 = new ChartControl();
    ...
    // Hiding and showing specific series
    
    this.chartControl1.Series[0].Visible = false;
    
    this.chartControl1.Series[1].Visible = true;

Me.chartControl1 = New ChartControl()
    ...
    ' Hiding and showing specific series
    Me.chartControl1.Series(0).Visible = False
    Me.chartControl1.Series(1).Visible = True

For more details, refer to the WinForms Chart [documentation](https://help.syncfusion.com/windowsforms/chart/chart-series#visible).

**Adding and Removing Series**

If you need to add or remove a specific series, you can use the [Add](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSeriesCollection.html#Syncfusion_Windows_Forms_Chart_ChartSeriesCollection_Add_Syncfusion_Windows_Forms_Chart_ChartSeries_ "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSeriesCollection.html#Syncfusion_Windows_Forms_Chart_ChartSeriesCollection_Add_Syncfusion_Windows_Forms_Chart_ChartSeries_") and **** [Remove](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSeriesCollection.html#Syncfusion_Windows_Forms_Chart_ChartSeriesCollection_Remove_Syncfusion_Windows_Forms_Chart_ChartSeries_ "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSeriesCollection.html#Syncfusion_Windows_Forms_Chart_ChartSeriesCollection_Remove_Syncfusion_Windows_Forms_Chart_ChartSeries_") methods in [ChartSeries](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSeries.html) to add new series or remove existing ones.

    this.chartControl1 = new ChartControl();
    ...
    // Adding a series
    this.chartControl1.Series.Add(series1);
    
    // Removing a series
    this.chartControl1.Series.Remove(series2);

Me.chartControl1 = New ChartControl()
    ...
    ' Adding a series
    Me.chartControl1.Series.Add(series1)
    
    ' Removing a series
    Me.chartControl1.Series.Remove(series2)

**Conclusion**

I hope you enjoyed learning about how
to hide or remove a specific series among multiple series in a WinForms Chart.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# Can we combine different actions into one atomic action? So that we avoid the undo operation on certain actions.

## Can we combine different actions into one atomic action? So that we avoid the undo operation on certain actions.

Yes, this can be done by calling the Model.HistoryManger.StartAtomicAction(string description)/EndAtomicAction() methods.

This is demonstrated in the QuickStart/Custom Command sample.

[Syncfusion® Inc.](https://www.syncfusion.com/)

# How to display fancytooltips in WinForms Chart?

FancyTooltips can be displayed by setting the Visible property of FancyTooltips to true. Users can modify its display style and appearance using various properties such as Style, Symbol, ForeColor, Alignment, etc. FancyTooltips provide an attractive display to users. The Style property is used to set the style of the tooltip in [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Chart").

    // Displaying FancyTooltips
    series1.FancyToolTip.Visible = true;
    series1.FancyToolTip.Alignment = TabAlignment.Right;
    series1.FancyToolTip.BackColor = Color.AliceBlue;
    
    // Setting Border style
    series1.FancyToolTip.Border.ForeColor = Color.Blue;
    series1.FancyToolTip.Border.Width = 2;
    series1.FancyToolTip.Font = new Font("Verdana", 8f, FontStyle.Italic);
    series1.FancyToolTip.ForeColor = Color.Maroon;
    
    // Specifying Marker Style
    series1.FancyToolTip.Style = MarkerStyle.SmoothRectangle;
    series1.FancyToolTip.Symbol = ChartSymbolShape.Star;

    'Displaying FancyTooltips
    series1.FancyToolTip.Visible = True
    series1.FancyToolTip.Alignment = TabAlignment.Right
    series1.FancyToolTip.BackColor = Color.AliceBlue
    
    ' Setting Border style
    series1.FancyToolTip.Border.ForeColor = Color.Blue
    series1.FancyToolTip.Border.Width = 2
    series1.FancyToolTip.Font = new Font("Verdana", 8f, FontStyle.Italic)
    series1.FancyToolTip.ForeColor = Color.Maroon
    
    ' Specifying Marker Style
    series1.FancyToolTip.Style = MarkerStyle.SmoothRectangle
    series1.FancyToolTip.Symbol = ChartSymbolShape.Star

**Output:**

![Fancy tooltip ](https://support.syncfusion.com/kb/attachment/article/1176/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0NTc0Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.YYYiQm-R4bFeX11CmGkXAq9IxTgLRYMrSJEDdmx2ydA)

**Conclusion**

I hope you enjoyed learning about how to display fancy tooltips in WinForms Chart.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to handle different types of axes and display them in reverse order in WinForms Chart?

[WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts") include default primary X and Y axes, along with an optional secondary Y-axis for displaying data on different scales. You can programmatically add a [ChartAxis](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html "ChartAxis") for more flexibility, such as when plotting x and y values together. To move an axis, set [OpposedPosition](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_OpposedPosition "OpposedPosition") as true for the secondary Y-axis or [Inversed](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_Inversed "Inversed") as true for the X-axis.

    //Assign the X and Y axes
    this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.Category;
    this.chartControl1.PrimaryXAxis.Inversed = true;
    this.chartControl1.PrimaryYAxis.ValueType = ChartValueType.Double;
    
    //Configure the secondary axis
    ChartAxis secYAxis = new ChartAxis();
    secYAxis.Orientation = ChartOrientation.Vertical;
    secYAxis.Range = new MinMaxInfo(0, 100, 20);
    secYAxis.OpposedPosition = true;
    this.chartControl1.Axes.Add(secYAxis);
    
    //Configure the chart series1
    ChartSeries chartSeries1 = new ChartSeries("Series 1");
    chartSeries1.CategoryModel = new CategoryAxisDataBindModel(dataSource)
    {
        CategoryName = "Year",
        YNames = new string[] { "Sales" }
    };
    this.chartControl1.Series.Add(chartSeries1);
    
    //Configure the chart series2
    ChartSeries chartSeries2 = new ChartSeries("Series 2");
    chartSeries2.CategoryModel = new CategoryAxisDataBindModel(dataSource)
    {
        CategoryName = "Year",
        YNames = new string[] { "YValue" }
    };
    chartSeries2.YAxis = secYAxis;
    this.chartControl1.Series.Add(chartSeries2);

    'Assign the X and Y axes
    columnChart.PrimaryXAxis.ValueType = ChartValueType.Category
    columnChart.PrimaryXAxis.Inversed = True
    columnChart.PrimaryYAxis.ValueType = ChartValueType.Double
    
    'Configure the secondary Y axis
    Dim secYAxis = New ChartAxis()
    secYAxis.Orientation = ChartOrientation.Vertical
    secYAxis.Range = New MinMaxInfo(0, 100, 20)
    secYAxis.OpposedPosition = True
    columnChart.Axes.Add(secYAxis)
    
    'Configure the chart series1
    Dim ChartSeries1 As ChartSeries = New ChartSeries("Series 1")
    Dim dataSeriesModel = New CategoryAxisDataBindModel(viewModel.PlantDetails)
    dataSeriesModel.CategoryName = "Year"
    dataSeriesModel.YNames = New String() {"Sales"}
    ChartSeries1.CategoryModel = dataSeriesModel
    columnChart.Series.Add(ChartSeries1)
    
    'Configure the chart series2
    Dim ChartSeries2 = New ChartSeries("Series 2")
    dataSeriesModel.CategoryName = "Year"
    dataSeriesModel.YNames = New String() {"YValue"}
    ChartSeries2.CategoryModel = dataSeriesModel
    ChartSeries2.YAxis = secYAxis
    columnChart.Series.Add(ChartSeries2)

**Output:**

![multiple axis and reverse order](https://support.syncfusion.com/kb/attachment/article/1177/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1MjIwIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.eCpQ1GKy3V9HhEZPmwA0c5J55NF3a4D5ZpsaVVfW6vA)

**Conclusion**

I hope you enjoyed learning about how to work with different types of axes and display them in reverse direction in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to display WinForms Chart tooltips?

In **** [**WinForms Chart**](https://www.syncfusion.com/winforms-ui-controls/chart "https://www.syncfusion.com/winforms-ui-controls/chart") control, [**tooltips**](https://help.syncfusion.com/windowsforms/chart/runtime-features#tooltips "https://help.syncfusion.com/windowsforms/chart/runtime-features#tooltips") are used to display additional information when hovering over chart elements such as data points or chart areas. You can enable tooltips by setting the [**ShowToolTips**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ShowToolTips "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartControl.html#Syncfusion_Windows_Forms_Chart_ChartControl_ShowToolTips") property to true. By default, tooltips show the **Y-value** of the series.

To display custom text, use the [**PointsToolTipFormat**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSeries.html#Syncfusion_Windows_Forms_Chart_ChartSeries_PointsToolTipFormat "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSeries.html#Syncfusion_Windows_Forms_Chart_ChartSeries_PointsToolTipFormat") property (e.g., **"{1}" -** The default **Y** value will be replaced by the corresponding **ChartSeries.Style.ToolTip**). Tooltips can also be applied to the **chart area** using the [**ChartAreaToolTip**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartArea.html#Syncfusion_Windows_Forms_Chart_ChartArea_ChartAreaToolTip "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartArea.html#Syncfusion_Windows_Forms_Chart_ChartArea_ChartAreaToolTip")property.

For more details on supported format specifiers in **PointsToolTipFormat**, refer to the WinForms Chart [**documentation**](https://help.syncfusion.com/windowsforms/chart/runtime-features#datapoint-tooltips "https://help.syncfusion.com/windowsforms/chart/runtime-features#datapoint-tooltips").

    ﻿﻿this.chartControl1 = new ChartControl();
    . . .
    this.chartControl1.ShowToolTips = true;
    
    ChartSeries series1 = new ChartSeries("Sales Performance", ChartSeriesType.Column);
    
    // Chart Area Tooltips
    
    this.chartControl1.ChartArea.ChartAreaToolTip = "Chart Area";
    
    // Series points Tooltips
    
    series1.PointsToolTipFormat = "{1}";
    
    series1.Style.ToolTip = "Series1";

    Me.ChartControl1 = New ChartControl()
    . . .
    Me.ChartControl1.ShowToolTips = True
    
    Dim series1 As ChartSeries = New ChartSeries("Sales Performance", ChartSeriesType.Column)
    
    ' Chart Area Tooltips
    
    Me.ChartControl1.ChartArea.ChartAreaToolTip = "Chart Area"
    
    ' Series points Tooltips
    
    series1.PointsToolTipFormat = "{1}"
    
    series1.Style.ToolTip = "Series1"

**Output**

![](https://support.syncfusion.com/kb/attachment/article/1178/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU3MDAxIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.gn914_Cz1nVFAsyykw6dZyGOhd9Sz7-Y7tDxk-9tKnc)

**Conclusion**

I hope you enjoyed learning about how to display WinForms Chart Tooltips.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart "https://www.syncfusion.com/winforms-ui-controls/chart") to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started "https://help.syncfusion.com/windowsforms/chart/getting-started"), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart "https://github.com/syncfusion/winforms-demos/tree/master/chart") to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/pricing "https://www.syncfusion.com/sales/teamlicense") page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/windowsforms?control=chart "https://www.syncfusion.com/forums/"), [Direct-Trac](https://support.syncfusion.com/create "https://support.syncfusion.com/create"), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart "https://www.syncfusion.com/feedback/winforms?control=chart"). We are always happy to assist you!

# Does the Diagram in WinForms have any control like Drawing Explorer in MS Visio?

Yes, v5.1 of Essential® Diagram provides a new control called Document Explorer, an explorer window that displays the information about the nodes and the layers that are present in /added to the diagram model.

[Syncfusion® Inc.](https://www.syncfusion.com/)

# How to I set Custom Databinding in Chart?

We can bind the data using IChartSeriesModel interface. This interface requires the implementation of one property, two methods and one optional event. So, we easily provide a custom implementation of this interface.

## C#

    //Creating series data and binding to the array model
    
    ChartSeries series1 = this.chartControl1.Model.NewSeries("Series 1");
    
    series1.SeriesIndexedModelImpl = new ArrayModel(new double[]{22,24,32,12,18});
    
    series1.Type = ChartSeriesType.Bar;
    
    this.chartControl1.Series.Add(series1);

## VB

    'Creating series data and binding to the array model
    
    Dim series1 As ChartSeries = Me.chartControl1.Model.NewSeries("Series 1")
    
    series1.SeriesIndexedModelImpl = New ArrayModel(New Double(){22,24,32,12,18})
    
    series1.Type = ChartSeriesType.Bar
    
    Me.chartControl1.Series.Add(series1)

This is illustrated in the Chart UG in this topic:

[CustomData Binding](http://help.syncfusion.com/UG/User%20Interface/Windows%20Forms/Chart/Documents/implementingcustomdatabindinginterfaces1.htm)

# How to handle date values in chart axes in WinForms Chart?

Syncfusion® [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts"), allow the chart axes to use dates as their value type. This functionality is controlled via the [ValueType](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_ValueType "ValueType") property.

To specify the range type of the axis, the [RangeType](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_RangeType "RangeType") property is used. You can set the date and time range using the [DateTimeRange](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_DateTimeRange "DateTimeRange ") property, while the format of the date and time can be specified with the [DateTimeFormat](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_DateTimeFormat "DateTimeFormat") property. The interval type is determined by the [IntervalType](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartAxis.html#Syncfusion_Windows_Forms_Chart_ChartAxis_IntervalType "IntervalType") property.

    //Configure the chart series
    ChartSeries chartSeries = new ChartSeries("YValue");
    chartSeries.Type = ChartSeriesType.Line;
    
    //Specify the IntervalType
    this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.DateTime;
    this.chartControl1.PrimaryXAxis.IntervalType = ChartDateTimeIntervalType.Days;
    this.chartControl1.PrimaryXAxis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
    
    //Specify the RangeType
    this.chartControl1.PrimaryXAxis.RangeType = ChartAxisRangeType.Set;
    this.chartControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(start, start.AddDays(42), 7, ChartDateTimeIntervalType.Days);
    this.chartControl1.PrimaryXAxis.DateTimeInterval.Type = ChartDateTimeIntervalType.Days;
    this.chartControl1.PrimaryXAxis.DateTimeFormat = "dd,MMM, dddd";
    
    //Update the data points to the chart series
    foreach (var data in dataSource)
    {
        chartSeries.Points.Add(data.Date, data.YValue);
    }
    this.chartControl1.Series.Add(chartSeries);

    'Configure the Chart Series
    Dim start As New DateTime(1999, 1, 1)
    Dim chartSeries As New ChartSeries("YValue")
    chartSeries.Type = ChartSeriesType.Line
    
    'Specify the Interval Type
    columnChart.PrimaryXAxis.ValueType = ChartValueType.DateTime
    columnChart.PrimaryXAxis.IntervalType = ChartDateTimeIntervalType.Days
    columnChart.PrimaryXAxis.EdgeLabelsDrawingMode = ChartAxisEdgeLabelsDrawingMode.Shift;
    
    'Specify the Range Type
    columnChart.PrimaryXAxis.RangeType = ChartAxisRangeType.Set
    columnChart.PrimaryXAxis.DateTimeRange = New ChartDateTimeRange(start, start.AddDays(42), 7, ChartDateTimeIntervalType.Days)
    columnChart.PrimaryXAxis.DateTimeInterval.Type = ChartDateTimeIntervalType.Days
    columnChart.PrimaryXAxis.DateTimeFormat = "dd,MMM, dddd"
    
    'Update the data point to the series points
    For Each salesData In dataSource
        chartSeries.Points.Add(salesData.Date1, salesData.YValue)
    Next
    columnChart.Series.Add(chartSeries)

**Output:**

![date values in chart axes](https://support.syncfusion.com/kb/attachment/article/1181/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0OTc4Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.KSrkzsvkg0toiT1xI2z0NQMur6YEGETurY306k58LvM)

**Conclusion**

I hope you enjoyed learning about how to work with Date values in chart axes in WinForms Chart.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/pricing)****page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/windowsforms?control=chart), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to bind a dataset from a database to the WinForms Chart?

In this guide, we will demonstrate how to bind data from a database using the **ChartDataBindModel** class in [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Chart"). We will cover setting the data source, configuring the **XName** and **YNames** properties, and using the **ChartDataBindAxisLabelModel** class to load X-axis labels from the database.

    //Custom Dataset bound to the Demographics table
    DataSet dataSet1 = new DataSet("DataSet1");
    DataTable demographicsTable = new DataTable("Demographics");
    demographicsTable.Columns.Add("ID", typeof(int));
    demographicsTable.Columns.Add("City", typeof(string));
    demographicsTable.Columns.Add("Population", typeof(int));
    demographicsTable.Rows.Add(1, "Chennai", 8000000);
    demographicsTable.Rows.Add(2, "Mumbai", 12400000);
    demographicsTable.Rows.Add(3, "Delhi", 11000000);
    demographicsTable.Rows.Add(4, "Bangalore", 8500000);
    demographicsTable.Rows.Add(5, "Hyderabad", 6800000);
    demographicsTable.Rows.Add(6, "Kolkata", 4500000);
    dataSet1.Tables.Add(demographicsTable);
    ChartDataBindModel model = new ChartDataBindModel(dataSet1, "Demographics");
    
    //Column that contains the X values
    model.XName = "ID";
    
    //Column that contains the Y values
    model.YNames = new string[] { "Population" };
    
    //Configure the chart series
    ChartSeries series = new ChartSeries();
    series.Type = ChartSeriesType.Line;
    series.SeriesModelImpl = model;
    this.chartControl1.Series.Add(series);
    
    //The columns that has the label values corresponding X values
    ChartDataBindAxisLabelModel xAxisLabelModel = new ChartDataBindAxisLabelModel(dataSet1, "Demographics");
    xAxisLabelModel.LabelName = "City";
    this.chartControl1.PrimaryXAxis.LabelsImpl = xAxisLabelModel;
    this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.Custom;

    'Custom Dataset bound to Demographics tables
    Dim dataset11 As New DataSet("Dataset1")
    Dim demographicstable As New DataTable("Demographics")
    demographicstable.Columns.Add("ID", GetType(Integer))
    demographicstable.Columns.Add("City", GetType(String))
    demographicstable.Columns.Add("Population", GetType(Integer))
    demographicstable.Rows.Add(1, "Chennai", 8000000)
    demographicstable.Rows.Add(2, "Mumbai", 12400000)
    demographicstable.Rows.Add(3, "Delhi", 11000000)
    demographicstable.Rows.Add(4, "Bangalore", 8500000)
    demographicstable.Rows.Add(5, "Hyderabad", 6800000)
    demographicstable.Rows.Add(6, "Kolkata", 4500000)
    dataset11.Tables.Add(demographicstable)
    Dim model As New ChartDataBindModel(dataset11, "Demographics")
    
    'Column that contains the X values
    model.XName = "ID"
    
    'Column that contains the Y values
    model.YNames = New String() {"Population"}
    
    'Configure the chart series
    Dim series As ChartSeries = Me.lineChart.Model.NewSeries("data bound series")
    series.Type = ChartSeriesType.Line
    series.SeriesModelImpl = model
    lineChart.Series.Add(series)
    
    'The columns that has the label values corresponding X values
    Dim xaxislabelmodel = New ChartDataBindAxisLabelModel(dataset11, "Demographics")
    xaxislabelmodel.LabelName = "City"
    lineChart.PrimaryXAxis.LabelsImpl = xaxislabelmodel
    lineChart.PrimaryXAxis.ValueType = ChartValueType.Custom

This is illustrated in the Chart UG in this topic: [DataBinding](https://help.syncfusion.com/windowsforms/chart/chart-data "DataBinding")

**Output:**

![bind a dataset to the WinForms Chart](https://support.syncfusion.com/kb/attachment/article/1182/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1MDEyIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.XQ5SYV-uL3v0gLY1xrlOx94gmE_OXkvQUhfxVbyOGxI)

**Conclusion**

I hope you enjoyed learning about how to bind a dataset to the [**WinForms Chart**](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Chart")**.**

You can refer to ourhttp://help.syncfusion.com/UG/User%20Interface/Windows%20Forms/Chart/Documents/chartdatabindingwithienumerables1.htm[WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How can I detect the right click on a node?

﻿The right click on a node can be detected using the [WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram "https://www.syncfusion.com/winforms-ui-controls/diagram") MouseUp event as shown in the following code snippet,

C#

private void diagram1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e){   if (e.Button == MouseButtons.Right && this.diagram1.Controller.NodesHit.Count > 0 && this.diagram1.View.SelectionList.Count != 0)   {       if (this.diagram1.View.SelectionList.First is FilledPath)       {           this.contextMenu1.Show(this.diagram1, new Point(e.X, e.Y));       }   }}

VB

Private Sub diagram1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles diagram1.MouseUp   If e.Button = Windows.Forms.MouseButtons.Right AndAlso Me.diagram1.Controller.NodesHit.Count > 0 AndAlso Me.diagram1.View.SelectionList.Count <> 0 Then       If TypeOf Me.diagram1.View.SelectionList.First Is FilledPath Then           Me.contextMenu1.Show(Me.diagram1, New Point(e.X, e.Y))       End If   End IfEnd Sub

**Conclusion**

I hope you enjoyed learning about how to detect the right click on a node.

You can refer to our [WinForms Diagram feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations. You can also explore our[WinForms Diagram documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?searchtext=diagram). We are always happy to assist you!

# Is it possible to have the context menu by right clicking the node?

## Display context menu on a selected Node

It is possible to display a context menu on a selected node. To display the context menu on the selected node and add it to new nodes, the following JavaScript should be used.

// To display the context menufunction attachevent(){document.getElementById('DiagramWebControl1').oncontextmenu=function(){PosX = ConvertXYToDocument(Diagram.GetRootElement(), event.clientX, event.clientY, Diagram.GetMagnification()).x;PosY = ConvertXYToDocument(Diagram.GetRootElement(), event.clientX, event.clientY, Diagram.GetMagnification()).y;Popup.ShowPopup(event.clientX, event.clientY);return false;};}function OnContextMenuClick(Obj){if (Obj.Text != "Edit"){Diagram.Refresh(Obj.Text + "|" + PosX + "|" + PosY);}else if (IsNodeSelected){alert("Not implemented");}else{alert("Please select a Node to Edit");}return false;}

**Conclusion**

I hope you enjoyed learning about whether it is possible to have the context menu by right-clicking the node.

You can refer to [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to display errorbars in WinForms Chart?

Error bars are used to represent the variability of data in WinForms charts, showing the upper and lower bounds of the data points. In this guide, we will explain how to enable error bars, customize their appearance, and specify different symbols for various series in Syncfusion® [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts").

Error bars can be displayed by setting the [DrawErrorBars](https://help.syncfusion.com/windowsforms/chart/chart-series#drawerrorbars "DrawErrorBars") property to true. You can also customize the shape of the error bar's symbol using the **ErrorBarsSymbolShape** property. Currently, error bars can be applied only to line charts, where the symbol signifies the top and bottom errors of the chart. Moreover, you can specify separate symbols to represent different series.

    //Assign the X and Y axes
    this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.Double;
    this.chartControl1.PrimaryYAxis.ValueType = ChartValueType.Double;
    
    // Configure the chart series
    ChartSeries series = new ChartSeries("Series", ChartSeriesType.Line);
    series.Points.Add(1, new double[] { 15, 3 });
    series.Points.Add(2, new double[] { 28, 6 });
    series.Points.Add(3, new double[] { 23, 5 });
    series.Points.Add(4, new double[] { 35, 7 });
    series.Points.Add(5, new double[] { 12, 2 });
    series.Points.Add(6, new double[] { 41, 6 });
    series.Points.Add(7, new double[] { 30, 5 });
    this.chartControl1.Series.Add(series);
    
    //Enable error bars to the line chart
    this.chartControl1.Series[0].DrawErrorBars = true;
    this.chartControl1.Series[0].ErrorBarsSymbolShape = ChartSymbolShape.Circle;

    'Assign the X And Y axes
    lineChart.PrimaryXAxis.ValueType = ChartValueType.Double
    lineChart.PrimaryYAxis.ValueType = ChartValueType.Double
    
    'Configure the chart series
    Dim series = New ChartSeries("Series", ChartSeriesType.Line)
    series.Points.Add(1, New Double() {15, 3})
    series.Points.Add(2, New Double() {28, 6})
    series.Points.Add(3, New Double() {23, 5})
    series.Points.Add(4, New Double() {35, 7})
    series.Points.Add(5, New Double() {12, 2})
    series.Points.Add(6, New Double() {41, 6})
    series.Points.Add(7, New Double() {30, 5})
    lineChart.Series.Add(series)
    
    'Enable error bars to the line chart
    lineChart.Series(0).DrawErrorBars = True
    lineChart.Series(0).ErrorBarsSymbolShape = ChartSymbolShape.Circle

**Output:**

![display errorbars in chart](https://support.syncfusion.com/kb/attachment/article/1185/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1MDY5Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.QuDWlwbNj4tbW9SQ4j4qCpDq9XTgKBVHwgwb7ENfYQ4)

**Conclusion**

I hope you enjoyed learning about how to display **ErrorBars** in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to set custom points in WinForms Chart?

You can define custom points by plotting them on the chart area, even if they do not belong to any series. These custom points are stored in the ChartControl's [CustomPoints](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartCustomPointCollection.html "CustomPoints") collection and can be used for annotating interesting data on [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts"). The [ChartCustomPoint](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartCustomPoint.html "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartCustomPoint.html") class provides properties to set text, background, borders, or symbols at a specific point on the chart area.

Custom points can be categorized into the following four types:

- **PointFollow** - This type of custom point will track the regular points of any series to which it is assigned.
- **ChartCoordinates** - This allows you to render a point type at any specific location in the chart.
- **Percent** - The coordinates are specified as a percentage of the chart area.
- **Pixel**  **** - The coordinates are specified in pixels relative to the chart area.

    //Assign the X and Y axes
    this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.Category;
    this.chartControl1.PrimaryYAxis.ValueType = ChartValueType.Double;
    
    //Configure the chart series
    CategoryAxisDataBindModel dataSeriesModel = new CategoryAxisDataBindModel(dataSource);
    dataSeriesModel.CategoryName = "Year";
    dataSeriesModel.YNames = new string[] { "Sales" };
    ChartSeries chartSeries = new ChartSeries("Sales");
    chartSeries.Type = ChartSeriesType.Column;
    chartSeries.CategoryModel = dataSeriesModel;
    
    // Add all custom points to the chart
    ChartCustomPoint cp1 = new ChartCustomPoint();
    cp1.PointIndex = 0;
    cp1.SeriesIndex = 0;
    cp1.CustomType = ChartCustomPointType.PointFollow;
    cp1.Text = "Start (1999)";
    cp1.Font.FontStyle = FontStyle.Bold;
    cp1.Alignment = ChartTextOrientation.UpRight;
    cp1.Symbol.Shape = ChartSymbolShape.Diamond;
    cp1.Symbol.Size = new Size(18, 18);
    cp1.Symbol.Color = Color.Green;
    
    ChartCustomPoint cp2 = new ChartCustomPoint();
    cp2.PointIndex = 4;
    cp2.SeriesIndex = 0;
    cp2.CustomType = ChartCustomPointType.PointFollow;
    cp2.Text = "Milestone (2003)";
    cp2.Font.FontStyle = FontStyle.Bold;
    cp2.Alignment = ChartTextOrientation.UpLeft;
    cp2.Symbol.Shape = ChartSymbolShape.Circle;
    cp2.Symbol.Size = new Size(18, 18);
    cp2.Symbol.Color = Color.Blue;
    
    ChartCustomPoint cp3 = new ChartCustomPoint();
    cp3.PointIndex = 8;
    cp3.SeriesIndex = 0;
    cp3.CustomType = ChartCustomPointType.PointFollow;
    cp3.Text = "Peak (2007)";
    cp3.Font.FontStyle = FontStyle.Bold;
    cp3.Alignment = ChartTextOrientation.UpLeft;
    cp3.Symbol.Shape = ChartSymbolShape.Triangle;
    cp3.Symbol.Size = new Size(18, 18);
    cp3.Symbol.Color = Color.Red;
    
    this.chartControl1.CustomPoints.Add(cp1);
    this.chartControl1.CustomPoints.Add(cp2);
    this.chartControl1.CustomPoints.Add(cp3);

    'Assign the X and Y axes
    columnChart.PrimaryXAxis.ValueType = ChartValueType.Category
    columnChart.PrimaryYAxis.ValueType = ChartValueType.Double
    
    'Configure the chart series
    Dim dataSeriesModel = New CategoryAxisDataBindModel(viewModel.PlantDetails)
    dataSeriesModel.CategoryName = "Year"
    dataSeriesModel.YNames = New String() {"Sales"}
    ChartSeries1.Type = ChartSeriesType.Column
    ChartSeries1.CategoryModel = dataSeriesModel
    columnChart.Series.Add(ChartSeries1)
    
    'Add the custom points to the series
    Dim cp1 = New ChartCustomPoint()
    cp1.PointIndex = 0
    cp1.SeriesIndex = 0
    cp1.CustomType = ChartCustomPointType.PointFollow
    cp1.Text = "Start (1999)"
    cp1.Font.FontStyle = FontStyle.Bold
    cp1.Alignment = ChartTextOrientation.UpRight
    cp1.Symbol.Shape = ChartSymbolShape.Diamond
    cp1.Symbol.Size = New Size(18, 18)
    cp1.Symbol.Color = Color.Green
    
    Dim cp2 = New ChartCustomPoint()
    cp2.PointIndex = 4
    cp2.SeriesIndex = 0
    cp2.CustomType = ChartCustomPointType.PointFollow
    cp2.Text = "Milestone (2003)"
    cp2.Font.FontStyle = FontStyle.Bold
    cp2.Alignment = ChartTextOrientation.UpLeft
    cp2.Symbol.Shape = ChartSymbolShape.Circle
    cp2.Symbol.Size = New Size(18, 18)
    cp2.Symbol.Color = Color.Blue
    
    Dim cp3 = New ChartCustomPoint()
    cp3.PointIndex = 8
    cp3.SeriesIndex = 0
    cp3.CustomType = ChartCustomPointType.PointFollow
    cp3.Text = "Peak (2007)"
    cp3.Font.FontStyle = FontStyle.Bold
    cp3.Alignment = ChartTextOrientation.UpLeft
    cp3.Symbol.Shape = ChartSymbolShape.Triangle
    cp3.Symbol.Size = New Size(18, 18)
    cp3.Symbol.Color = Color.Red
    
    columnChart.CustomPoints.Add(cp1)
    columnChart.CustomPoints.Add(cp2)
    columnChart.CustomPoints.Add(cp3)

**Output:**

![custom points chart](https://support.syncfusion.com/kb/attachment/article/1186/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1MjA0Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.VNpCpJpRqTP2rlxevR17kWQxDNGa_qcsWjTyQ2Rp2Nk)

**Conclusion**

I hope you enjoyed learning about how to set custom points in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How do I enable the single link between the nodes?

In [WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram "https://www.syncfusion.com/winforms-ui-controls/diagram"), we can eliminate creating two links for the same two symbols by checking the link nodes' FromNode and ToNode properties. While creating lines, we have to check the endpoints. If the endpoints already exist with the symbols, then we have to remove the link. While creating links, we can get the link endpoints using the ConnectionsChanged event.

C#

// Adding ConnectionChanged event((DocumentEventSink)model1.EventSink).ConnectionsChanged += new CollectionExEventHandler(MainForm_ConnectionsChanged);// Eventvoid MainForm_ConnectionsChanged(CollectionExEventArgs evtArgs){    if (evtArgs.ChangeType == CollectionExChangeType.Insert)    {        foreach (Node n1 in this.diagram1.Model.Nodes)        {            Line tl = n1 as Line;            if (n1 is Line)            {                Line lc1 = n1 as Line;                foreach (Node n in this.diagram1.Model.Nodes)                {                    if (n is Line && n != n1)                    {                        Line lc = n as Line;                        if (((lc1.FromNode == lc.FromNode) && (lc1.ToNode == lc.ToNode)) || ((lc1.ToNode == lc.FromNode) && (lc1.FromNode == lc.ToNode)))                        {                            this.diagram1.Model.RemoveChild(lc1);                            MessageBox.Show("Already, a link has been created for the symbols.");                        }                    }                }            }        }    }}

VB

' Adding ConnectionChanged eventAddHandler (CType(model1.EventSink, DocumentEventSink)).ConnectionsChanged, AddressOf MainForm_ConnectionsChanged' EventSub MainForm_ConnectionsChanged(evtArgs As CollectionExEventArgs)    If evtArgs.ChangeType = CollectionExChangeType.Insert Then        For Each n1 As Node In Me.diagram1.Model.Nodes            Dim tl As Line = TryCast(n1, Line)            If TypeOf n1 Is Line Then                Dim lc1 As Line = TryCast(n1, Line)                For Each n As Node In Me.diagram1.Model.Nodes                    If TypeOf n Is Line AndAlso Not n Is n1 Then                        Dim lc As Line = TryCast(n, Line)                        If ((lc1.FromNode = lc.FromNode) AndAlso (lc1.ToNode = lc.ToNode)) OrElse ((lc1.ToNode = lc.FromNode) AndAlso (lc1.FromNode = lc.ToNode)) Then                            Me.diagram1.Model.RemoveChild(lc1)                            MessageBox.Show("Already, a link has been created for the symbols.")                        End If                    End If                Next n            End If        Next n1    End IfEnd Sub
**Conclusion**

I hope you enjoyed learning about
how to enable the single link between the nodes.

You can refer to our [WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram "https://www.syncfusion.com/winforms-ui-controls/diagram")[feature tour](https://www.syncfusion.com/winforms-ui-controls/diagram "https://www.syncfusion.com/winforms-ui-controls/diagram") page
to learn about its other groundbreaking feature representations. You can also
explore our [WinForms Diagram](https://help.syncfusion.com/windowsforms/diagram/getting-started "https://help.syncfusion.com/windowsforms/diagram/getting-started")[documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started "https://help.syncfusion.com/windowsforms/diagram/getting-started") to understand how to
present and manipulate data.

For current customers, you can
check out our WinForms components from the [License
and Downloads](https://www.syncfusion.com/account/downloads) page. If you are new to
Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to
check out our WinForms Diagram and other WinForms components.

If you have any queries or
require clarifications, please let us know in the comments below. You can also
contact us through our [support
forums](https://www.syncfusion.com/forums), [Direct-Trac](https://support.syncfusion.com/create),
or [feedback
portal](https://www.syncfusion.com/feedback/aspnet-mvc?control=circulargauge). We are always happy to assist you!

# How to set a border for the chart area in WinForms Chart?

In [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts"), the **ChartArea**class allows you to customize the appearance of a chart's border. You can apply various border styles, set the border color, and increase the border's width to enhance the visual presentation of your charts.

    // Setting Border for the Chart Area
    this.chartControl1.ChartArea.BorderStyle = BorderStyle.FixedSingle;
    this.chartControl1.ChartArea.BorderColor = Color.Blue;
    this.chartControl1.ChartArea.BorderWidth = 3;

    ' Setting Border for the Chart Area
    columnChart.ChartArea.BorderStyle = BorderStyle.FixedSingle
    columnChart.ChartArea.BorderColor = Color.Blue
    columnChart.ChartArea.BorderWidth = 3

**Output:**

**![set a border for the chart](https://support.syncfusion.com/kb/attachment/article/1188/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0OTgxIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.cIc9nuNSFXNTIOszUG7l0ROZo4KEqJabNUpHbgWBy84)**

**Conclusion**

I hope you enjoyed learning about how to set a border for the Chart Area in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How do I use Essential Chart to visualize data from Essential Grid?

Essential Chart offers great interaction capabilities with Essential Grid.

## Data Model

Essential Grid and Chart can share a common data model.

Essential Grid can also serve as a data model for the chart. In the sample displayed below, the grid control is acting as a data model for the chart. Selected columns are automatically mapped into the chart. All that it takes is a few lines of code to implement a model that adapts the data in question (in this case grid cells) for display in the chart.

The sample can be downloaded here [C#]: [https://help.syncfusion.com/js/datamanager/overview](https://help.syncfusion.com/js/datamanager/overview)

[Image](http://www.syncfusion.com/products/chart/features/images/grid_with_chart.gif)

# I want to change the layout on the diagram nodes at run time. Is there any possibility for doing this?

## Change the layout on diagram nodes at run time. 

We can apply any layout mechanism that are available with Diagram at runtime easily by using the Layout Dialog Editor which is shipped with the Essential® Diagram

This is demonstrated in the In Depth\ Diagram Builder sample.

[Syncfusion® Inc.](https://www.syncfusion.com/)

# How to customize the series text in WinForms Chart?

Using the **ChartStyleInfo** class, you can customize the series text in a [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Chart"). By enabling the DisplayText property, you can display the series text. Additionally, you can modify the series text by setting the font styles, text color, and text alignment.

    // Enabling Series Text
    
    this.chartControl1.Series[0].Style.DisplayText = true;
    
    //Customize the series text
    
    this.chartControl1.Series[0].Style.Font.Facename = "Times New Roman";
    
    this.chartControl1.Series[0].Style.Font.FontStyle = FontStyle.Bold;
    
    this.chartControl1.Series[0].Style.TextColor =Color.Blue;

    ' Enabling Series Text
    
    Me.chartControl1.Series(0).Style.DisplayText = True
    
    'Customize the series text
    
    Me.chartControl1.Series(0).Style.Font.Facename = "Times New Roman"
    
    Me.chartControl1.Series(0).Style.Font.FontStyle = FontStyle.Bold
    
    Me.chartControl1.Series(0).Style.TextColor =Color.Blue

**Output**

**![customize the series text](https://support.syncfusion.com/kb/attachment/article/1191/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0NTI2Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.YRH1Rnztn75fGfB3ct2LVjkIqWyNNfsHlZpfX_gNmPc)**

**Conclusion**

I hope you enjoyed learning about how to customize the series text in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "https://help.syncfusion.com/windowsforms/chart/getting-started").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart "https://www.syncfusion.com/winforms-ui-controls/chart")to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started "https://help.syncfusion.com/windowsforms/chart/getting-started"), and how to quickly get started with configuration specifications. You can also explore our WinForms Chart examples to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense "https://www.syncfusion.com/sales/teamlicense") page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/account/manage-trials/downloads "https://www.syncfusion.com/account/manage-trials/downloads") to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/ "https://www.syncfusion.com/forums/"), [Direct-Trac](https://support.syncfusion.com/create "https://support.syncfusion.com/create"), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart "https://www.syncfusion.com/feedback/winforms?control=chart"). We are always happy to assist you!

# How can I move/place the nodes outside the diagram model bounds?

## How can I move/place the nodes outside the diagram model bounds?

Setting the model's boundary constraint enabled to false will let you place the nodes outside of the diagram bounds.

Below is the sample code snippet for your reference.

C#

this.diagram1.Model.BoundaryConstraintEnabled = false;

VB

Me.diagram1.Model.BoundaryConstraintEnabled = false

**Conclusion**

I hope you enjoyed learning about how can I move/place the nodes outside the diagram model bounds.

You can refer to our [WinForms Diagram](https://www.syncfusion.com/winforms-ui-controls/diagram)feature tour page to learn about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [WinForms Diagram example](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms)to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

http://www.syncfusion.com/
http://www.syncfusion.com/

# How to drag and drop chart series points at runtime in WinForms Chart?

To enable dragging and repositioning of chart series points in [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls "WinForms Charts"), you can calculate new X and Y values during [ChartRegionMouse](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs.html "ChartRegionMouse") Events such as **MouseUp**, **MouseDown**, and **MouseMove**. These new X and Y values are derived from the mouse coordinates using the **GetValueByPoint** method, which returns the chart's data values corresponding to the mouse position.

    private int seriesIndex = -1;
    private int selectedIndex = -1;
    private bool isSelected = false;
    
    this.chartControl1.ChartRegionMouseDown += ChartControl1_ChartRegionMouseDown;
    this.chartControl1.ChartRegionMouseMove += ChartControl1_ChartRegionMouseMove;
    this.chartControl1.ChartRegionMouseUp += ChartControl1_ChartRegionMouseUp;
    
    private void ChartControl1_ChartRegionMouseDown(object sender, ChartRegionMouseEventArgs e)
    {
        if (e.Region != null && e.Region.IsChartPoint)
        {
            seriesIndex = e.Region.SeriesIndex;
            selectedIndex = e.Region.PointIndex;
            isSelected = true;
        }
    }
    
    private void ChartControl1_ChartRegionMouseMove(object sender, ChartRegionMouseEventArgs e)
    {
        if (isSelected && seriesIndex != -1 && selectedIndex != -1)
        {
            double newY = this.chartControl1.ChartArea.GetValueByPoint(e.Point).YValues[0];
            this.chartControl1.Series[seriesIndex].Points[selectedIndex].YValues[0] = newY;
            this.chartControl1.Refresh();
        }
    }
    
    private void ChartControl1_ChartRegionMouseUp(object sender, ChartRegionMouseEventArgs e)
    {
        if (isSelected)
        {
            isSelected = false;
            this.chartControl1.Redraw(true);
            selectedIndex = -1;
            seriesIndex = -1;
        }
    }

    Private seriesIndex As Integer = -1
    Private selectedIndex As Integer = -1
    Private isSelected As Boolean = False
    
    AddHandler lineChart.ChartRegionMouseDown, AddressOf ChartControl1_ChartRegionMouseDown
    AddHandler lineChart.ChartRegionMouseMove, AddressOf ChartControl1_ChartRegionMouseMove
    AddHandler lineChart.ChartRegionMouseUp, AddressOf ChartControl1_ChartRegionMouseUp
    
    Private Sub ChartControl1_ChartRegionMouseDown(sender As Object, e As ChartRegionMouseEventArgs)
        If e.Region IsNot Nothing AndAlso e.Region.IsChartPoint Then
            seriesIndex = e.Region.SeriesIndex
            selectedIndex = e.Region.PointIndex
            isSelected = True
        End If
    End Sub
    
    Private Sub ChartControl1_ChartRegionMouseMove(sender As Object, e As ChartRegionMouseEventArgs)
        If isSelected AndAlso seriesIndex <> -1 AndAlso selectedIndex <> -1 Then
            Dim newY As Double = lineChart.ChartArea.GetValueByPoint(e.Point).YValues(0)
            lineChart.Series(seriesIndex).Points(selectedIndex).YValues(0) = newY
            lineChart.Refresh()
        End If
    End Sub
    
    Private Sub ChartControl1_ChartRegionMouseUp(sender As Object, e As ChartRegionMouseEventArgs)
        If isSelected Then
            isSelected = False
            lineChart.Redraw(True)
            selectedIndex = -1
            seriesIndex = -1
        End If
    End Sub

**Output:**

![series drag drop](https://support.syncfusion.com/kb/attachment/article/1193/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1NDkyIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.4__0FA4OWfKStpjpwM42c6QSG6YpTjidqzZxSpNTjXk)

**Conclusion**

I hope you enjoyed learning about how to drag and drop chart series points at runtime in [**WinForms Chart**](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to trigger the ChartRegionEvents in the WinForms Chart?

The [ChartRegionMouseEventHandler](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs.html "ChartRegionMouseEventHandler") is a crucial component used to handle mouse-related events in a [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Chart"). These regions include Axis Labels, Chart Points, or any Custom Regions within the chart.

When a user interacts with these regions using the mouse, several mouse-related events can be triggered. Depending on the region of interaction, the following events may occur:

- ChartRegionClick Event
- ChartRegionMouseEnter Event
- ChartRegionMouseHover Event
- ChartRegionMouseMove Event
- ChartRegionMouseLeave Event
- ChartRegionMouseUp Event
- ChartRegionMouseDown Event

    // Add the ChartRegionMouseDown event
    this.chartControl1.ChartRegionMouseDown += new Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventHandler(this.chartControl1_ChartRegionMouseDown);
    
    // Specifies Action to the ChartRegionMouseDown Event
    private void chartControl1_ChartRegionMouseDown(object sender, Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs e)
    {
        if (e.Region.SeriesIndex == 0)
        {
            OutputText.Text = (String.Format("MouseDown Series 1 Bar {0} Point : {1}", e.Region.PointIndex, e.Point));
        }
    }

    'Add the ChartRegionMouseDown Event
    AddHandler columnChart.ChartRegionMouseDown, AddressOf chartControl1_ChartRegionMouseDown
    
    'Specifies Action to the ChartRegionMouseDown Event
    Private Sub chartControl1_ChartRegionMouseDown(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs)
    
    If e.Region.SeriesIndex = 0 Then
    
    outputText.Text = (String.Format("MouseDown Series 1 Bar {0} Point : {1}", e.Region.PointIndex, e.Point))
    
    End If
    
    End Sub

**Output:**

![trigger chart region events output](https://support.syncfusion.com/kb/attachment/article/1194/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ0OTEwIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.f68Uex1LSNf2iizsrBHf4BOFvv_Ji3TvcecEIx6UWQE)

**Conclusion**

I hope you enjoyed learning about how to trigger the [ChartRegionEvents](https://help.syncfusion.com/windowsforms/chart/chart-control-events#chart-region-events "ChartRegionEvents") in the [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# What are the different Chart types supported by Syncfusion Winforms Chart?

The [**WinForms Chart**](https://www.syncfusion.com/winforms-ui-controls/chart) control supports various types of charts
including Area Charts, Line Charts, Financial Charts, Bar Charts, Accumulation
Charts, Pie Charts, Polar and Radar Charts, as well as Bubble and Scatter
Charts. For each chart, any number of series can be added. The **Points.Add()** method is used to add points to a series, and
the **Series.Add()** method is used to incorporate a series into the
Chart Control. The [**ChartSeriesType**](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSeriesType.html "https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartSeriesType.html") enumeration is utilized to select the particular
type of chart.

For more details on supported chart types, refer to the WinForms Chart [**documentation**](https://help.syncfusion.com/windowsforms/chart/chart-types).

The following code snippet
illustrates how to create a Bar Chart:

    this.chartControl1 = new ChartControl();
    . . .
    
    // Creating first series
    ChartSeries series1 = new ChartSeries("Server1", ChartSeriesType.Bar);
    series1.Text = series1.Name;
    series1.Points.Add(0, 25);
    series1.Points.Add(1, 49);
    series1.Points.Add(2, 38);
    series1.Points.Add(3, 43);
    series1.Points.Add(4, 32);
    
    // Creating second series
    ChartSeries series2 = new ChartSeries("Server 2", ChartSeriesType.Bar);
    series2.Text = series2.Name;
    series2.Points.Add(0, 43);
    series2.Points.Add(1, 45);
    series2.Points.Add(2, 40);
    series2.Points.Add(3, 36);
    series2.Points.Add(4, 42);
    
    // Adding the series into Chart control
    this.chartControl1.Series.Add(series1);
    this.chartControl1.Series.Add(series2);

    Me.ChartControl1 = New ChartControl()
    . . .
    
    ' Creating first series
    Dim series1 As ChartSeries = New ChartSeries("Server1", ChartSeriesType.Bar)
    series1.Text = series1.Name
    series1.Points.Add(0, 25)
    series1.Points.Add(1, 49)
    series1.Points.Add(2, 38)
    series1.Points.Add(3, 43)
    series1.Points.Add(4, 32)
    
    ' Creating second series
    Dim series2 As ChartSeries = New ChartSeries("Server 2", ChartSeriesType.Bar)
    series2.Text = series2.Name
    series2.Points.Add(0, 43)
    series2.Points.Add(1, 45)
    series2.Points.Add(2, 40)
    series2.Points.Add(3, 36)
    series2.Points.Add(4, 42)
    
    ' Adding the series into Chart control
    Me.ChartControl1.Series.Add(series1)
    Me.ChartControl1.Series.Add(series2)

**Output**

![](https://support.syncfusion.com/kb/attachment/article/1195/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU2NjEyIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.86r_Mea0H2P1UB6eqMEtkIVEaTpM8FBwBcPInvPEO0c)

**Conclusion**

I hope you enjoyed learning
about different Chart types supported in Syncfusion Winforms Chart.

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How do I prevent the nodes from being rotated?

## Prevent Node rotation

This can be done by raising the Diagram.Model.EventSink.RotationChanging event and cancelling the operation.

Below is the sample code snippet for your reference.

C#

this.diagram1.Model.EventSink.RotationChanging += new RotationChangingEventHandler(EventSink_RotationChanging);
    void EventSink_RotationChanging(RotationChangingEventArgs evtArgs)
    {
    evtArgs.Cancel = true;
    }

VB

Me.diagram1.Model.EventSink.RotationChanging += New RotationChangingEventHandler(EventSink_RotationChanging)
    Private Sub EventSink_RotationChanging(ByVal evtArgs As RotationChangingEventArgs)
    evtArgs.Cancel = True
    End Sub
http://www.syncfusion.com/
http://www.syncfusion.com/

# How do I filter particular set of data points in the WinForms Chart series?

Data is filtered on a series-by-series basis, and when a series data points are filtered they can be either removed from the series Points collection or marked as empty in [WinForms Chart](https://www.syncfusion.com/winforms-ui-controls/chart "https://www.syncfusion.com/winforms-ui-controls/chart").  
We can filter a particular set of data points using the Grouping Engine and data changes are reflected in chart.  
Using the group engine we can set the main data source for the whole engine. The TableDescriptor will pick up the ItemProperties from the SourceList and table will be intialized at run-time with records from the list. Using RecordFilterDescriptor class we can filter the chart point values by comparing it against a given constant value. The filtered points added with series.  
  
**C#**

    // Generating Series
    ChartSeries series =this.chartControl1 .Model.NewSeries ("Filter Series",ChartSeriesType.Column );
    series.Text=series.Name;
    list.Clear();
    for(int i=0;i<10;i++)
    {
        a[i]=r.Next(300,500);
        series.Points.Add(i,a[i]);
        list.Add(new Data(i, a[i]));
    }
    this.chartControl1.Series.Add(series);
    // Bind it to the model
    Engine group=new Engine();
    group.SetSourceList (list);
    ExpressionFieldDescriptor exp = new ExpressionFieldDescriptor();
    exp.Expression = "[Y] > "+this.textBox1.Text.ToString();
    RecordFilterDescriptor rfd = new RecordFilterDescriptor(exp.Expression);
    group.TableDescriptor.RecordFilters.Add (rfd);
    System.Diagnostics.Trace.WriteLine("Filtered Record Count:" + group.Table.FilteredRecords.Count);
    System.Diagnostics.Trace.WriteLine("Values greater than 30:");
    // Filtering Data
    this.chartControl1.Series[0].Points.Clear();
    int j = 0;
    foreach(Record rec in group.Table.FilteredRecords)
    {
        string b=rec.GetData().ToString();
        System.Diagnostics.Trace.WriteLine(b);
        this.chartControl1.Series[0].Points.Add(j,Convert.ToDouble(b));
        j++;
    }
    this.label2.Text = "Number of Filtered points: "+group.Table.FilteredRecords.Count.ToString();

**VB**

    ' Generating Series
    Dim series As ChartSeries =Me.chartControl1.Model.NewSeries ("Filter Series",ChartSeriesType.Column)
    series.Text=series.Name
    list.Clear()
    For i As Integer = 0 To 9
    a(i)=r.Next(300,500)
    series.Points.Add(i,a(i))
    list.Add(New Data(i, a(i)))
    Next i
    Me.chartControl1.Series.Add(series)
    ' Bind it to the model
    Dim group As Engine = New Engine()
    group.SetSourceList (list)
    Dim exp As ExpressionFieldDescriptor = New ExpressionFieldDescriptor()
    exp.Expression = "[Y] > " & Me.textBox1.Text.ToString()
    Dim rfd As RecordFilterDescriptor = New RecordFilterDescriptor(exp.Expression)
    group.TableDescriptor.RecordFilters.Add (rfd)
    System.Diagnostics.Trace.WriteLine("Filtered Record Count:" & group.Table.FilteredRecords.Count)
    System.Diagnostics.Trace.WriteLine("Values greater than 30:")
    ' Filtering Data
    Me.chartControl1.Series(0).Points.Clear()
    Dim j As Integer = 0
    For Each rec As Record In group.Table.FilteredRecords
    Dim b As String=rec.GetData().ToString()
    System.Diagnostics.Trace.WriteLine(b)
    Me.chartControl1.Series(0).Points.Add(j,Convert.ToDouble(b))
    j += 1
    Next rec
    Me.label2.Text = "Number of Filtered points: " & group.Table.FilteredRecords.Count.ToString()

****

**Conclusion**

I hope you enjoyed learning about how to filter
particular set of data points in the WinForms Chart series.

You can refer to our [WinForms Charts feature
tour](https://www.syncfusion.com/winforms-ui-controls/chart) page to know about its
other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly
get started for configuration specifications. You can also explore our [WinForms Charts example](https://github.com/syncfusion/winforms-demos/tree/master/chart)to understand how to create and manipulate data.

For current customers, you can check
out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If
you are new to Syncfusion, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out
our other controls.

If you have any queries or require
clarifications, please let us know in the comments section below. You can
also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist
you!

# How to customize background and foreground settings in WinForms Chart?

The chart background image can be set either at runtime or at design time. The **ChartInterior** can set any solid color as the background color of the chart control as well as the chart area in [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts").

The font face of the text can be chosen from any of the system-supported font faces using the Font property of the [ChartStyleInfo](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartStyleInfo.html "ChartStyleInfo") class. The font style of the series text can be changed by selecting any one of the different font styles using the **FontStyle** property of the [ChartFontInfo](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartFontInfo.html "ChartFontInfo") class.

    // Set Chart Background Color
    this.chartControl1.ChartInterior = new BrushInfo(Color.LightGreen);
    
    // Change the font for chart axis
    this.chartControl1.PrimaryXAxis.Font = new Font("Verdana", 10f, FontStyle.Bold);
    this.chartControl1.PrimaryYAxis.Font = new Font("Verdana", 10f, FontStyle.Bold);

    'Set Chart Background Color
    columnChart.ChartInterior = New BrushInfo(Color.LightGreen)
    
    'Change font for chart axis
    columnChart.PrimaryXAxis.Font = New Font("Verdana", 10.0F, FontStyle.Bold)
    columnChart.PrimaryYAxis.Font = New Font("Verdana", 10.0F, FontStyle.Bold)

**Output:**

![customize background and foreground settings](https://support.syncfusion.com/kb/attachment/article/1198/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1MjQxIiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.NA4zzHAH6cXM2kuErWJ5TutnhQ0t5xBAfyODzTQZqH0)

**Conclusion**

I hope you enjoyed learning about how to customize background and foreground settings in [Winforms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "Winforms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# How to dock the chart legend programmatically?

The chart legend can be docked using the Dock property of Dockpanel class and aligned using the Alignment property

The following codes are used to add the legend to a chart, dock the legend to a position, and set its alignment respectively

XAML

    <syncfusion:Chart.Legends>    <syncfusion:ChartLegend syncfusion:ChartDockPanel.Dock="Top" syncfusion:ChartDockPanel.Alignment="Near"/> </syncfusion:Chart.Legends>

When the floating mode is used, the legend can be placed at any place within the chart area using the margin property of the legend class. The following code illustrates how to place the legend in floating mode.

    <syncfusion:ChartLegend syncfusion:ChartDockPanel.Dock="Floating" Margin="10,10,10,10"/>

# How to apply different layout mechanism on the diagram nodes at runtime. Is there any simple way to do this?

## How to apply different layout mechanism on the diagram nodes at runtime.  

Yes, using the Layout Diagram Editor that is shipped with the new version of Diagram can be used to apply/change the layout type on diagram nodes at run time.

This is demonstrated in the Diagram Samples/In Depth / Diagram Builder sample ( Actions/Layout Nodes menu option)

http://www.syncfusion.com/
http://www.syncfusion.com/

# How to change the interior of chart series at run-time?

The interior of a chart series can be changed during run-time by using the context menu in the chart.

To change the interior of chart series at run-time, right-click the chart. In the context menu, select Palettes menu, and then select color palette to be applied to the chart. Make sure that the IsContextMenuEnabled bool property is set to true.

Right-click &gt; Palettes &gt; Palette\_Name

# Is it possible to have an image inside ExpanderSymbol Nodes?

Yes. It is possible to have an image inside ExpanderSymbol Nodes. We can achieve this in two ways.

- 1.Having Bitmap Nodes inside the ExpanderSymbol Nodes
- 2.Having a property called image for each symbol

1.Having Bitmap Nodes inside the ExpanderSymbol Nodes:

The ExpanderSymbol class should inherit from Rectangle, and in its constructor, we have to define a BitmapNode and append it.

C#

public EmployeeSymbol(float x, float y, float width, float height, float fCurveRadius, string path)
    {
    PointF pt = new PointF(x, y);
    node = new BitmapNode(path);
    node.PinPoint = pt;
    node.Size = new System.Drawing.SizeF(120, 80);
    node.LineStyle.LineColor = Color.Transparent;
    this.AppendChild(node);
    }

VB

Public Sub New(ByVal x As Single, ByVal y As Single, ByVal width As Single, ByVal height As Single, ByVal fCurveRadius As Single, ByVal path As String)
     Dim pt As PointF = New PointF(x, y)
    node = New BitmapNode(path)
    node.PinPoint = pt
    node.Size = New System.Drawing.SizeF(120, 80)
    node.LineStyle.LineColor = Color.Transparent
    Me.AppendChild(node)
     End Sub

The above code snippet is used to append the Bitmap node inside an ExpanderSymbol. Here "path" denotes the path of the image, "pt" denotes the location of the image inside the symbol. It will be invoked using the following code,

C#

int x = (int)Session["X"];
    int y = (int)Session["Y"];
    string path = Server.MapPath(String.Empty);
    path = path + @"\App_Data\Image.png";
    EmployeeSymbol emplysymbol = new EmployeeSymbol(x, y, 110, 40, 12, path);

VB

Dim x As Integer = CInt(Session("X"))
    Dim y As Integer = CInt(Session("Y"))
    Dim path As String = Server.MapPath(String.Empty)
    path = path & "\App_Data\Image.png"
    Dim emplysymbol As EmployeeSymbol = New EmployeeSymbol(x, y, 110, 40, 12, path)

Here "x" and "y" values represents the position of the image on the node.

2.Having a property called image for each symbol:

Here we have to create a property called image for each symbol. When each symbol is drawn, we have to set the property, and the image is drawn on the symbol by overriding the Render method using the property value. The below code snippet is used to set the image property of each symbol:

C#

emplysymbol.Image = System.Drawing.Image.FromFile(datasrcpath + (string.Format(@"\Icons\image{0}.png", n)));

VB

Private emplysymbol.Image = System.Drawing.Image.FromFile(datasrcpath & (String.Format("\Icons\image{0}.png", n)))

The below Code snippet illustrate overriding the Render,

C#

protected override void Render(Graphics gfx)
    {
        base.Render(gfx);
        gfx.DrawImage(this._Image, 20,10);
    }

VB

Protected Overrides Sub Render(ByVal gfx As Graphics)
     MyBase.Render(gfx)
     gfx.DrawImage(Me._Image, 20,10)
    End Sub
**Conclusion**

I hope you enjoyed learning about whether it is possible to have an image inside ExpanderSymbol Nodes.

You can refer to the [**WinForms Diagram feature tour**](https://www.syncfusion.com/winforms-ui-controls/diagram) page to learn about its other groundbreaking feature representations and [**documentation**](https://help.syncfusion.com/windowsforms/diagram/getting-started), and how to quickly get started for configuration specifications. You can also explore our [**WinForms Diagram example**](https://github.com/syncfusion/winforms-demos/tree/master/diagram) to understand how to create and manipulate data.

For current customers, you can check out our components from the [**License and Downloads**](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [**free trial**](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [**support forums**](https://www.syncfusion.com/forums), [**Direct-Trac**](https://support.syncfusion.com/create), or [**feedback portal**](https://www.syncfusion.com/feedback/winforms?control=diagram). We are always happy to assist you!

# How to customize the chart area?

The chart area can be customized by setting different properties available in ChartArea class such as Background, Foreground, BorderBrush, BorderThickness, GridBackground etc.

&lt;syncfusion:ChartArea Background="AliceBlue" Foreground="Black" BorderBrush="Black" BorderThickness="1"&gt; &lt;/syncfusion:ChartArea&gt;

# How to represent an image in a legend item in WinForms Chart?

In Syncfusion® [WinForms Charts](https://www.syncfusion.com/winforms-ui-controls/chart "WinForms Charts"), the legend item icon can be represented using different shapes, series types, or images. The [RepresentationType](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Chart.ChartLegend.html#Syncfusion_Windows_Forms_Chart_ChartLegend_RepresentationType "RepresentationType") property is used to specify the type of representation for the icon in a legend item.

    //Assign X and Y axes
    this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.Category;
    this.chartControl1.PrimaryYAxis.ValueType = ChartValueType.Double;
    
    //Configure the series
    CategoryAxisDataBindModel dataSeriesModel = new CategoryAxisDataBindModel(dataSource);
    dataSeriesModel.CategoryName = "Year";
    dataSeriesModel.YNames = new string[] { "Sales" };
    ChartSeries chartSeries = new ChartSeries("Sales");
    chartSeries.CategoryModel = dataSeriesModel;
    this.chartControl1.Series.Add(chartSeries);
    
    //Update the image to the legend icon
    ImageList imageList1 = new ImageList();
    imageList1.ImageSize = new Size(100, 100);
    imageList1.Images.Add(Image.FromFile("D:\\WinForms\\Winforms_Chart_VBSample\\images\\sales.png"));
    chartSeries.Style.Images = new ChartImageCollection(this.imageList1.Images);
    chartSeries.Style.ImageIndex = 0;
    this.chartControl1.Legend.RepresentationType = ChartLegendRepresentationType.SeriesImage;

    'Assign the X and Y axies
    columnChart.PrimaryXAxis.ValueType = ChartValueType.Category
    columnChart.PrimaryYAxis.ValueType = ChartValueType.Double
    
    'Configure the chart series
    For Each salesdata In viewmodel.PlantDetails
        chartseries1.Points.Add(salesdata.Year, salesdata.Sales)
    Next
    chartseries1.Style.DisplayText = True
    chartseries1.Style.TextOrientation = ChartTextOrientation.Up
    
    'Update the image to the legend icon
    Dim imageList1 = New ImageList()
    imageList1.ImageSize = New Size(100, 100)
    imageList1.Images.Add(Image.FromFile("D:\\WinForms\\Winforms_Chart_Sample\\images\\sales.png"))
    chartseries1.Style.Images = New ChartImageCollection(imageList1.Images)
    chartseries1.Style.ImageIndex = 0
    columnChart.Legend.RepresentationType = ChartLegendRepresentationType.SeriesImage

**Output:**

![represent an image in a legend item](https://support.syncfusion.com/kb/attachment/article/1204/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ1MDU0Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.7wZGC9hV6pjEfiIl-5Iu_F5Ds0DqWVDXldoGlm1lTg4)

**Conclusion**

I hope you enjoyed learning about how to represent an image in a legend item in [WinForms Chart](https://help.syncfusion.com/windowsforms/chart/getting-started "WinForms Chart").

You can refer to our [WinForms Chart feature tour page](https://www.syncfusion.com/winforms-ui-controls/chart) to know about its other groundbreaking feature representations and [documentation](https://help.syncfusion.com/windowsforms/chart/getting-started), and how to quickly get started with configuration specifications. You can also explore our [WinForms Chart examples](https://github.com/syncfusion/winforms-demos/tree/master/chart) to understand how to create and manipulate data.

For current customers, you can check out our components from the [License and Downloads](https://www.syncfusion.com/sales/teamlicense) page. If you are new to Syncfusion®, you can try our 30-day [free trial](https://www.syncfusion.com/downloads/windowsforms) to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our [support forums](https://www.syncfusion.com/forums/), [Direct-Trac](https://support.syncfusion.com/create), or [feedback portal](https://www.syncfusion.com/feedback/winforms?control=chart). We are always happy to assist you!

# Is it possible to arrange/re-arrange the diagram nodes automatically in some standard manner?

The various diagram layout managers that are shipped with the Diagram can be used to arrange/layout the nodes in the specified format. Please refer the samples under Diagram Samples/Layout Managers category to get the details about the various layout mangers and how to use this in a diagram application to arrange the nodes.

Below code snippet shows how to apply the layout mechanism on the diagram nodes.

**C#**

    LayoutManager manager = new DirectedTreeLayoutManager(this.diagram.Model, 0,60,80 );
    
    this.diagram.LayoutManager = manager;

**VB**

    Private manager As LayoutManager = New DirectedTreeLayoutManager(Me.diagram.Model, 0,60,80)
    
    Me.diagram.LayoutManager = manager

Once the layout manager has been assigned to the diagram, we can use either the LayoutManager.UpdateLayout() or LayoutManager.AutoLayout() to arrange the nodes in the specified layout.

The following code snippet shows how to arrange the nodes that are added/present in the diagram.

**C#**

    this.diagram.BeginUpdate();
    
    this.diagram.LayoutManager.Nodes.Clear();
    
    this.diagram.LayoutManager.Nodes.AddRange(this.diagram.Model.Nodes );
    
    // Updates the layout of the nodes in the model.
    
    this.diagram.LayoutManager.UpdateLayout(null);
    
    this.diagram.EndUpdate();

**VB**

    Me.diagram.BeginUpdate()
    
    Me.diagram.LayoutManager.Nodes.Clear()
    
    Me.diagram.LayoutManager.Nodes.AddRange(Me.diagram.Model.Nodes)
    
    '' Updates the layout of the nodes in the model.
    
    Me.diagram.LayoutManager.UpdateLayout(Nothing)
    
    Me.diagram.EndUpdate()

The following code snippet shows how to arrange the nodes as soon as that are added to the diagram.

**C#**

    this.diagram.LayoutManager.AutoLayout = true;

**VB**

    Me.diagram.LayoutManager.AutoLayout = True

[Syncfusion® Inc.](http://www.syncfusion.com/)

# Can we add image as an interior for chart series?

Yes. You can add images as interiors for chart series using an ImageBrush with in the Interior property of ChartSeries

The following code snippet adds an image as interior brush of a ChartSeries

XAML

    <syncfusion:ChartSeries Data="0 1 1 4 2 6 3 6 4 7 5 8" Type="Column">
       <syncfusion:ChartSeries.Interior>
         <ImageBrush ImageSource="App.ico"/>
        </syncfusion:ChartSeries.Interior>
     </syncfusion:ChartSeries>

# How to bind a database with the chart series?

A data base can be bound to the chart series using a dataset. Fill the data in the data table of a dataset. Add the dataset to a resource, and then bind the Data property of the ChartSeries to the created resource.

The following code fills the dataset and creates a resource with the name of MyDBSource.

**C#**

    //Fill the dataset
    
    DataAdapter.Fill(dataset, "Product");
    
    //Creating resource with the name MyDBSource
    
    this.Resources.Add("MyDBSource", dataset.Tables["Product"].Rows);

The following code snippet is used to bind the data to chart series.

XAML

    <syncfusion:ChartSeries Name="Series1" Data="{syncfusion:ChartBindingData Source={StaticResource MyDBSource},XPath=ProductID, YPaths=UnitsInStock}" Type ="Column" />

# How to retrieve the items/nodes from the palette programmatically?

## How to retrieve the items/nodes from the palette programmatically?

We can get the nodes loaded in a symbol palette by iterating through the palette''s nodes collection which is represented by the SymbolPalette.Nodes property

# Can we apply themes to chart? If yes, how?

Yes. To apply supported themes to chart, add a reference to Syncfusion.Shared.WPF.

Themes can be applied using the VisualStyle property of the SkinStorage class.

&lt;syncfusion:Chart syncfusion:SkinStorage.VisualStyle="{Binding SelectedValue.Content, ElementName=ThemesList}" &gt;

The sample attached with this article applies different supported themes to the chart and its elements.

[NextPage](https://support.syncfusion.com/llms-full.txt/1)
