Grid Surface Example for WinForms

Nevron NOV Chart for WinForms ships with hundreds of examples with full source code, as part of the Nevron Open Vision Suite. All WinForms Chart examples are also available as a stand-alone Visual Studio solution in C# and VB.NET, which you can download from the links below.

Grid Surface Example for WinForms Description

This example demonstrates how to create a standard grid surface chart.


Grid Surface Example

C# Grid Surface Example Code for Nevron Chart for WinForms
Language: C#

using Nevron.Nov;
using Nevron.Nov.Chart;
using Nevron.Nov.Chart.Tools;
using Nevron.Nov.Dom;
using Nevron.Nov.Graphics;
using Nevron.Nov.Layout;
using Nevron.Nov.UI;
using Nevron.Nov.Windows.Forms;
using System;
using System.Windows.Forms;

namespace NovWinFormsProject
{
	public partial class Form1 : Form
	{
		#region Constructors

		public Form1()
		{
			InitializeComponent();

			// Set form title
			Text = "NOV WinForms - NGridSurfaceExample";

			// Create the NOV example and its controls
			NWidget exampleContent = CreateExampleContent();
			NWidget exampleControls = CreateExampleControls();
			if (exampleControls != null)
			{
				exampleControls.PreferredWidth = 300;
			}

			// Place the example and its controls in a pair box
			NPairBox pairBox = new NPairBox(exampleContent, exampleControls);
			pairBox.FillMode = ENStackFillMode.First;
			pairBox.FitMode = ENStackFitMode.First;
			pairBox.Margins = new NMargins(NDesign.HorizontalSpacing, NDesign.VerticalSpacing);

			// Host the example in the form
			NNovWidgetHost host = new NNovWidgetHost(pairBox);
			host.Dock = DockStyle.Fill;
			Controls.Add(host);
		}

		#endregion

		#region Example

        /// 
        /// 
        /// 
        /// 
		public NWidget CreateExampleContent()
		{
			NChartViewWithCommandBars chartViewWithCommandBars = new NChartViewWithCommandBars();
			NChartView chartView = chartViewWithCommandBars.View;
			chartView.Surface.CreatePredefinedChart(ENPredefinedChartType.Cartesian);

            // configure title
            chartView.Surface.Titles[0].Text = "Grid Surface Chart";

            // setup chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];
            chart.Enable3D = true;
            chart.ModelWidth = 60.0f;
            chart.ModelDepth = 60.0f;
            chart.ModelHeight = 25.0f;
            chart.Projection.SetPredefinedProjection(ENPredefinedProjection.PerspectiveTilted);
            chart.LightModel.SetPredefinedLightModel(ENPredefinedLightModel.ShinyTopLeft);
            chart.Interactor = new NInteractor(new NTrackballTool());

            NLinearScale scale = (NLinearScale)chart.Axes[ENCartesianAxis.PrimaryY].Scale;
            scale.ViewRangeInflateMode = ENScaleViewRangeInflateMode.None;

            // setup axes
            NOrdinalScale  ordinalScale = (NOrdinalScale)chart.Axes[ENCartesianAxis.PrimaryX].Scale;
            ordinalScale.MajorGridLines.SetShowAtWall(ENChartWall.Bottom, true);
            ordinalScale.MajorGridLines.SetShowAtWall(ENChartWall.Back, true);
            ordinalScale.DisplayDataPointsBetweenTicks = false;

            ordinalScale = (NOrdinalScale)chart.Axes[ENCartesianAxis.Depth].Scale;
            ordinalScale.MajorGridLines.SetShowAtWall(ENChartWall.Bottom, true);
            ordinalScale.MajorGridLines.SetShowAtWall(ENChartWall.Left, true);
            ordinalScale.DisplayDataPointsBetweenTicks = false;

            // add interlace stripe to the Y axis
            NLinearScale linearScale = chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip stripStyle = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);
            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ENChartWall.Back, true);
            stripStyle.SetShowAtWall(ENChartWall.Left, true);
            linearScale.Strips.Add(stripStyle);

