Polar Value Axis Position Example for WPF

Polar Value Axis Position 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.

Polar Value Axis Position Example for WPF Description

This example demonstrates how to control the polar value axis position.


Polar Value Axis Position Example

C# Polar Value Axis Position 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.Windows.Forms;

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

		public Form1()
		{
			InitializeComponent();

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

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

			// configure title
			chartView.Surface.Titles[0].Text = "Polar Value Axis Position";

			// configure chart
			m_Chart = (NPolarChart)chartView.Surface.Charts[0];

			m_Chart.SetPredefinedPolarAxes(ENPredefinedPolarAxes.AngleValue);

			// setup chart
			m_Chart.InnerRadius = 20;

			// setup polar axis
			NLinearScale linearScale = (NLinearScale)m_Chart.Axes[ENPolarAxis.PrimaryValue].Scale;
			linearScale.ViewRangeInflateMode = ENScaleViewRangeInflateMode.MajorTick;
			linearScale.InflateViewRangeBegin = true;
			linearScale.InflateViewRangeEnd = true;
			linearScale.Labels.OverlapResolveLayouts = new NDomArray(new ENLevelLabelsLayout[] { ENLevelLabelsLayout.AutoScale });

			linearScale.MajorGridLines.Visible = true;
			linearScale.MajorGridLines.Stroke.DashStyle = ENDashStyle.Dash;

            NScaleStrip strip = new NScaleStrip();
            strip.Fill = new NColorFill(NColor.Beige);
            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // setup polar angle axis
            NAngularScale angularScale = (NAngularScale)m_Chart.Axes[ENPolarAxis.PrimaryAngle].Scale;

			angularScale.MajorGridLines.Visible = true;
			angularScale.Labels.Style.Angle = new NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 0);

			// add a const line
			NAxisReferenceLine referenceLine = new NAxisReferenceLine();
			referenceLine.Value = 1.0;
			referenceLine.Stroke = new NStroke(1, NColor.SlateBlue);
			m_Chart.Axes[ENPolarAxis.PrimaryValue].ReferenceLines.Add(referenceLine);

			// create a polar line series
			NPolarLineSeries series1 = new NPolarLineSeries();
			m_Chart.Series.Add(series1);
			series1.Name = "Series 1";
			series1.CloseContour = true;
			series1.UseXValues = true;
			series1.DataLabelStyle = new NDataLabelStyle(false);

			NMarkerStyle markerStyle = new NMarkerStyle();
			markerStyle.Visible = false;
			markerStyle.Size = new NSize(2, 2);
			series1.MarkerStyle = markerStyle;
			Curve1(series1, 50);

			// create a polar line series
			NPolarLineSeries series2 = new NPolarLineSeries();
			m_Chart.Series.Add(series2);
			series2.Name = "Series 2";
			series2.CloseContour = true;
			series2.UseXValues = true;
			series2.DataLabelStyle = new NDataLabelStyle(false);

			markerStyle = new NMarkerStyle();
			markerStyle.Visible = false;
			series2.MarkerStyle = markerStyle;
			Curve2(series2, 100);

			// add a second value axes
			m_RedAxis = m_Chart.Axes[ENPolarAxis.PrimaryValue];
			m_GreenAxis = m_Chart.AddCustomAxis(ENPolarAxisOrientation.Value);

			NCrossPolarAxisAnchor redAxisAnchor = new NCrossPolarAxisAnchor(ENPolarAxisOrientation.Value, ENScaleOrientation.Auto);
			redAxisAnchor.Crossing = new NValueAxisCrossing(m_Chart.Axes[ENPolarAxis.PrimaryAngle], 0.0f);
            m_RedAxis.Anchor = redAxisAnchor;

			NCrossPolarAxisAnchor greenAxisAnchor = new NCrossPolarAxisAnchor(ENPolarAxisOrientation.Value, ENScaleOrientation.Auto);
			greenAxisAnchor.Crossing = new NValueAxisCrossing(m_Chart.Axes[ENPolarAxis.PrimaryAngle], 90);
            m_GreenAxis.Anchor = greenAxisAnchor;

			// color code the axes and series after the stylesheet is applied
			m_RedAxis.Scale.SetColor(NColor.Red);
			m_GreenAxis.Scale.SetColor(NColor.Green);

			series1.Stroke = new NStroke(2, NColor.DarkRed);
			series2.Stroke = new NStroke(2, NColor.DarkGreen);

			series2.ValueAxis = m_GreenAxis;

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

			// begin angle
			NNumericUpDown beginAngleUpDown = new NNumericUpDown();
			beginAngleUpDown.ValueChanged += OnBeginAngleUpDownValueChanged;
			stack.Add(NPairBox.Create("Begin Angle:", beginAngleUpDown));

			// radian angle step
			NComboBox radianAngleStepComboBox = new NComboBox();

			radianAngleStepComboBox.Items.Add(new NComboBoxItem("15"));
			radianAngleStepComboBox.Items.Add(new NComboBoxItem("30"));
			radianAngleStepComboBox.Items.Add(new NComboBoxItem("45"));
			radianAngleStepComboBox.Items.Add(new NComboBoxItem("90"));
			radianAngleStepComboBox.SelectedIndexChanged += OnRadianAngleStepComboBoxSelectedIndexChanged;

			stack.Add(NPairBox.Create("Radian Angle Step", radianAngleStepComboBox));

			// red axis position
			stack.Add(new NLabel("Red Axis:"));

			{
				NCheckBox dockRedAxisToBottomCheckBox = new NCheckBox("Dock Bottom");
				dockRedAxisToBottomCheckBox.CheckedChanged += OnDockRedAxisToBottomCheckBoxCheckedChanged;
				stack.Add(dockRedAxisToBottomCheckBox);

				m_RedAxisAngleUpDown = new NNumericUpDown();
				m_RedAxisAngleUpDown.Value = 0;
				m_RedAxisAngleUpDown.ValueChanged += OnRedAxisAngleUpDownValueChanged;
				stack.Add(NPairBox.Create("Angle:", m_RedAxisAngleUpDown));

				NCheckBox redAxisPaintRefelectionCheckBox = new NCheckBox("Paint Reflection");
				redAxisPaintRefelectionCheckBox.Checked = true;
				redAxisPaintRefelectionCheckBox.CheckedChanged += OnRedAxisPaintRefelectionCheckBoxCheckedChanged;
				stack.Add(redAxisPaintRefelectionCheckBox);

				m_RedAxisScaleLabelAngleMode = new NComboBox();
				m_RedAxisScaleLabelAngleMode.Items.FillFromEnum();
				m_RedAxisScaleLabelAngleMode.SelectedIndex = (int)ENScaleLabelAngleMode.View;
				m_RedAxisScaleLabelAngleMode.SelectedIndexChanged += OnUpdateRedAxisSaleLabelAngle;
				stack.Add(NPairBox.Create("Scale Label Angle Mode:", m_RedAxisScaleLabelAngleMode));

				m_RedAxisSaleLabelAngleUpDown = new NNumericUpDown();
				m_RedAxisSaleLabelAngleUpDown.ValueChanged += OnUpdateRedAxisSaleLabelAngle;
				stack.Add(NPairBox.Create("Scale Label Angle:", m_RedAxisSaleLabelAngleUpDown));

				NNumericUpDown redAxisBeginPercentUpDown = new NNumericUpDown();
				redAxisBeginPercentUpDown.Value = m_RedAxis.Anchor.BeginPercent;
				redAxisBeginPercentUpDown.ValueChanged += OnRedAxisBeginPercentUpDownValueChanged;
				stack.Add(NPairBox.Create("Begin percent:", redAxisBeginPercentUpDown));

				NNumericUpDown redAxisEndPercentUpDown = new NNumericUpDown();
				redAxisEndPercentUpDown.Value = m_RedAxis.Anchor.EndPercent;
				redAxisEndPercentUpDown.ValueChanged += OnRedAxisEndPercentUpDownValueChanged;
				stack.Add(NPairBox.Create("End percent:", redAxisEndPercentUpDown));
			}

			// green axis position
			stack.Add(new NLabel("Green Axis:"));

			{
				NCheckBox dockGreenAxisToLeftCheckBox = new NCheckBox("Dock Left");
				dockGreenAxisToLeftCheckBox.CheckedChanged += OnDockGreenAxisToLeftCheckBoxCheckedChanged;
				stack.Add(dockGreenAxisToLeftCheckBox);

				m_GreenAxisAngleUpDown = new NNumericUpDown();
				m_GreenAxisAngleUpDown.Value = 90;
				m_GreenAxisAngleUpDown.ValueChanged += OnGreenAxisAngleUpDownValueChanged;
				stack.Add(NPairBox.Create("Angle:", m_GreenAxisAngleUpDown));

				NCheckBox greenAxisPaintRefelectionCheckBox = new NCheckBox("Paint Reflection");
				greenAxisPaintRefelectionCheckBox.Checked = true;
				greenAxisPaintRefelectionCheckBox.CheckedChanged += OnGreenAxisPaintRefelectionCheckBoxCheckedChanged;
				stack.Add(greenAxisPaintRefelectionCheckBox);

				m_GreenAxisScaleLabelAngleMode = new NComboBox();
				m_GreenAxisScaleLabelAngleMode.Items.FillFromEnum();
				m_GreenAxisScaleLabelAngleMode.SelectedIndex = (int)ENScaleLabelAngleMode.View;
				m_GreenAxisScaleLabelAngleMode.SelectedIndexChanged += OnUpdateGreenAxisSaleLabelAngle;
				stack.Add(NPairBox.Create("Scale Label Angle Mode:", m_GreenAxisScaleLabelAngleMode));

				m_GreenAxisSaleLabelAngleUpDown = new NNumericUpDown();
				m_GreenAxisSaleLabelAngleUpDown.ValueChanged += OnUpdateGreenAxisSaleLabelAngle;
				stack.Add(NPairBox.Create("Scale Label Angle:", m_GreenAxisSaleLabelAngleUpDown));

				NNumericUpDown greenAxisBeginPercentUpDown = new NNumericUpDown();
				greenAxisBeginPercentUpDown.Value = m_GreenAxis.Anchor.BeginPercent;
				greenAxisBeginPercentUpDown.ValueChanged += OnGreenAxisBeginPercentUpDownValueChanged;
				stack.Add(NPairBox.Create("Begin percent:", greenAxisBeginPercentUpDown));

				NNumericUpDown greenAxisEndPercentUpDown = new NNumericUpDown();
				greenAxisEndPercentUpDown.Value = m_GreenAxis.Anchor.EndPercent;
				greenAxisEndPercentUpDown.ValueChanged += OnGreenAxisEndPercentUpDownValueChanged;
				stack.Add(NPairBox.Create("End percent:", greenAxisEndPercentUpDown));
			}


			return group;
		}
		public string GetExampleDescription()
		{
			return @"

This example demonstrates how to control the polar value axis position.

"; } /// /// Gets the relevant documentation links for the example /// /// public (string Name, string Url)[] GetDocumentationUrls() { return new[] { ("Polar Axes", "https://www.nevron.com/docs/openvision/polar-chart-axes.html"), ("Common Axis Functionality", "https://www.nevron.com/docs/openvision/chart-common-axis-functionality.html"), }; } #endregion #region Implementation internal static void Curve1(NPolarLineSeries series, int count) { series.DataPoints.Clear(); double angleStep = 2 * Math.PI / count; for (int i = 0; i < count; i++) { double angle = i * angleStep; double radius = 1 + Math.Cos(angle); series.DataPoints.Add(new NPolarLineDataPoint((double)(angle * 180.0 / Math.PI), radius)); } } internal static void Curve2(NPolarLineSeries series, int count) { series.DataPoints.Clear(); double angleStep = 2 * Math.PI / count; for (int i = 0; i < count; i++) { double angle = i * angleStep; double radius = 0.2 + 1.7 * Math.Sin(2 * angle) + 1.7 * Math.Cos(2 * angle); radius = Math.Abs(radius); series.DataPoints.Add(new NPolarLineDataPoint((double)angle * 180.0 / Math.PI, radius)); } } #endregion #region Event Handlers void OnUpdateGreenAxisSaleLabelAngle(NValueChangeEventArgs arg) { (m_GreenAxis.Scale as NLinearScale).Labels.Style.Angle = new NScaleLabelAngle((ENScaleLabelAngleMode)m_GreenAxisScaleLabelAngleMode.SelectedIndex, m_GreenAxisSaleLabelAngleUpDown.Value); } void OnGreenAxisPaintRefelectionCheckBoxCheckedChanged(NValueChangeEventArgs arg) { m_GreenAxis.PaintReflection = ((NCheckBox)arg.TargetNode).Checked; } void OnGreenAxisEndPercentUpDownValueChanged(NValueChangeEventArgs arg) { m_GreenAxis.Anchor.EndPercent = (float)((NNumericUpDown)arg.TargetNode).Value; } void OnGreenAxisBeginPercentUpDownValueChanged(NValueChangeEventArgs arg) { m_GreenAxis.Anchor.BeginPercent = (float)((NNumericUpDown)arg.TargetNode).Value; } void OnGreenAxisAngleUpDownValueChanged(NValueChangeEventArgs arg) { NCrossPolarAxisAnchor valueCrossPolarAnchor = m_GreenAxis.Anchor as NCrossPolarAxisAnchor; if (valueCrossPolarAnchor != null) { ((NValueAxisCrossing)valueCrossPolarAnchor.Crossing).Value = m_GreenAxisAngleUpDown.Value; } } void OnDockGreenAxisToLeftCheckBoxCheckedChanged(NValueChangeEventArgs arg) { if (((NCheckBox)arg.TargetNode).Checked) { m_GreenAxis.Anchor = new NDockPolarAxisAnchor(ENPolarAxisDockZone.Left); m_GreenAxisAngleUpDown.Enabled = false; } else { NCrossPolarAxisAnchor anchor = new NCrossPolarAxisAnchor(ENPolarAxisOrientation.Value, ENScaleOrientation.Auto); anchor.Crossing = new NValueAxisCrossing(m_Chart.Axes[ENPolarAxis.PrimaryAngle], m_GreenAxisAngleUpDown.Value); m_GreenAxis.Anchor = anchor; m_GreenAxisAngleUpDown.Enabled = true; } } void OnUpdateRedAxisSaleLabelAngle(NValueChangeEventArgs arg) { (m_RedAxis.Scale as NLinearScale).Labels.Style.Angle = new NScaleLabelAngle((ENScaleLabelAngleMode)m_RedAxisScaleLabelAngleMode.SelectedIndex, m_RedAxisSaleLabelAngleUpDown.Value); } void OnRedAxisPaintRefelectionCheckBoxCheckedChanged(NValueChangeEventArgs arg) { m_RedAxis.PaintReflection = ((NCheckBox)arg.TargetNode).Checked; } void OnRedAxisEndPercentUpDownValueChanged(NValueChangeEventArgs arg) { m_RedAxis.Anchor.EndPercent = (float)((NNumericUpDown)arg.TargetNode).Value; } void OnRedAxisBeginPercentUpDownValueChanged(NValueChangeEventArgs arg) { m_RedAxis.Anchor.BeginPercent = (float)((NNumericUpDown)arg.TargetNode).Value; } void OnRedAxisAngleUpDownValueChanged(NValueChangeEventArgs arg) { NCrossPolarAxisAnchor valueCrossPolarAnchor = m_RedAxis.Anchor as NCrossPolarAxisAnchor; if (valueCrossPolarAnchor != null) { ((NValueAxisCrossing)valueCrossPolarAnchor.Crossing).Value = m_RedAxisAngleUpDown.Value; } } void OnDockRedAxisToBottomCheckBoxCheckedChanged(NValueChangeEventArgs arg) { if (((NCheckBox)arg.TargetNode).Checked) { m_RedAxis.Anchor = new NDockPolarAxisAnchor(ENPolarAxisDockZone.Bottom); m_RedAxisAngleUpDown.Enabled = false; } else { NCrossPolarAxisAnchor anchor = new NCrossPolarAxisAnchor(ENPolarAxisOrientation.Value, ENScaleOrientation.Auto); anchor.Crossing = new NValueAxisCrossing(m_Chart.Axes[ENPolarAxis.PrimaryAngle], m_RedAxisAngleUpDown.Value); m_RedAxis.Anchor = anchor; m_RedAxisAngleUpDown.Enabled = true; } } void OnRadianAngleStepComboBoxSelectedIndexChanged(NValueChangeEventArgs arg) { NAngularScale angleScale = (NAngularScale)m_Chart.Axes[ENPolarAxis.PrimaryAngle].Scale; angleScale.MajorTickMode = ENMajorTickMode.CustomStep; switch (((NComboBox)arg.TargetNode).SelectedIndex) { case 0: angleScale.CustomStep = new NAngle(15, NUnit.Degree); break; case 1: angleScale.CustomStep = new NAngle(30, NUnit.Degree); break; case 2: angleScale.CustomStep = new NAngle(45, NUnit.Degree); break; case 3: angleScale.CustomStep = new NAngle(90, NUnit.Degree); break; default: NDebug.Assert(false); break; } } void OnBeginAngleUpDownValueChanged(NValueChangeEventArgs arg) { m_Chart.BeginAngle = new NAngle(((NNumericUpDown)arg.TargetNode).Value, NUnit.Degree); } #endregion #region Fields NPolarChart m_Chart; NPolarAxis m_RedAxis; NPolarAxis m_GreenAxis; NNumericUpDown m_RedAxisAngleUpDown; NNumericUpDown m_GreenAxisAngleUpDown; NNumericUpDown m_RedAxisSaleLabelAngleUpDown; NComboBox m_RedAxisScaleLabelAngleMode; NNumericUpDown m_GreenAxisSaleLabelAngleUpDown; NComboBox m_GreenAxisScaleLabelAngleMode; #endregion #region Static Methods #endregion #region Constants #endregion #region Nested Types #endregion } }

Download a fully functional C# (.cs) Polar Value Axis Position Example for WPF Solution

VB.NET Polar Value Axis Position 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 - NPolarValueAxisPositionExample"

		' 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.Polar)

            ' configure title
            chartView.Surface.Titles(0).Text = "Polar Value Axis Position"

            ' configure chart
            m_Chart = CType(chartView.Surface.Charts(0), NPolarChart)

            m_Chart.SetPredefinedPolarAxes(ENPredefinedPolarAxes.AngleValue)

            ' setup chart
            m_Chart.InnerRadius = 20

            ' setup polar axis
            Dim linearScale As NLinearScale = m_Chart.Axes(ENPolarAxis.PrimaryValue).Scale
            linearScale.ViewRangeInflateMode = ENScaleViewRangeInflateMode.MajorTick
            linearScale.InflateViewRangeBegin = True
            linearScale.InflateViewRangeEnd = True
            linearScale.Labels.OverlapResolveLayouts = New NDomArray(Of ENLevelLabelsLayout)(New ENLevelLabelsLayout() {ENLevelLabelsLayout.AutoScale})

            linearScale.MajorGridLines.Visible = True
            linearScale.MajorGridLines.Stroke.DashStyle = ENDashStyle.Dash

            Dim strip As NScaleStrip = New NScaleStrip()
            strip.Fill = New NColorFill(NColor.Beige)
            strip.Interlaced = True
            linearScale.Strips.Add(strip)

            ' setup polar angle axis
            Dim angularScale As NAngularScale = m_Chart.Axes(ENPolarAxis.PrimaryAngle).Scale

            angularScale.MajorGridLines.Visible = True
            angularScale.Labels.Style.Angle = New NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 0)

            ' add a const line
            Dim referenceLine As NAxisReferenceLine = New NAxisReferenceLine()
            referenceLine.Value = 1.0
            referenceLine.Stroke = New NStroke(1, NColor.SlateBlue)
            m_Chart.Axes(ENPolarAxis.PrimaryValue).ReferenceLines.Add(referenceLine)

            ' create a polar line series
            Dim series1 As NPolarLineSeries = New NPolarLineSeries()
            m_Chart.Series.Add(series1)
            series1.Name = "Series 1"
            series1.CloseContour = True
            series1.UseXValues = True
            series1.DataLabelStyle = New NDataLabelStyle(False)

            Dim markerStyle As NMarkerStyle = New NMarkerStyle()
            markerStyle.Visible = False
            markerStyle.Size = New NSize(2, 2)
            series1.MarkerStyle = markerStyle
            Curve1(series1, 50)

            ' create a polar line series
            Dim series2 As NPolarLineSeries = New NPolarLineSeries()
            m_Chart.Series.Add(series2)
            series2.Name = "Series 2"
            series2.CloseContour = True
            series2.UseXValues = True
            series2.DataLabelStyle = New NDataLabelStyle(False)

            markerStyle = New NMarkerStyle()
            markerStyle.Visible = False
            series2.MarkerStyle = markerStyle
            Curve2(series2, 100)

            ' add a second value axes
            m_RedAxis = m_Chart.Axes(ENPolarAxis.PrimaryValue)
            m_GreenAxis = m_Chart.AddCustomAxis(ENPolarAxisOrientation.Value)

            Dim redAxisAnchor As NCrossPolarAxisAnchor = New NCrossPolarAxisAnchor(ENPolarAxisOrientation.Value, ENScaleOrientation.Auto)
            redAxisAnchor.Crossing = New NValueAxisCrossing(m_Chart.Axes(ENPolarAxis.PrimaryAngle), 0.0F)
            m_RedAxis.Anchor = redAxisAnchor

            Dim greenAxisAnchor As NCrossPolarAxisAnchor = New NCrossPolarAxisAnchor(ENPolarAxisOrientation.Value, ENScaleOrientation.Auto)
            greenAxisAnchor.Crossing = New NValueAxisCrossing(m_Chart.Axes(ENPolarAxis.PrimaryAngle), 90)
            m_GreenAxis.Anchor = greenAxisAnchor

            ' color code the axes and series after the stylesheet is applied
            m_RedAxis.Scale.SetColor(NColor.Red)
            m_GreenAxis.Scale.SetColor(NColor.Green)

            series1.Stroke = New NStroke(2, NColor.DarkRed)
            series2.Stroke = New NStroke(2, NColor.DarkGreen)

            series2.ValueAxis = m_GreenAxis

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

            ' begin angle
            Dim beginAngleUpDown As NNumericUpDown = New NNumericUpDown()
            beginAngleUpDown.ValueChanged += AddressOf OnBeginAngleUpDownValueChanged
            stack.Add(NPairBox.Create("Begin Angle:", beginAngleUpDown))

            ' radian angle step
            Dim radianAngleStepComboBox As NComboBox = New NComboBox()

            radianAngleStepComboBox.Items.Add(New NComboBoxItem("15"))
            radianAngleStepComboBox.Items.Add(New NComboBoxItem("30"))
            radianAngleStepComboBox.Items.Add(New NComboBoxItem("45"))
            radianAngleStepComboBox.Items.Add(New NComboBoxItem("90"))
            radianAngleStepComboBox.SelectedIndexChanged += AddressOf OnRadianAngleStepComboBoxSelectedIndexChanged

            stack.Add(NPairBox.Create("Radian Angle Step", radianAngleStepComboBox))

            ' red axis position
            stack.Add(New NLabel("Red Axis:"))

            If True Then
                Dim dockRedAxisToBottomCheckBox As NCheckBox = New NCheckBox("Dock Bottom")
                dockRedAxisToBottomCheckBox.CheckedChanged += AddressOf OnDockRedAxisToBottomCheckBoxCheckedChanged
                stack.Add(dockRedAxisToBottomCheckBox)

                m_RedAxisAngleUpDown = New NNumericUpDown()
                m_RedAxisAngleUpDown.Value = 0
                Me.m_RedAxisAngleUpDown.ValueChanged += AddressOf OnRedAxisAngleUpDownValueChanged
                stack.Add(NPairBox.Create("Angle:", m_RedAxisAngleUpDown))

                Dim redAxisPaintRefelectionCheckBox As NCheckBox = New NCheckBox("Paint Reflection")
                redAxisPaintRefelectionCheckBox.Checked = True
                redAxisPaintRefelectionCheckBox.CheckedChanged += AddressOf OnRedAxisPaintRefelectionCheckBoxCheckedChanged
                stack.Add(redAxisPaintRefelectionCheckBox)

                m_RedAxisScaleLabelAngleMode = New NComboBox()
                m_RedAxisScaleLabelAngleMode.Items.FillFromEnum(Of ENScaleLabelAngleMode)()
                m_RedAxisScaleLabelAngleMode.SelectedIndex = CInt(ENScaleLabelAngleMode.View)
                Me.m_RedAxisScaleLabelAngleMode.SelectedIndexChanged += AddressOf OnUpdateRedAxisSaleLabelAngle
                stack.Add(NPairBox.Create("Scale Label Angle Mode:", m_RedAxisScaleLabelAngleMode))

                m_RedAxisSaleLabelAngleUpDown = New NNumericUpDown()
                Me.m_RedAxisSaleLabelAngleUpDown.ValueChanged += AddressOf OnUpdateRedAxisSaleLabelAngle
                stack.Add(NPairBox.Create("Scale Label Angle:", m_RedAxisSaleLabelAngleUpDown))

                Dim redAxisBeginPercentUpDown As NNumericUpDown = New NNumericUpDown()
                redAxisBeginPercentUpDown.Value = m_RedAxis.Anchor.BeginPercent
                redAxisBeginPercentUpDown.ValueChanged += AddressOf OnRedAxisBeginPercentUpDownValueChanged
                stack.Add(NPairBox.Create("Begin percent:", redAxisBeginPercentUpDown))

                Dim redAxisEndPercentUpDown As NNumericUpDown = New NNumericUpDown()
                redAxisEndPercentUpDown.Value = m_RedAxis.Anchor.EndPercent
                redAxisEndPercentUpDown.ValueChanged += AddressOf OnRedAxisEndPercentUpDownValueChanged
                stack.Add(NPairBox.Create("End percent:", redAxisEndPercentUpDown))
            End If

            ' green axis position
            stack.Add(New NLabel("Green Axis:"))

            If True Then
                Dim dockGreenAxisToLeftCheckBox As NCheckBox = New NCheckBox("Dock Left")
                dockGreenAxisToLeftCheckBox.CheckedChanged += AddressOf OnDockGreenAxisToLeftCheckBoxCheckedChanged
                stack.Add(dockGreenAxisToLeftCheckBox)

                m_GreenAxisAngleUpDown = New NNumericUpDown()
                m_GreenAxisAngleUpDown.Value = 90
                Me.m_GreenAxisAngleUpDown.ValueChanged += AddressOf OnGreenAxisAngleUpDownValueChanged
                stack.Add(NPairBox.Create("Angle:", m_GreenAxisAngleUpDown))

                Dim greenAxisPaintRefelectionCheckBox As NCheckBox = New NCheckBox("Paint Reflection")
                greenAxisPaintRefelectionCheckBox.Checked = True
                greenAxisPaintRefelectionCheckBox.CheckedChanged += AddressOf OnGreenAxisPaintRefelectionCheckBoxCheckedChanged
                stack.Add(greenAxisPaintRefelectionCheckBox)

                m_GreenAxisScaleLabelAngleMode = New NComboBox()
                m_GreenAxisScaleLabelAngleMode.Items.FillFromEnum(Of ENScaleLabelAngleMode)()
                m_GreenAxisScaleLabelAngleMode.SelectedIndex = CInt(ENScaleLabelAngleMode.View)
                Me.m_GreenAxisScaleLabelAngleMode.SelectedIndexChanged += AddressOf OnUpdateGreenAxisSaleLabelAngle
                stack.Add(NPairBox.Create("Scale Label Angle Mode:", m_GreenAxisScaleLabelAngleMode))

                m_GreenAxisSaleLabelAngleUpDown = New NNumericUpDown()
                Me.m_GreenAxisSaleLabelAngleUpDown.ValueChanged += AddressOf OnUpdateGreenAxisSaleLabelAngle
                stack.Add(NPairBox.Create("Scale Label Angle:", m_GreenAxisSaleLabelAngleUpDown))

                Dim greenAxisBeginPercentUpDown As NNumericUpDown = New NNumericUpDown()
                greenAxisBeginPercentUpDown.Value = m_GreenAxis.Anchor.BeginPercent
                greenAxisBeginPercentUpDown.ValueChanged += AddressOf OnGreenAxisBeginPercentUpDownValueChanged
                stack.Add(NPairBox.Create("Begin percent:", greenAxisBeginPercentUpDown))

                Dim greenAxisEndPercentUpDown As NNumericUpDown = New NNumericUpDown()
                greenAxisEndPercentUpDown.Value = m_GreenAxis.Anchor.EndPercent
                greenAxisEndPercentUpDown.ValueChanged += AddressOf OnGreenAxisEndPercentUpDownValueChanged
                stack.Add(NPairBox.Create("End percent:", greenAxisEndPercentUpDown))
            End If


            Return group
        End Function
        Public Function GetExampleDescription() As String
            Return "

