# Native point marker authoring · Scatter

Preview

![Native point marker authoring](quadrant-point-styles-compact-light.png)

![Native point marker authoring](quadrant-point-styles-compact-dark.png)

390 × 500 pixels

## Create this example

Create a console project, add the ChartForgeX package, and replace Program.cs with this source. Run it to write SVG, PNG and HTML with the default system fonts.

For the same typography as the gallery, [download the gallery-font recipe](quadrant-point-styles-compact-light.gallery.csharp.txt) and copy the gallery’s fonts directory beside your program.

```
#region Setup
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using ChartForgeX;
using ChartForgeX.Core;
using ChartForgeX.Primitives;
using ChartForgeX.Rendering;
using ChartForgeX.Themes;
using ChartForgeX.Topology;
using ChartForgeX.Typography;
using ChartForgeX.VisualArtifacts;
using ChartForgeX.VisualBlocks;

var mode = ThemeMode.Light;
var theme = VisualTheme.Graphite();
var model = QuadrantPointStylesRecipe.Create("compact", mode);
var context = new VisualRenderContext(
    new VisualLayoutOptions(new VisualSize(390, 500)), theme, mode,
    new VisualFrame("Native point marker authoring", "One native source series retains independent markers and located axis captions", showLegend: null, showSurface: false));
var prepared = model.Prepare(context);
File.WriteAllText("visual.svg", prepared.ToSvg());
File.WriteAllBytes("visual.png", prepared.ToPng());
File.WriteAllText("visual.html", prepared.ToArtifact("example", VisualArtifactKind.Chart).ToHtmlPage());
#endregion

/// <summary>Native Core authoring for independent quadrant captions and source-owned Scatter marker styles.</summary>
public static class QuadrantPointStylesRecipe {
    /// <summary>Creates the native example. The separately shared Mermaid fixture proves parsed-source mapping.</summary>
    public static Chart Create(string variant = "wide", ThemeMode mode = ThemeMode.Light) {
        if (variant is not ("wide" or "compact")) throw new ArgumentOutOfRangeException(nameof(variant));
        var observations = ChartSeries.CreateScatter(new ChartSeriesId("proposed-work"), "Proposed work", new[] {
            new ChartPoint(.22, .74), new ChartPoint(.76, .72), new ChartPoint(.28, .26), new ChartPoint(.72, .24)
        });
        var labels = new[] { "Opportunity", "Investment", "Experiment", "Review" };
        for (var index = 0; index < labels.Length; index++)
            observations.ObservationId(index, new ChartObservationId(labels[index].ToLowerInvariant())).PointLabel(index, labels[index]);
        observations.Markers(marker => { marker.Radius = 5; marker.StrokeWidth = 0; });
        observations.PointMarkers(0, marker => {
            marker.Radius = 9; marker.Fill = ChartColor.FromHex("#B45309");
            marker.Stroke = ChartColor.FromHex("#7C2D12"); marker.StrokeWidth = 2;
        });
        observations.PointMarkers(1, marker => {
            marker.Radius = 7; marker.Fill = ChartColor.FromHex("#0369A1");
            marker.Stroke = ChartColor.FromHex("#075985"); marker.StrokeWidth = 1;
        });
        observations.PointMarkers(2, marker => { marker.Radius = 6; marker.Fill = ChartColor.FromHex("#7C3AED"); });
        var chart = Chart.Create().Size(variant == "compact" ? 390 : 800, 500)
            .Theme(VisualTheme.Graphite()).ThemeMode(mode).Title("Native work priorities")
            .Subtitle("One source series, independent marker options and endpoint captions")
            .Legend(false).ShowGrid(false).DataLabels().XAxis(x => x.Bounds(0, 1)).YAxis(y => y.Bounds(0, 1))
            .AddSeries(observations);
        chart.XAxis(axis => { axis.TickCount = 2; axis.Labels.Add(new ChartAxisLabel(.25, "Low effort")); axis.Labels.Add(new ChartAxisLabel(.75, "High effort")); });
        chart.YAxis(axis => { axis.TickCount = 2; axis.Labels.Add(new ChartAxisLabel(.25, "Low impact")); axis.Labels.Add(new ChartAxisLabel(.75, "High impact")); });
        chart.AddPlotRegion(new ChartPlotRegion(0, xMinimum: .5, yMinimum: .5, label: "Plan"))
            .AddPlotRegion(new ChartPlotRegion(1, xMaximum: .5, yMinimum: .5, label: "Prioritize"))
            .AddPlotRegion(new ChartPlotRegion(2, xMaximum: .5, yMaximum: .5, label: "Consider"))
            .AddPlotRegion(new ChartPlotRegion(3, xMinimum: .5, yMaximum: .5, label: "Reassess"));
        // Keyed value replacement preserves Investment's authored radius, paint and identity.
        observations.ApplyPointChanges(new[] {
            ChartObservationChange<ChartPoint>.Replace(new ChartObservationId("investment"), new ChartPoint(.78, .76))
        });
        return chart;
    }
}
```

