Fast Bar 2D Example for WPF

Nevron NOV Chart for WPF ships with hundreds of examples with full source code, as part of the Nevron Open Vision Suite. All WPF 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.

Fast Bar 2D Example for WPF Description

This example demonstrates how to create a fast bar series. The fast bar series can handle millions of data points in real time.


Fast Bar 2D

C# Fast Bar 2D Example Code for Nevron Chart for WPF
Language: C#

using Nevron.Nov;
using Nevron.Nov.Chart;
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.Globalization;
using System.Windows.Forms;

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

		public Form1()
		{
			InitializeComponent();

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

			// 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);

            chartView.Registered += OnChartViewRegistered;
            chartView.Unregistered += OnChartViewUnregistered;

            m_Title = chartView.Surface.Titles[0];
            m_Title.Text = "Fast Bar 2D";
            m_Title.Margins = new NMargins(NChartViewSurface.DefaultPanelMargin);
            m_Title.Font = new NFont(NFontDescriptor.DefaultSansFamilyName, NChartViewSurface.DefaultLabelFontSize);
            m_Title.TextFill = new NColorFill(NColor.Black);
            m_Title.TextAlignment = ENContentAlignment.MiddleCenter;

            // configure the chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.Axes[ENCartesianAxis.PrimaryY].ViewRangeMode = ENAxisViewRangeMode.FixedRange;
            chart.Axes[ENCartesianAxis.PrimaryY].SetFixedViewRange(new NRange(-2, 2));

            ConfigureLinearScale(chart.Axes[ENCartesianAxis.PrimaryX]);
            ConfigureLinearScale(chart.Axes[ENCartesianAxis.PrimaryY]);

            // setup the fast bar series
            m_FastBar = new NFastBarSeries();
            chart.Series.Add(m_FastBar);

            m_FastBar.Name = "FastBar Series";
            m_FastBar.Data.HasXValues = true;
            m_FastBar.Data.HasColors = true;
            m_FastBar.Fill = new NColorFill(NColor.Red);
            m_FastBar.FillColorMode = ENColorMode.Custom;

            // precalculate sinus table
            for (int i = 0; i < 360; i++)
            {
                m_SinTable[i] = Math.Sin(i * Math.PI / 180);
            }

            m_FastBar.WidthSizeMode = ENFastBarSizeMode.Logical;
            m_FastBar.LogicalWidth = 0.5;
            m_FastBar.DepthSizeMode = ENFastBarSizeMode.Logical;
            m_FastBar.LogicalDepth = 1.0;
            m_FastBar.OriginMode = ENSeriesOriginMode.CustomOrigin;
            m_FastBar.Origin = 0.0;

            return chartViewWithCommandBars;
        }
        /// 
        /// 
        /// 
        /// 
		public NWidget CreateExampleControls()
        {
            NStackPanel stack = new NStackPanel();
            NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack);

            m_BarCountComboBox = new NComboBox();
            m_BarCountComboBox.Items.Add(new NComboBoxItem("10000"));
            m_BarCountComboBox.Items.Add(new NComboBoxItem("20000"));
            m_BarCountComboBox.Items.Add(new NComboBoxItem("50000"));
            m_BarCountComboBox.Items.Add(new NComboBoxItem("100000"));

            m_BarCountComboBox.SelectedIndex = 0;

            stack.Add(NPairBox.Create("Point Count :", m_BarCountComboBox));

            m_EnableShaderRenderingCheckBox = new NCheckBox("Enable Shader Rendering");
            m_EnableShaderRenderingCheckBox.CheckedChanged += OnEnableShaderRenderingCheckBoxCheckedChanged;
            stack.Add(m_EnableShaderRenderingCheckBox);
            m_EnableShaderRenderingCheckBox.Checked = m_FastBar.EnableShaderRendering;

            m_FillColorModeComboBox = new NComboBox();
            m_FillColorModeComboBox.Items.FillFromEnum();
            m_FillColorModeComboBox.SelectedIndexChanged += OnFillColorModeComboBoxSelectedIndexChanged;
            stack.Add(NPairBox.Create("Use Custom Colors", m_FillColorModeComboBox));
            m_FillColorModeComboBox.SelectedIndex = (int)ENColorMode.Custom;

            m_StartStopTimerButton = new NButton("Stop Timer");
            m_StartStopTimerButton.Click += OnStartStopTimerButtonClick;
            stack.Add(m_StartStopTimerButton);

            // make sure max point count is updated
            m_BarCountComboBox.SelectedIndexChanged += OnPointCountPerChannelComboBoxSelectedIndexChanged;
            OnPointCountPerChannelComboBoxSelectedIndexChanged(null);

            return group;
        }

        /// 
        /// 
        /// 
        /// 
        public string GetExampleDescription()
        {
            return @"

This example demonstrates how to create a fast bar series. The fast bar series can handle millions of data points in real time.

"; } /// /// Gets the relevant documentation links for the example /// /// public (string Name, string Url)[] GetDocumentationUrls() { return new[] { ("Fast Bar Series", "https://www.nevron.com/docs/openvision/fast-bar-chart-series.html"), ("Fast Series Overview", "https://www.nevron.com/docs/openvision/fast-chart-series-overview.html"), ("Chart Data Series", "https://www.nevron.com/docs/openvision/chart-data-series.html"), }; } #endregion #region Implementation /// /// Applies a linear scale and an interlaced stripe at the specified axis /// /// private void ConfigureLinearScale(NCartesianAxis axis) { // add interlaced stripe to the Y axis NLinearScale scale = new NLinearScale(); NScaleStrip stripStyle = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1); stripStyle.SetShowAtWall(ENChartWall.Left, true); stripStyle.SetShowAtWall(ENChartWall.Back, true); stripStyle.SetShowAtWall(ENChartWall.Right, true); stripStyle.SetShowAtWall(ENChartWall.Front, true); stripStyle.SetShowAtWall(ENChartWall.Bottom, true); stripStyle.SetShowAtWall(ENChartWall.Top, true); stripStyle.Interlaced = true; scale.Strips.Add(stripStyle); scale.ViewRangeInflateMode = ENScaleViewRangeInflateMode.Logical; axis.Scale = scale; } #endregion #region Event Handlers /// /// /// /// private void OnChartViewRegistered(NEventArgs arg) { m_Timer = new NTimer(); m_Timer.Tick += OnTimerTick; m_Timer.Start(); } /// /// /// /// private void OnChartViewUnregistered(NEventArgs arg) { m_Timer.Stop(); m_Timer.Tick -= OnTimerTick; m_Timer = null; } /// /// /// /// /// private void OnEnableShaderRenderingCheckBoxCheckedChanged(NValueChangeEventArgs arg) { m_FastBar.EnableShaderRendering = (bool)arg.NewValue; } /// /// /// /// private void OnFillColorModeComboBoxSelectedIndexChanged(NValueChangeEventArgs arg) { ENColorMode fillColorMode = (ENColorMode)arg.NewValue; m_FastBar.FillColorMode = fillColorMode; m_FastBar.Data.HasColors = fillColorMode == ENColorMode.Custom; } /// /// /// private void OnTimerTick() { for (int i = 0; i < m_MaxPulsePoints; i++) { NPulsePoint pulsePoint = m_PulsePoints[i]; pulsePoint.Phase += pulsePoint.PhaseStep; pulsePoint.PhaseSin = Math.Sin(pulsePoint.Phase); } // spin the points unsafe { fixed (byte* pData = &m_FastBar.Data.Data[0]) { int pointCount = m_FastBar.Data.Count; int dataItemSize = m_FastBar.Data.DataItemSize; float* pYValues = (float*)m_FastBar.Data.GetDataChannelPointer(ENSeriesDataChannelName.YValueF, pData); bool useColor = m_FastBar.Data.HasColors; uint* pColor = null; if (useColor) { pColor = (uint*)m_FastBar.Data.GetDataChannelPointer(ENSeriesDataChannelName.Color, pData); } NColor color1 = NColor.Red; NColor color2 = NColor.Blue; const float value1 = -1; const float value2 = 1; float valueDistance = value2 - value1; int r1 = color1.R; int g1 = color1.G; int b1 = color1.B; int rDiff = (color2.R - color1.R); int gDiff = (color2.G - color1.G); int bDiff = (color2.B - color1.B); for (int i = 0; i < pointCount; i++) { double sum = 0; for (int j = 0; j < m_PulsePoints.Length; j++) { NPulsePoint pulsePoint = m_PulsePoints[j]; double dx = Math.Abs(pulsePoint.X - i); double distance = dx; double waveFactor = (distance - (int)(distance / pulsePoint.WaveLength) * pulsePoint.WaveLength) / pulsePoint.WaveLength; waveFactor = m_SinTable[Math.Max(0, (int)(waveFactor * 360))]; // waveFactor = 1.0f; sum += (pulsePoint.Intensity) * waveFactor * pulsePoint.PhaseSin * (1 - Math.Min(1, distance / pointCount)); } // create a color between color1 and color 2 depending on factor if (useColor) { float factor = Math.Min(1, Math.Max(0, (*pYValues - value1) / valueDistance)); uint r = (byte)(r1 + (int)(rDiff * factor)); uint g = (byte)(g1 + (int)(gDiff * factor)); uint b = (byte)(b1 + (int)(bDiff * factor)); *pColor = (uint)(0xFF000000 | (r << 16) | (g << 8) | b); } *pYValues = Math.Min(2, (float)sum); pYValues += dataItemSize; pColor += dataItemSize; } } } m_FastBar.Data.OnDataChanged(); } /// /// /// /// void OnStartStopTimerButtonClick(NEventArgs args) { AddData(); if (m_Timer.IsStarted) { m_Timer.Stop(); m_StartStopTimerButton.Content = new NLabel("Start Timer"); } else { m_Timer.Start(); m_StartStopTimerButton.Content = new NLabel("Stop Timer"); } } /// /// /// /// /// private void OnPointCountPerChannelComboBoxSelectedIndexChanged(NValueChangeEventArgs arg) { AddData(); } #endregion #region Fields Random m_Random = new Random(); const int m_MaxPulsePoints = 5; double[] m_SinTable = new double[360]; NButton m_StartStopTimerButton; NComboBox m_BarCountComboBox; NCheckBox m_EnableShaderRenderingCheckBox; NComboBox m_FillColorModeComboBox; NFastBarSeries m_FastBar; NPulsePoint[] m_PulsePoints; NLabel m_Title; NTimer m_Timer; #endregion #region Static Methods #endregion #region Constants #endregion #region Nested Types #endregion } }

Download a fully functional C# (.cs) Fast Bar 2D Example for WPF Solution

VB.NET Fast Bar 2D Example Code for Nevron Chart for WPF
Language: VB.NET

Imports Nevron.Nov
Imports Nevron.Nov.Chart
Imports Nevron.Nov.Dom
Imports Nevron.Nov.Graphics
Imports Nevron.Nov.Layout
Imports Nevron.Nov.UI
Imports Nevron.Nov.Windows.Wpf
Imports System

Class MainWindow

#Region "Constructors"

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

		' Add any initialization after the InitializeComponent() call.

		' Set form title
		Title = "NOV WPF - NFastBar2D"

		' 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)
		Content = 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)

            chartView.Registered += AddressOf OnChartViewRegistered
            chartView.Unregistered += AddressOf OnChartViewUnregistered

            m_Title = chartView.Surface.Titles(0)
            m_Title.Text = "Fast Bar 2D"
            m_Title.Margins = New NMargins(NChartViewSurface.DefaultPanelMargin)
            m_Title.Font = New NFont(NFontDescriptor.DefaultSansFamilyName, NChartViewSurface.DefaultLabelFontSize)
            m_Title.TextFill = New NColorFill(NColor.Black)
            m_Title.TextAlignment = ENContentAlignment.MiddleCenter

            ' configure the chart
            Dim chart = CType(chartView.Surface.Charts(0), NCartesianChart)

            chart.Axes(ENCartesianAxis.PrimaryY).ViewRangeMode = ENAxisViewRangeMode.FixedRange
            chart.Axes(ENCartesianAxis.PrimaryY).SetFixedViewRange(New NRange(-2, 2))

            Me.ConfigureLinearScale(chart.Axes(ENCartesianAxis.PrimaryX))
            Me.ConfigureLinearScale(chart.Axes(ENCartesianAxis.PrimaryY))

            ' setup the fast bar series
            m_FastBar = New NFastBarSeries()
            chart.Series.Add(m_FastBar)

            m_FastBar.Name = "FastBar Series"
            m_FastBar.Data.HasXValues = True
            m_FastBar.Data.HasColors = True
            m_FastBar.Fill = New NColorFill(NColor.Red)
            m_FastBar.FillColorMode = ENColorMode.Custom

            ' precalculate sinus table
            For i = 0 To 359
                m_SinTable(i) = Math.Sin(i * Math.PI / 180)
            Next

            m_FastBar.WidthSizeMode = ENFastBarSizeMode.Logical
            m_FastBar.LogicalWidth = 0.5
            m_FastBar.DepthSizeMode = ENFastBarSizeMode.Logical
            m_FastBar.LogicalDepth = 1.0
            m_FastBar.OriginMode = ENSeriesOriginMode.CustomOrigin
            m_FastBar.Origin = 0.0

            Return chartViewWithCommandBars
        End Function
        ''' 
        ''' 
        ''' 
        ''' 
        Public Function CreateExampleControls() As NWidget
            Dim stack As NStackPanel = New NStackPanel()
            Dim group As NUniSizeBoxGroup = New NUniSizeBoxGroup(stack)

            m_BarCountComboBox = New NComboBox()
            m_BarCountComboBox.Items.Add(New NComboBoxItem("10000"))
            m_BarCountComboBox.Items.Add(New NComboBoxItem("20000"))
            m_BarCountComboBox.Items.Add(New NComboBoxItem("50000"))
            m_BarCountComboBox.Items.Add(New NComboBoxItem("100000"))

            m_BarCountComboBox.SelectedIndex = 0

            stack.Add(NPairBox.Create("Point Count :", m_BarCountComboBox))

            m_EnableShaderRenderingCheckBox = New NCheckBox("Enable Shader Rendering")
            Me.m_EnableShaderRenderingCheckBox.CheckedChanged += AddressOf OnEnableShaderRenderingCheckBoxCheckedChanged
            stack.Add(m_EnableShaderRenderingCheckBox)
            m_EnableShaderRenderingCheckBox.Checked = m_FastBar.EnableShaderRendering

            m_FillColorModeComboBox = New NComboBox()
            m_FillColorModeComboBox.Items.FillFromEnum(Of ENColorMode)()
            Me.m_FillColorModeComboBox.SelectedIndexChanged += AddressOf OnFillColorModeComboBoxSelectedIndexChanged
            stack.Add(NPairBox.Create("Use Custom Colors", m_FillColorModeComboBox))
            m_FillColorModeComboBox.SelectedIndex = CInt(ENColorMode.Custom)

            m_StartStopTimerButton = New NButton("Stop Timer")
            Me.m_StartStopTimerButton.Click += AddressOf OnStartStopTimerButtonClick
            stack.Add(m_StartStopTimerButton)

            ' make sure max point count is updated
            Me.m_BarCountComboBox.SelectedIndexChanged += AddressOf OnPointCountPerChannelComboBoxSelectedIndexChanged
            OnPointCountPerChannelComboBoxSelectedIndexChanged(Nothing)

            Return group
        End Function

        ''' 
        ''' 
        ''' 
        ''' 
        Public Function GetExampleDescription() As String
            Return "

