Chart for .NET / User's Guide / Axes / Position / Polar Axis Anchors
In This Topic
    Polar Axis Anchors
    In This Topic

    Polar axis anchors allow you to position a polar axis inside the polar model space. There are two types of polar anchors - dock and cross - the first one allows you to dock polar axes to one of the six polar docking zones and the second one allows you to cross a polar axis with another axis with different orientation.

     Dock Polar Anchor

    The following picture shows the possible polar chart docking zones:

    On this image there are three axes - a green value axis docked to the left dock zone, a red value axis docked to the bottom zone and an angular axis docked to the outer polar rim. The Top and Right dock zones are not used by this chart and are shown with two rectangles, showing where axes will appear if docked there.

    Note that there is a significant difference between docking an axis to one of the cartesian dock zones (left, top, right, bottom) or to the outer rim. In the first four cases the axis will be able to scale values of the series displayed by the chart and in the second case it will scale angles. Usually when you dock polar axes to the outer rim zone you should also assign an angular scale configurator to them.

    The following code snippet will dock the default polar value axis to the bottom polar dock zone:

     

    C#
    Copy Code

    NPolarAxis axis = (NPolarAxis)polarChart.Axis(StandardAxis.Polar);
    axis.Anchor =
    new NDockPolarAxisAnchor(PolarAxisDockZone.Bottom);

    Visual Basic
    Copy Code

    Dim axis As NPolarAxis = CType(polarChart.Axis(StandardAxis.Polar), NPolarAxis)
    axis.Anchor =
    New NDockPolarAxisAnchor(PolarAxisDockZone.Bottom)

     Cross Polar Anchor

    The cross polar anchor allows for the crossing of axes in polar model space. The following picture illustrates this:

    On the above picture there are three axes - one value axis scaling values in the range [0, 150] and two angular axes denoting angles in degrees (red axis) and grads (green axis). The red axis is docked to the outer rim, while the green axis is crossed at value 113 with the value axis. The value axis is also crossed at 0 with the angle axis. The following code shows how to change the value axis crossing to 90 degrees:

    C#
    Copy Code

    NPolarAxis valueAxis = (NPolarAxis)polarChart.Axis(StandardAxis.Polar);
    NPolarAxis angleAxis = (NPolarAxis)polarChart.Axis(StandardAxis.PolarAngle);
       
    NCrossPolarAxisAnchor anchor = new NCrossPolarAxisAnchor(PolarAxisOrientation.Value);
    anchor.Crossings.Add(new NValueAxisCrossing(angleAxis, 90));

    valueAxis.Anchor = anchor;

    Visual Basic
    Copy Code

    Dim polarChart As New NPolarChart()
    Dim valueAxis As NPolarAxis = polarChart.Axis(StandardAxis.Polar)
    Dim angleAxis As NPolarAxis = polarChart.Axis(StandardAxis.PolarAngle)

    Dim anchor As New NCrossPolarAxisAnchor(PolarAxisOrientation.Value)
    anchor.Crossings.Add(New NValueAxisCrossing(angleAxis, 90))

    valueAxis.Anchor = anchor

    The effect from this code results in the following configuration of the value axis relative to the degree axis:

     Axis Reflection

    Both the cross and dock polar anchors have a property called PaintReflection, which is regarded when the axis is positioned as a value axis. The following code configures a cross value anchor to use reflection for the axis:

    C#
    Copy Code
    NPolarAxis axis = (NPolarAxis)polarChart.Axis(StandardAxis.Polar);
    NCrossPolarAxisAnchor crossAnchor = new NCrossPolarAxisAnchor(PolarAxisOrientation.Value);
    crossAnchor.PaintReflection = true;
    axis.Anchor = crossAnchor;
    Visual Basic
    Copy Code
    Dim axis As NPolarAxis = polarChart.Axis(StandardAxis.Polar)
    Dim crossAnchor As New NCrossPolarAxisAnchor(PolarAxisOrientation.Value)
    crossAnchor.PaintReflection = True
    axis.Anchor = crossAnchor

    The effect of this code is shown on the following picture:

     Related Examples

    Windows Forms: Chart Gallery\Polar\Value Axis Position

    Windows Forms: Chart Gallery\Polar\Angle Axis Position

    Web Forms: Chart Gallery\Polar\Value Axis Position

    Web Forms: Chart Gallery\Polar\Angle Axis Position

    See Also