MindFusion.Charting Programmer's Guide

Chart.EmptyPen Property

See Also
 





Gets a neutral 'unset' pen to reset a Pen property when themes are used.

Namespace: MindFusion.Charting
Assembly: MindFusion.Charting

 Syntax

C#  Copy Code

public static Pen EmptyPen { get; }

Visual Basic  Copy Code

Public Shared ReadOnly Property EmptyPen As Pen

 Property Value

A value of type the MindFusion.Drawing.Pen class.

 Remarks

The EmptyPen property is useful when you want to change the Theme settings of a chart. The GridPen and PlotAreaOutlinePen can be cleared with EmptyPen.

 Example

C#  Copy Code

private void changeTheme(Theme newTheme)
        {
           clearChartSettings();
           _lineChart.Theme = newTheme
            _lineChart.DrawChart();
        }

        private void clearChartSettings()
        {

            _lineChart.PlotAreaOutlinePen = Chart.EmptyPen;
            _lineChart.PlotAreaBrush = Chart.EmptyBrush;
        
            _lineChart.GridPen = Chart.EmptyPen;           
            _lineChart.GridBrush = Chart.EmptyBrush;
            _lineChart.AltGridBrush = Chart.EmptyBrush;

            _lineChart.ChartPens.Clear();        
        }

 See Also