This example demonstrates how to create a fast bar series. The fast bar series can handle millions of data points in real time.

" End Function ''' ''' Gets the relevant documentation links for the example ''' ''' Public Function GetDocumentationUrls() As (String, String)() Return {("Fast Bar Series", "https://www.nevron.com/docs/openvision/fast-bar-chart-series.html"), ("Fast Series Overview", "https://www.nevron.com/docs/openvision/fast-chart-series-overview.html"), ("Chart Data Series", "https://www.nevron.com/docs/openvision/chart-data-series.html")} End Function #End Region #Region "Implementation" ''' ''' Applies a linear scale and an interlaced stripe at the specified axis ''' ''' Private Sub ConfigureLinearScale(axis As NCartesianAxis) ' add interlaced stripe to the Y axis Dim scale As NLinearScale = New NLinearScale() Dim stripStyle As NScaleStrip = New NScaleStrip(New NColorFill(NColor.Beige), Nothing, True, 0, 0, 1, 1) stripStyle.SetShowAtWall(ENChartWall.Left, True) stripStyle.SetShowAtWall(ENChartWall.Back, True) stripStyle.SetShowAtWall(ENChartWall.Right, True) stripStyle.SetShowAtWall(ENChartWall.Front, True) stripStyle.SetShowAtWall(ENChartWall.Bottom, True) stripStyle.SetShowAtWall(ENChartWall.Top, True) stripStyle.Interlaced = True scale.Strips.Add(stripStyle) scale.ViewRangeInflateMode = ENScaleViewRangeInflateMode.Logical axis.Scale = scale End Sub #End Region #Region "Event Handlers" ''' ''' ''' ''' Private Sub OnChartViewRegistered(arg As NEventArgs) m_Timer = New NTimer() Me.m_Timer.Tick += AddressOf OnTimerTick m_Timer.Start() End Sub ''' ''' ''' ''' Private Sub OnChartViewUnregistered(arg As NEventArgs) m_Timer.Stop() Me.m_Timer.Tick -= AddressOf OnTimerTick m_Timer = Nothing End Sub ''' ''' ''' ''' ''' Private Sub OnEnableShaderRenderingCheckBoxCheckedChanged(arg As NValueChangeEventArgs) m_FastBar.EnableShaderRendering = CBool(arg.NewValue) End Sub ''' ''' ''' ''' Private Sub OnFillColorModeComboBoxSelectedIndexChanged(arg As NValueChangeEventArgs) Dim fillColorMode As ENColorMode = arg.NewValue m_FastBar.FillColorMode = fillColorMode m_FastBar.Data.HasColors = fillColorMode Is ENColorMode.Custom End Sub ''' ''' ''' Private Sub OnTimerTick() For i = 0 To m_MaxPulsePoints - 1 Dim pulsePoint = m_PulsePoints(i) pulsePoint.Phase += pulsePoint.PhaseStep pulsePoint.PhaseSin = Math.Sin(pulsePoint.Phase) ' spin the points ' waveFactor = 1.0f; ' create a color between color1 and color 2 depending on factor Next ''' Cannot convert UnsafeStatementSyntax, CONVERSION ERROR: Conversion for UnsafeStatement not implemented, please report this issue in 'unsafe\r\n {\r\n fixed...' at character 10973 ''' ''' ''' Input: ''' ''' // spin the points ''' unsafe ''' { ''' fixed (byte* pData = &this.m_FastBar.Data.Data[0]) ''' { ''' int pointCount = this.m_FastBar.Data.Count; ''' int dataItemSize = this.m_FastBar.Data.DataItemSize; ''' ''' float* pYValues = (float*)this.m_FastBar.Data.GetDataChannelPointer(Nevron.Nov.Chart.ENSeriesDataChannelName.YValueF, pData); ''' bool useColor = this.m_FastBar.Data.HasColors; ''' uint* pColor = null; ''' ''' if (useColor) ''' { ''' pColor = (uint*)this.m_FastBar.Data.GetDataChannelPointer(Nevron.Nov.Chart.ENSeriesDataChannelName.Color, pData); ''' } ''' ''' Nevron.Nov.Graphics.NColor color1 = Nevron.Nov.Graphics.NColor.Red; ''' Nevron.Nov.Graphics.NColor color2 = Nevron.Nov.Graphics.NColor.Blue; ''' const float value1 = -1; ''' const float value2 = 1; ''' float valueDistance = value2 - value1; ''' ''' int r1 = color1.R; ''' int g1 = color1.G; ''' int b1 = color1.B; ''' ''' int rDiff = (color2.R - color1.R); ''' int gDiff = (color2.G - color1.G); ''' int bDiff = (color2.B - color1.B); ''' ''' for (int i = 0; i < pointCount; i++) ''' { ''' double sum = 0; ''' ''' for (int j = 0; j < this.m_PulsePoints.Length; j++) ''' { ''' Nevron.Nov.Examples.Chart.NFastBar2D.NPulsePoint pulsePoint = this.m_PulsePoints[j]; ''' ''' double dx = System.Math.Abs(pulsePoint.X - i); ''' ''' double distance = dx; ''' double waveFactor = (distance - (int)(distance / pulsePoint.WaveLength) * pulsePoint.WaveLength) / pulsePoint.WaveLength; ''' waveFactor = this.m_SinTable[System.Math.Max(0, (int)(waveFactor * 360))]; ''' ''' // waveFactor = 1.0f; ''' sum += (pulsePoint.Intensity) * waveFactor * pulsePoint.PhaseSin * (1 - System.Math.Min(1, distance / pointCount)); ''' } ''' ''' // create a color between color1 and color 2 depending on factor ''' if (useColor) ''' { ''' float factor = System.Math.Min(1, System.Math.Max(0, (*pYValues - value1) / valueDistance)); ''' ''' uint r = (byte)(r1 + (int)(rDiff * factor)); ''' uint g = (byte)(g1 + (int)(gDiff * factor)); ''' uint b = (byte)(b1 + (int)(bDiff * factor)); ''' ''' *pColor = (uint)(0xFF000000 | (r << 16) | (g << 8) | b); ''' } ''' ''' *pYValues = System.Math.Min(2, (float)sum); ''' pYValues += dataItemSize; ''' pColor += dataItemSize; ''' } ''' } ''' } ''' ''' m_FastBar.Data.OnDataChanged() End Sub ''' ''' ''' ''' Private Sub OnStartStopTimerButtonClick(args As NEventArgs) AddData() If m_Timer.IsStarted Then m_Timer.Stop() m_StartStopTimerButton.Content = New NLabel("Start Timer") Else m_Timer.Start() m_StartStopTimerButton.Content = New NLabel("Stop Timer") End If End Sub ''' ''' ''' ''' ''' Private Sub OnPointCountPerChannelComboBoxSelectedIndexChanged(arg As NValueChangeEventArgs) AddData() End Sub #End Region #Region "Fields" Private m_Random As Random = New Random() Const m_MaxPulsePoints As Integer = 5 Private m_SinTable As Double() = New Double(359) {} Private m_StartStopTimerButton As NButton Private m_BarCountComboBox As NComboBox Private m_EnableShaderRenderingCheckBox As NCheckBox Private m_FillColorModeComboBox As NComboBox Private m_FastBar As NFastBarSeries Private m_PulsePoints As NPulsePoint() Private m_Title As NLabel Private m_Timer As NTimer #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) Fast Bar 2D Example for WPF Solution