Skip to main content
All docs
V24.1

SwiftPointSeriesView.PointMarkerOptions Property

Allows you to access Swift Point series marker settings.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.1.dll

NuGet Package: DevExpress.Charts

Declaration

[PersistenceMode(PersistenceMode.InnerProperty)]
[XtraChartsLocalizableCategory(XtraChartsCategory.Appearance)]
[XtraSerializableProperty(XtraSerializationVisibility.Content)]
public SimpleMarker PointMarkerOptions { get; }

Property Value

Type Description
SimpleMarker

Contains marker options.

Example

This example shows how to create a Swift Point chart and configure its axes, legend, and appearance at runtime.

A Swift Point chart

Follow the steps below to create a sample Swift Point chart:

using DevExpress.XtraCharts;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace SwiftPointChart {
    public partial class Form1 : Form {
        const int PointsCount = 100000;
        public Form1() {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e) {
            List<Point> data = GenerateData();

            Series series = new Series("Random Data", ViewType.SwiftPoint);
            chartControl1.Series.Add(series);
            series.BindToData(data, "X", "Y");

            SwiftPointSeriesView view = (SwiftPointSeriesView)series.View;
            view.Color = Color.FromArgb(180, chartControl1.GetPaletteEntries(1)[0].Color);
            view.PointMarkerOptions.Size = 6;
            view.PointMarkerOptions.Kind = MarkerKind.Square;

            SwiftPlotDiagram diagram = (SwiftPlotDiagram)chartControl1.Diagram;
            diagram.EnableAxisXScrolling = true;
            diagram.EnableAxisXZooming = true;
            diagram.EnableAxisYScrolling = true;
            diagram.EnableAxisYZooming = true;
            diagram.DependentAxesYRange = DevExpress.Utils.DefaultBoolean.True;
            diagram.AxisX.VisualRange.SetMinMaxValues(3460, 3680);
            diagram.AxisY.VisualRange.SetMinMaxValues(400000, 1600000);

            chartControl1.Legend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
            chartControl1.Legend.AlignmentVertical = LegendAlignmentVertical.TopOutside;
        }
        List<Point> GenerateData() {
            List<Point> data = new List<Point>(PointsCount);
            Random random = new Random(0);
            double value;
            int square, price, maxValue, minValue;
            for (int i = 0; i < PointsCount; i++) {
                value = random.NextDouble();
                value = (Math.Pow(value, 15) + 1.2) * Math.Pow(value, 0.2) / 2.2;
                maxValue = random.Next(10) == 1 ? (int)(random.NextDouble() * 2000 + 4000) : random.Next(1000) + 4500;
                minValue = random.Next(11) == 10 ? 400 : 600;
                square = (int)(value * maxValue + minValue);
                if (random.Next(800 - square / 10) == 1)
                    maxValue = (int)(3000000 * (random.NextDouble() + 1));
                else
                    maxValue = 3 * (int)((Math.Pow(value, 2) + 0.5) * Math.Pow(value, 0.2) * 670000);
                value = random.NextDouble();
                minValue = random.Next(11) == 10 ? 400000 : 200000;
                price = (int)(value * maxValue + minValue);
                if (price > 2000000 * (0.2 * random.NextDouble() + 1) && square < random.Next(1000) + 3500)
                    square += random.Next(2000);
                if (price > 3000000 * (0.2 * random.NextDouble() + 1))
                    square += random.Next(2000);
                data.Add(new Point(square, price));
            }
            return data;
        }
    }
}
See Also