```
#region Setup
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using ChartForgeX;
using ChartForgeX.Core;
using ChartForgeX.Primitives;
using ChartForgeX.Rendering;
using ChartForgeX.Themes;
using ChartForgeX.Topology;
using ChartForgeX.Typography;
using ChartForgeX.VisualArtifacts;
using ChartForgeX.VisualBlocks;

var mode = ThemeMode.Dark;
var theme = VisualTheme.Graphite();
var model = QuadrantPointStylesRecipe.Create("compact", mode);
var context = new VisualRenderContext(
    new VisualLayoutOptions(new VisualSize(390, 500)), theme, mode,
    new VisualFrame("Native point marker authoring", "One native source series retains independent markers and located axis captions", showLegend: null, showSurface: false));
var prepared = model.Prepare(context);
File.WriteAllText("visual.svg", prepared.ToSvg());
File.WriteAllBytes("visual.png", prepared.ToPng());
File.WriteAllText("visual.html", prepared.ToArtifact("example", VisualArtifactKind.Chart).ToHtmlPage());
#endregion

/// <summary>Native Core authoring for independent quadrant captions and source-owned Scatter marker styles.</summary>
public static class QuadrantPointStylesRecipe {
    /// <summary>Creates the native example. The separately shared Mermaid fixture proves parsed-source mapping.</summary>
    public static Chart Create(string variant = "wide", ThemeMode mode = ThemeMode.Light) {
        if (variant is not ("wide" or "compact")) throw new ArgumentOutOfRangeException(nameof(variant));
        var observations = ChartSeries.CreateScatter(new ChartSeriesId("proposed-work"), "Proposed work", new[] {
            new ChartPoint(.22, .74), new ChartPoint(.76, .72), new ChartPoint(.28, .26), new ChartPoint(.72, .24)
        });
        var labels = new[] { "Opportunity", "Investment", "Experiment", "Review" };
        for (var index = 0; index < labels.Length; index++)
            observations.ObservationId(index, new ChartObservationId(labels[index].ToLowerInvariant())).PointLabel(index, labels[index]);
        observations.Markers(marker => { marker.Radius = 5; marker.StrokeWidth = 0; });
        observations.PointMarkers(0, marker => {
            marker.Radius = 9; marker.Fill = ChartColor.FromHex("#B45309");
            marker.Stroke = ChartColor.FromHex("#7C2D12"); marker.StrokeWidth = 2;
        });
        observations.PointMarkers(1, marker => {
            marker.Radius = 7; marker.Fill = ChartColor.FromHex("#0369A1");
            marker.Stroke = ChartColor.FromHex("#075985"); marker.StrokeWidth = 1;
        });
        observations.PointMarkers(2, marker => { marker.Radius = 6; marker.Fill = ChartColor.FromHex("#7C3AED"); });
        var chart = Chart.Create().Size(variant == "compact" ? 390 : 800, 500)
            .Theme(VisualTheme.Graphite()).ThemeMode(mode).Title("Native work priorities")
            .Subtitle("One source series, independent marker options and endpoint captions")
            .Legend(false).ShowGrid(false).DataLabels().XAxis(x => x.Bounds(0, 1)).YAxis(y => y.Bounds(0, 1))
            .AddSeries(observations);
        chart.XAxis(axis => { axis.TickCount = 2; axis.Labels.Add(new ChartAxisLabel(.25, "Low effort")); axis.Labels.Add(new ChartAxisLabel(.75, "High effort")); });
        chart.YAxis(axis => { axis.TickCount = 2; axis.Labels.Add(new ChartAxisLabel(.25, "Low impact")); axis.Labels.Add(new ChartAxisLabel(.75, "High impact")); });
        chart.AddPlotRegion(new ChartPlotRegion(0, xMinimum: .5, yMinimum: .5, label: "Plan"))
            .AddPlotRegion(new ChartPlotRegion(1, xMaximum: .5, yMinimum: .5, label: "Prioritize"))
            .AddPlotRegion(new ChartPlotRegion(2, xMaximum: .5, yMaximum: .5, label: "Consider"))
            .AddPlotRegion(new ChartPlotRegion(3, xMinimum: .5, yMaximum: .5, label: "Reassess"));
        // Keyed value replacement preserves Investment's authored radius, paint and identity.
        observations.ApplyPointChanges(new[] {
            ChartObservationChange<ChartPoint>.Replace(new ChartObservationId("investment"), new ChartPoint(.78, .76))
        });
        return chart;
    }
}
```

<!-- PowerForge markdown artifact sha256:97B4D02F845A228370283D5D56C6CE9A3A160CE4594E81A678E228B7ECC3FC62 -->