            // add the surface series
            m_Surface = new NGridSurfaceSeries();
            chart.Series.Add(m_Surface);

            m_Surface.Name = "Surface";
            m_Surface.LegendView.Mode = ENSeriesLegendMode.SeriesLogic;
            m_Surface.LegendView.PaletteLegendMode = ENPaletteLegendMode.ColorMap;
            m_Surface.FlatPositionValue = 10.0;
            m_Surface.Data.HasColors = true;
            m_Surface.Data.SetGridSize(100, 100);
            m_Surface.Palette.InterpolateColors = false;
            m_Surface.ValueFormatter = new NNumericValueFormatter("0.00");
            m_Surface.Fill = new NColorFill(NColor.YellowGreen);
            m_Surface.FillColorMode = ENColorMode.Zone;
            m_Surface.FrameMode = ENSurfaceFrameMode.Contour;
            m_Surface.FrameColorMode = ENColorMode.Uniform;

            chartView.Surface.Legends[0].Visibility = ENVisibility.Visible;

            FillData(m_Surface);

            return chartViewWithCommandBars;
        }

        private void FillData(NGridSurfaceSeries surface)
        {
            double y, x, z;
            int nCountX = surface.Data.GridSizeX;
            int nCountZ = surface.Data.GridSizeZ;

            const double dIntervalX = 30.0;
            const double dIntervalZ = 30.0;
            double dIncrementX = (dIntervalX / nCountX);
            double dIncrementZ = (dIntervalZ / nCountZ);

            float semiWidth = (float)Math.Min(nCountX / 2, nCountZ / 2);

            NColor startColor = NColor.Red;
            NColor endColor = NColor.Green;

            int centerX = nCountX / 2;
            int centerZ = nCountZ / 2;

            z = -(dIntervalZ / 2);

            for (int j = 0; j < nCountZ; j++, z += dIncrementZ)
            {
                x = -(dIntervalX / 2);

                for (int i = 0; i < nCountX; i++, x += dIncrementX)
                {
                    y = (x * z / 64.0) - Math.Sin(z / 2.4) * Math.Cos(x / 2.4);
                    y = 10 * Math.Sqrt(Math.Abs(y));

                    if (y <= 0)
                    {
                        y = 1 + Math.Cos(x / 2.4);
                    }

                    surface.Data.SetValue(i, j, y);

                    int dx = centerX - i;
                    int dz = centerZ - j;
                    double factor = (float)Math.Sqrt(dx * dx + dz * dz) / semiWidth;

                    if (factor > 1)
                    {
                        factor = 1;
                    }

                    surface.Data.SetColor(i, j, NColor.InterpolateColors(startColor, endColor, factor));
                }
            }
        }

        public NWidget CreateExampleControls()
		{
			NStackPanel stack = new NStackPanel();
			NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack);

            m_ShowFillCheckBox = new NCheckBox("Show Fill");
            m_ShowFillCheckBox.CheckedChanged += OnShowFillCheckBoxCheckedChanged;
            stack.Add(m_ShowFillCheckBox);

            m_FillColorModeCombo = new NComboBox();
			m_FillColorModeCombo.Items.FillFromEnum();
            m_FillColorModeCombo.SelectedIndexChanged += OnFillModeComboSelectedIndexChanged;
            m_FillColorModeCombo.SelectedIndex = (int)m_Surface.FillColorMode;
            stack.Add(NPairBox.Create("Fill Color Mode:", m_FillColorModeCombo));

            m_ShowFrameCheckBox = new NCheckBox("Show Frame");
            m_ShowFrameCheckBox.CheckedChanged += OnShowFrameCheckBoxCheckedChanged;
            stack.Add(m_ShowFrameCheckBox);

            m_FrameModeCombo = new NComboBox();
			m_FrameModeCombo.Items.FillFromEnum();
            m_FrameModeCombo.SelectedIndexChanged += OnFrameModeComboSelectedIndexChanged;
            m_FrameModeCombo.SelectedIndex = (int)m_Surface.FrameMode;
            stack.Add(NPairBox.Create("Frame Mode:", m_FrameModeCombo));

            m_FrameColorModeCombo = new NComboBox();
            m_FrameColorModeCombo.Items.FillFromEnum();
            m_FrameColorModeCombo.SelectedIndexChanged += OnFrameColorModeComboSelectedIndexChanged;
            m_FrameColorModeCombo.SelectedIndex = (int)m_Surface.FrameColorMode;
            stack.Add(NPairBox.Create("Frame Color Mode:", m_FrameColorModeCombo));

            m_SmoothShadingCheckBox = new NCheckBox();
            m_SmoothShadingCheckBox.CheckedChanged += OnSmoothShadingCheckBoxCheckedChanged;
            m_SmoothShadingCheckBox.Checked = false;
            m_SmoothShadingCheckBox.HorizontalPlacement = Layout.ENHorizontalPlacement.Left;
            stack.Add(NPairBox.Create("Smooth Shading:", m_SmoothShadingCheckBox));

            m_DrawFlatCheckBox = new NCheckBox();
            m_DrawFlatCheckBox.CheckedChanged += OnDrawFlatCheckBoxCheckedChanged;
            m_DrawFlatCheckBox.Checked = false;
            m_DrawFlatCheckBox.HorizontalPlacement = Layout.ENHorizontalPlacement.Left;
            stack.Add(NPairBox.Create("Draw Flat:", m_DrawFlatCheckBox));

            m_EnableShaderRenderingCheckBox = new NCheckBox();
            m_EnableShaderRenderingCheckBox.CheckedChanged += OnEnableShaderRenderingCheckBoxCheckedChanged;  
            m_EnableShaderRenderingCheckBox.Checked = false;
            m_EnableShaderRenderingCheckBox.HorizontalPlacement = Layout.ENHorizontalPlacement.Left;
            stack.Add(NPairBox.Create("Enable Shader Rendering:", m_EnableShaderRenderingCheckBox));

            m_ShowFillCheckBox.Checked = true;
            m_ShowFrameCheckBox.Checked = true;

            return group;
		}

        private void OnShowFillCheckBoxCheckedChanged(NValueChangeEventArgs arg)
        {
            m_Surface.ShowFill = (bool)arg.NewValue;
            m_FillColorModeCombo.Enabled = m_Surface.ShowFill;
        }

        private void OnShowFrameCheckBoxCheckedChanged(NValueChangeEventArgs arg)
        {
            m_Surface.ShowFrame = (bool)arg.NewValue;

            m_FrameModeCombo.Enabled = m_Surface.ShowFrame;
            m_FrameColorModeCombo.Enabled = m_Surface.ShowFrame;
        }

        private void OnDrawFlatCheckBoxCheckedChanged(NValueChangeEventArgs arg)
        {
            m_Surface.DrawFlat = (bool)arg.NewValue;
        }

        private void OnEnableShaderRenderingCheckBoxCheckedChanged(NValueChangeEventArgs arg)
        {
            m_Surface.EnableShaderRendering = (bool)arg.NewValue;
        }

        private void OnFrameColorModeComboSelectedIndexChanged(NValueChangeEventArgs arg)
        {
            m_Surface.FrameColorMode = (ENColorMode)arg.NewValue;
        }

        private void OnSmoothShadingCheckBoxCheckedChanged(NValueChangeEventArgs arg)
        {
            m_Surface.ShadingMode = (bool)arg.NewValue ? ENShadingMode.Smooth : ENShadingMode.Flat;
        }

        private void OnFrameModeComboSelectedIndexChanged(NValueChangeEventArgs arg)
        {
            m_Surface.FrameMode = (ENSurfaceFrameMode)arg.NewValue;

            if (m_Surface.FrameMode == ENSurfaceFrameMode.Dots)
            {
                m_Surface.Stroke = new NStroke(3, NColor.Black);
            }
            else
            {
                m_Surface.Stroke = new NStroke(1, NColor.Black);
            }
        }

        private void OnFillModeComboSelectedIndexChanged(NValueChangeEventArgs arg)
        {
            m_Surface.FillColorMode = (ENColorMode)arg.NewValue;
        }

        public string GetExampleDescription()
		{
			return @"

This example demonstrates how to create a standard grid surface chart.

"; } /// /// Gets the relevant documentation links for the example /// /// public (string Name, string Url)[] GetDocumentationUrls() { return new[] { ("Grid Surface Series", "https://www.nevron.com/docs/openvision/grid-surface-chart-series.html"), ("Surface Series Overview", "https://www.nevron.com/docs/openvision/surface-chart-series-overview.html"), ("3D Charts", "https://www.nevron.com/docs/openvision/3d-charts.html"), ("chart-palettes", "https://www.nevron.com/docs/openvision/chart-palettes.html"), }; } #endregion #region Implementation #endregion #region Event Handlers #endregion #region Fields NGridSurfaceSeries m_Surface; NCheckBox m_ShowFillCheckBox; NComboBox m_FillColorModeCombo; NCheckBox m_ShowFrameCheckBox; NComboBox m_FrameModeCombo; NComboBox m_FrameColorModeCombo; NCheckBox m_SmoothShadingCheckBox; NCheckBox m_DrawFlatCheckBox; NCheckBox m_EnableShaderRenderingCheckBox; #endregion #region Static Methods #endregion #region Constants #endregion #region Nested Types #endregion } }

Download a fully functional C# (.cs) Grid Surface Example for WinForms Solution

VB.NET Grid Surface Example Code for Nevron Chart for WinForms
Language: VB.NET

Imports Nevron.Nov
Imports Nevron.Nov.Chart
Imports Nevron.Nov.Chart.Tools
Imports Nevron.Nov.Dom
Imports Nevron.Nov.Graphics
Imports Nevron.Nov.Layout
Imports Nevron.Nov.UI
Imports Nevron.Nov.Windows.Forms
Imports System

Public Class Form1

#Region "Constructors"

    Public Sub New()
        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

        ' Set form title
        Text = "NOV WinForms - NGridSurfaceExample"

        ' Create the NOV example and its controls
        Dim exampleContent As NWidget = CreateExampleContent()
        Dim exampleControls As NWidget = CreateExampleControls()
        If Not exampleControls Is Nothing Then
            exampleControls.PreferredWidth = 300
        End If

        ' Place the example and its controls in a pair box
        Dim pairBox As NPairBox = New NPairBox(exampleContent, exampleControls)
        pairBox.FillMode = ENStackFillMode.First
        pairBox.FitMode = ENStackFitMode.First
        pairBox.Margins = New NMargins(NDesign.HorizontalSpacing, NDesign.VerticalSpacing)

        ' Host the example in the form
        Dim host As NNovWidgetHost(Of NWidget) = New NNovWidgetHost(Of NWidget)(pairBox)
        host.Dock = DockStyle.Fill
        Controls.Add(host)
    End Sub


#End Region

#Region "Example"

        ''' 
        ''' 
        ''' 
        ''' 
        Public Function CreateExampleContent() As NWidget
            Dim chartViewWithCommandBars As NChartViewWithCommandBars = New NChartViewWithCommandBars()
            Dim chartView = chartViewWithCommandBars.View
            chartView.Surface.CreatePredefinedChart(ENPredefinedChartType.Cartesian)

            ' configure title
            chartView.Surface.Titles(0).Text = "Grid Surface Chart"

            ' setup chart
            Dim chart = CType(chartView.Surface.Charts(0), NCartesianChart)
            chart.Enable3D = True
            chart.ModelWidth = 60.0F
            chart.ModelDepth = 60.0F
            chart.ModelHeight = 25.0F
            chart.Projection.SetPredefinedProjection(ENPredefinedProjection.PerspectiveTilted)
            chart.LightModel.SetPredefinedLightModel(ENPredefinedLightModel.ShinyTopLeft)
            chart.Interactor = New NInteractor(New NTrackballTool())

            Dim scale As NLinearScale = chart.Axes(ENCartesianAxis.PrimaryY).Scale
            scale.ViewRangeInflateMode = ENScaleViewRangeInflateMode.None

            ' setup axes
            Dim ordinalScale As NOrdinalScale = chart.Axes(ENCartesianAxis.PrimaryX).Scale
            ordinalScale.MajorGridLines.SetShowAtWall(ENChartWall.Bottom, True)
            ordinalScale.MajorGridLines.SetShowAtWall(ENChartWall.Back, True)
            ordinalScale.DisplayDataPointsBetweenTicks = False

            ordinalScale = chart.Axes(ENCartesianAxis.Depth).Scale
            ordinalScale.MajorGridLines.SetShowAtWall(ENChartWall.Bottom, True)
            ordinalScale.MajorGridLines.SetShowAtWall(ENChartWall.Left, True)
            ordinalScale.DisplayDataPointsBetweenTicks = False

            ' add interlace stripe to the Y axis
            Dim linearScale As NLinearScale = TryCast(chart.Axes(ENCartesianAxis.PrimaryY).Scale, NLinearScale)
            Dim stripStyle As NScaleStrip = New NScaleStrip(New NColorFill(NColor.Beige), Nothing, True, 0, 0, 1, 1)
            stripStyle.Interlaced = True
            stripStyle.SetShowAtWall(ENChartWall.Back, True)
            stripStyle.SetShowAtWall(ENChartWall.Left, True)
            linearScale.Strips.Add(stripStyle)

            ' add the surface series
            m_Surface = New NGridSurfaceSeries()
            chart.Series.Add(m_Surface)

            m_Surface.Name = "Surface"
            m_Surface.LegendView.Mode = ENSeriesLegendMode.SeriesLogic
            m_Surface.LegendView.PaletteLegendMode = ENPaletteLegendMode.ColorMap
            m_Surface.FlatPositionValue = 10.0
            m_Surface.Data.HasColors = True
            m_Surface.Data.SetGridSize(100, 100)
            m_Surface.Palette.InterpolateColors = False
            m_Surface.ValueFormatter = New NNumericValueFormatter("0.00")
            m_Surface.Fill = New NColorFill(NColor.YellowGreen)
            m_Surface.FillColorMode = ENColorMode.Zone
            m_Surface.FrameMode = ENSurfaceFrameMode.Contour
            m_Surface.FrameColorMode = ENColorMode.Uniform

            chartView.Surface.Legends(0).Visibility = ENVisibility.Visible

            FillData(m_Surface)

            Return chartViewWithCommandBars
        End Function

        Private Sub FillData(surface As NGridSurfaceSeries)
            Dim y, x, z As Double
            Dim nCountX = surface.Data.GridSizeX
            Dim nCountZ = surface.Data.GridSizeZ

            Const dIntervalX = 30.0
            Const dIntervalZ = 30.0
            Dim dIncrementX = dIntervalX / nCountX
            Dim dIncrementZ = dIntervalZ / nCountZ

            Dim semiWidth As Single = Math.Min(nCountX / 2, nCountZ / 2)

            Dim startColor = NColor.Red
            Dim endColor = NColor.Green

            Dim centerX As Integer = nCountX / 2
            Dim centerZ As Integer = nCountZ / 2

            z = -(dIntervalZ / 2)

            Dim j = 0

            While j < nCountZ
                x = -(dIntervalX / 2)

                Dim i = 0

                While i < nCountX
                    y = x * z / 64.0 - Math.Sin(z / 2.4) * Math.Cos(x / 2.4)
                    y = 10 * Math.Sqrt(Math.Abs(y))

                    If y <= 0 Then
                        y = 1 + Math.Cos(x / 2.4)
                    End If

                    surface.Data.SetValue(i, j, y)

                    Dim dx = centerX - i
                    Dim dz = centerZ - j
                    Dim factor As Double = CSng(Math.Sqrt(dx * dx + dz * dz)) / semiWidth

                    If factor > 1 Then
                        factor = 1
                    End If

                    surface.Data.SetColor(i, j, NColor.InterpolateColors(startColor, endColor, factor))
                    i += 1
                    x += dIncrementX
                End While

                j += 1
                z += dIncrementZ
            End While
        End Sub

        Public Function CreateExampleControls() As NWidget
            Dim stack As NStackPanel = New NStackPanel()
            Dim group As NUniSizeBoxGroup = New NUniSizeBoxGroup(stack)

            m_ShowFillCheckBox = New NCheckBox("Show Fill")
            Me.m_ShowFillCheckBox.CheckedChanged += AddressOf OnShowFillCheckBoxCheckedChanged
            stack.Add(m_ShowFillCheckBox)

            m_FillColorModeCombo = New NComboBox()
            m_FillColorModeCombo.Items.FillFromEnum(Of ENColorMode)()
            Me.m_FillColorModeCombo.SelectedIndexChanged += AddressOf OnFillModeComboSelectedIndexChanged
            m_FillColorModeCombo.SelectedIndex = m_Surface.FillColorMode
            stack.Add(NPairBox.Create("Fill Color Mode:", m_FillColorModeCombo))

            m_ShowFrameCheckBox = New NCheckBox("Show Frame")
            Me.m_ShowFrameCheckBox.CheckedChanged += AddressOf OnShowFrameCheckBoxCheckedChanged
            stack.Add(m_ShowFrameCheckBox)

            m_FrameModeCombo = New NComboBox()
            m_FrameModeCombo.Items.FillFromEnum(Of ENSurfaceFrameMode)()
            Me.m_FrameModeCombo.SelectedIndexChanged += AddressOf OnFrameModeComboSelectedIndexChanged
            m_FrameModeCombo.SelectedIndex = m_Surface.FrameMode
            stack.Add(NPairBox.Create("Frame Mode:", m_FrameModeCombo))

            m_FrameColorModeCombo = New NComboBox()
            m_FrameColorModeCombo.Items.FillFromEnum(Of ENColorMode)()
            Me.m_FrameColorModeCombo.SelectedIndexChanged += AddressOf OnFrameColorModeComboSelectedIndexChanged
            m_FrameColorModeCombo.SelectedIndex = m_Surface.FrameColorMode
            stack.Add(NPairBox.Create("Frame Color Mode:", m_FrameColorModeCombo))

            m_SmoothShadingCheckBox = New NCheckBox()
            Me.m_SmoothShadingCheckBox.CheckedChanged += AddressOf OnSmoothShadingCheckBoxCheckedChanged
            m_SmoothShadingCheckBox.Checked = False
            m_SmoothShadingCheckBox.HorizontalPlacement = Layout.ENHorizontalPlacement.Left
            stack.Add(NPairBox.Create("Smooth Shading:", m_SmoothShadingCheckBox))

            m_DrawFlatCheckBox = New NCheckBox()
            Me.m_DrawFlatCheckBox.CheckedChanged += AddressOf OnDrawFlatCheckBoxCheckedChanged
            m_DrawFlatCheckBox.Checked = False
            m_DrawFlatCheckBox.HorizontalPlacement = Layout.ENHorizontalPlacement.Left
            stack.Add(NPairBox.Create("Draw Flat:", m_DrawFlatCheckBox))

            m_EnableShaderRenderingCheckBox = New NCheckBox()
            Me.m_EnableShaderRenderingCheckBox.CheckedChanged += AddressOf OnEnableShaderRenderingCheckBoxCheckedChanged
            m_EnableShaderRenderingCheckBox.Checked = False
            m_EnableShaderRenderingCheckBox.HorizontalPlacement = Layout.ENHorizontalPlacement.Left
            stack.Add(NPairBox.Create("Enable Shader Rendering:", m_EnableShaderRenderingCheckBox))

            m_ShowFillCheckBox.Checked = True
            m_ShowFrameCheckBox.Checked = True

            Return group
        End Function

        Private Sub OnShowFillCheckBoxCheckedChanged(arg As NValueChangeEventArgs)
            m_Surface.ShowFill = CBool(arg.NewValue)
            m_FillColorModeCombo.Enabled = m_Surface.ShowFill
        End Sub

        Private Sub OnShowFrameCheckBoxCheckedChanged(arg As NValueChangeEventArgs)
            m_Surface.ShowFrame = CBool(arg.NewValue)

            m_FrameModeCombo.Enabled = m_Surface.ShowFrame
            m_FrameColorModeCombo.Enabled = m_Surface.ShowFrame
        End Sub

        Private Sub OnDrawFlatCheckBoxCheckedChanged(arg As NValueChangeEventArgs)
            m_Surface.DrawFlat = CBool(arg.NewValue)
        End Sub

        Private Sub OnEnableShaderRenderingCheckBoxCheckedChanged(arg As NValueChangeEventArgs)
            m_Surface.EnableShaderRendering = CBool(arg.NewValue)
        End Sub

        Private Sub OnFrameColorModeComboSelectedIndexChanged(arg As NValueChangeEventArgs)
            m_Surface.FrameColorMode = CType(arg.NewValue, ENColorMode)
        End Sub

        Private Sub OnSmoothShadingCheckBoxCheckedChanged(arg As NValueChangeEventArgs)
            m_Surface.ShadingMode = If(arg.NewValue, ENShadingMode.Smooth, ENShadingMode.Flat)
        End Sub

        Private Sub OnFrameModeComboSelectedIndexChanged(arg As NValueChangeEventArgs)
            m_Surface.FrameMode = CType(arg.NewValue, ENSurfaceFrameMode)

            If m_Surface.FrameMode Is ENSurfaceFrameMode.Dots Then
                m_Surface.Stroke = New NStroke(3, NColor.Black)
            Else
                m_Surface.Stroke = New NStroke(1, NColor.Black)
            End If
        End Sub

        Private Sub OnFillModeComboSelectedIndexChanged(arg As NValueChangeEventArgs)
            m_Surface.FillColorMode = CType(arg.NewValue, ENColorMode)
        End Sub

        Public Function GetExampleDescription() As String
            Return "

This example demonstrates how to create a standard grid surface chart.

" End Function ''' ''' Gets the relevant documentation links for the example ''' ''' Public Function GetDocumentationUrls() As (String, String)() Return {("Grid Surface Series", "https://www.nevron.com/docs/openvision/grid-surface-chart-series.html"), ("Surface Series Overview", "https://www.nevron.com/docs/openvision/surface-chart-series-overview.html"), ("3D Charts", "https://www.nevron.com/docs/openvision/3d-charts.html"), ("chart-palettes", "https://www.nevron.com/docs/openvision/chart-palettes.html")} End Function #End Region #Region "Implementation" #End Region #Region "Event Handlers" #End Region #Region "Fields" Private m_Surface As NGridSurfaceSeries Private m_ShowFillCheckBox As NCheckBox Private m_FillColorModeCombo As NComboBox Private m_ShowFrameCheckBox As NCheckBox Private m_FrameModeCombo As NComboBox Private m_FrameColorModeCombo As NComboBox Private m_SmoothShadingCheckBox As NCheckBox Private m_DrawFlatCheckBox As NCheckBox Private m_EnableShaderRenderingCheckBox As NCheckBox #End Region #Region "Static Methods" #End Region #Region "Constants" #End Region #Region "Nested Types" #End Region End Class

Download a fully functional VB.NET (.vb) Grid Surface Example for WinForms Solution