This example demonstrates how to control the polar value axis position.

" End Function ''' ''' Gets the relevant documentation links for the example ''' ''' Public Function GetDocumentationUrls() As (String, String)() Return {("Polar Axes", "https://www.nevron.com/docs/openvision/polar-chart-axes.html"), ("Common Axis Functionality", "https://www.nevron.com/docs/openvision/chart-common-axis-functionality.html")} End Function #End Region #Region "Implementation" Friend Shared Sub Curve1(series As NPolarLineSeries, count As Integer) series.DataPoints.Clear() Dim angleStep = 2 * Math.PI / count For i = 0 To count - 1 Dim angle = i * angleStep Dim radius = 1 + Math.Cos(angle) series.DataPoints.Add(New NPolarLineDataPoint(angle * 180.0 / Math.PI, radius)) Next End Sub Friend Shared Sub Curve2(series As NPolarLineSeries, count As Integer) series.DataPoints.Clear() Dim angleStep = 2 * Math.PI / count For i = 0 To count - 1 Dim angle = i * angleStep Dim radius = 0.2 + 1.7 * Math.Sin(2 * angle) + 1.7 * Math.Cos(2 * angle) radius = Math.Abs(radius) series.DataPoints.Add(New NPolarLineDataPoint(angle * 180.0 / Math.PI, radius)) Next End Sub #End Region #Region "Event Handlers" Private Sub OnUpdateGreenAxisSaleLabelAngle(arg As NValueChangeEventArgs) TryCast(m_GreenAxis.Scale, NLinearScale).Labels.Style.Angle = New NScaleLabelAngle(m_GreenAxisScaleLabelAngleMode.SelectedIndex, m_GreenAxisSaleLabelAngleUpDown.Value) End Sub Private Sub OnGreenAxisPaintRefelectionCheckBoxCheckedChanged(arg As NValueChangeEventArgs) m_GreenAxis.PaintReflection = CType(arg.TargetNode, NCheckBox).Checked End Sub Private Sub OnGreenAxisEndPercentUpDownValueChanged(arg As NValueChangeEventArgs) m_GreenAxis.Anchor.EndPercent = CSng(CType(arg.TargetNode, NNumericUpDown).Value) End Sub Private Sub OnGreenAxisBeginPercentUpDownValueChanged(arg As NValueChangeEventArgs) m_GreenAxis.Anchor.BeginPercent = CSng(CType(arg.TargetNode, NNumericUpDown).Value) End Sub Private Sub OnGreenAxisAngleUpDownValueChanged(arg As NValueChangeEventArgs) Dim valueCrossPolarAnchor As NCrossPolarAxisAnchor = TryCast(m_GreenAxis.Anchor, NCrossPolarAxisAnchor) If valueCrossPolarAnchor IsNot Nothing Then CType(valueCrossPolarAnchor.Crossing, NValueAxisCrossing).Value = m_GreenAxisAngleUpDown.Value End If End Sub Private Sub OnDockGreenAxisToLeftCheckBoxCheckedChanged(arg As NValueChangeEventArgs) If CType(arg.TargetNode, NCheckBox).Checked Then m_GreenAxis.Anchor = New NDockPolarAxisAnchor(ENPolarAxisDockZone.Left) m_GreenAxisAngleUpDown.Enabled = False Else Dim anchor As NCrossPolarAxisAnchor = New NCrossPolarAxisAnchor(ENPolarAxisOrientation.Value, ENScaleOrientation.Auto) anchor.Crossing = New NValueAxisCrossing(m_Chart.Axes(ENPolarAxis.PrimaryAngle), m_GreenAxisAngleUpDown.Value) m_GreenAxis.Anchor = anchor m_GreenAxisAngleUpDown.Enabled = True End If End Sub Private Sub OnUpdateRedAxisSaleLabelAngle(arg As NValueChangeEventArgs) TryCast(m_RedAxis.Scale, NLinearScale).Labels.Style.Angle = New NScaleLabelAngle(m_RedAxisScaleLabelAngleMode.SelectedIndex, m_RedAxisSaleLabelAngleUpDown.Value) End Sub Private Sub OnRedAxisPaintRefelectionCheckBoxCheckedChanged(arg As NValueChangeEventArgs) m_RedAxis.PaintReflection = CType(arg.TargetNode, NCheckBox).Checked End Sub Private Sub OnRedAxisEndPercentUpDownValueChanged(arg As NValueChangeEventArgs) m_RedAxis.Anchor.EndPercent = CSng(CType(arg.TargetNode, NNumericUpDown).Value) End Sub Private Sub OnRedAxisBeginPercentUpDownValueChanged(arg As NValueChangeEventArgs) m_RedAxis.Anchor.BeginPercent = CSng(CType(arg.TargetNode, NNumericUpDown).Value) End Sub Private Sub OnRedAxisAngleUpDownValueChanged(arg As NValueChangeEventArgs) Dim valueCrossPolarAnchor As NCrossPolarAxisAnchor = TryCast(m_RedAxis.Anchor, NCrossPolarAxisAnchor) If valueCrossPolarAnchor IsNot Nothing Then CType(valueCrossPolarAnchor.Crossing, NValueAxisCrossing).Value = m_RedAxisAngleUpDown.Value End If End Sub Private Sub OnDockRedAxisToBottomCheckBoxCheckedChanged(arg As NValueChangeEventArgs) If CType(arg.TargetNode, NCheckBox).Checked Then m_RedAxis.Anchor = New NDockPolarAxisAnchor(ENPolarAxisDockZone.Bottom) m_RedAxisAngleUpDown.Enabled = False Else Dim anchor As NCrossPolarAxisAnchor = New NCrossPolarAxisAnchor(ENPolarAxisOrientation.Value, ENScaleOrientation.Auto) anchor.Crossing = New NValueAxisCrossing(m_Chart.Axes(ENPolarAxis.PrimaryAngle), m_RedAxisAngleUpDown.Value) m_RedAxis.Anchor = anchor m_RedAxisAngleUpDown.Enabled = True End If End Sub Private Sub OnRadianAngleStepComboBoxSelectedIndexChanged(arg As NValueChangeEventArgs) Dim angleScale As NAngularScale = m_Chart.Axes(ENPolarAxis.PrimaryAngle).Scale angleScale.MajorTickMode = ENMajorTickMode.CustomStep Select Case CType(arg.TargetNode, NComboBox).SelectedIndex Case 0 angleScale.CustomStep = New NAngle(15, NUnit.Degree) Case 1 angleScale.CustomStep = New NAngle(30, NUnit.Degree) Case 2 angleScale.CustomStep = New NAngle(45, NUnit.Degree) Case 3 angleScale.CustomStep = New NAngle(90, NUnit.Degree) Case Else NDebug.Assert(False) End Select End Sub Private Sub OnBeginAngleUpDownValueChanged(arg As NValueChangeEventArgs) m_Chart.BeginAngle = New NAngle(CType(arg.TargetNode, NNumericUpDown).Value, NUnit.Degree) End Sub #End Region #Region "Fields" Private m_Chart As NPolarChart Private m_RedAxis As NPolarAxis Private m_GreenAxis As NPolarAxis Private m_RedAxisAngleUpDown As NNumericUpDown Private m_GreenAxisAngleUpDown As NNumericUpDown Private m_RedAxisSaleLabelAngleUpDown As NNumericUpDown Private m_RedAxisScaleLabelAngleMode As NComboBox Private m_GreenAxisSaleLabelAngleUpDown As NNumericUpDown Private m_GreenAxisScaleLabelAngleMode As NComboBox #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) Polar Value Axis Position Example for WPF Solution

Related Documentation Links