# Reviewed work against its targets · Bullet

Preview

![Reviewed work against its targets](family-bullet-wide-light.png)

![Reviewed work against its targets](family-bullet-wide-dark.png)

800 × 367 pixels

## Create this example

Create a console project, add the ChartForgeX and ChartForgeX.Interactivity.Html packages, 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](family-bullet-wide-dark.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 = BulletRecipe.Create("wide", mode);
var context = new VisualRenderContext(
    new VisualLayoutOptions(new VisualSize(800, 367)), theme, mode,
    new VisualFrame("Reviewed work against its targets", "Cases reviewed within two working days in October; bands mark poor and acceptable", 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>Regional review rates compared with separate targets and qualitative ranges.</summary>
public static class BulletRecipe {
    /// <summary>Creates one measured value per region, each with its own target and range boundaries.</summary>
    public static Chart Create(string variant = "wide", ThemeMode mode = ThemeMode.Light) {
        if (variant is not ("wide" or "compact" or "sparse" or "options" or "compact-options" or "dense" or "compact-dense"))
            throw new ArgumentOutOfRangeException(nameof(variant));
        if (variant is "dense" or "compact-dense") {
            var values = new[] { 0d, 2611.111, 3722.222, 4833.333, 5944.444, 7055.555, 8166.666, 12345.6789 };
            var chart = Chart.Create().Title("Service completion against target").DataLabels();
            for (var index = 0; index < values.Length; index++) chart.AddBullet("Regional service " + (index + 1), values[index], 9500.125,
                0, 10000, new[] { 4000d, 8000 });
            return chart;
        }
        // Share of each region's October cases reviewed within two working days, against its own target;
        // the bands mark poor and acceptable results for that region.
        var regions = new (string Id, string Name, double Reviewed, double Target, double Poor, double Acceptable)[] {
            ("north", "North", 86, 90, 60, 80), ("south", "South", 74, 85, 55, 75), ("east", "East", 91, 90, 60, 80),
            ("west", "West", 68, 80, 50, 70), ("central", "Central", 79, 85, 55, 75), ("online", "Online", 95, 92, 70, 85)
        };
        var review = Chart.Create().ValueFormat(ChartValueFormat.Number("0'%'", CultureInfo.InvariantCulture));
        foreach (var region in variant == "sparse" ? regions.Take(2) : regions)
            review.AddSeries(ChartSeries.CreateBullet(new ChartSeriesId(region.Id), region.Name, region.Reviewed, region.Target,
                rangeEnds: new[] { region.Poor, region.Acceptable }));
        return review;
    }
}
```

```
#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 = BulletRecipe.Create("wide", mode);
var context = new VisualRenderContext(
    new VisualLayoutOptions(new VisualSize(800, 367)), theme, mode,
    new VisualFrame("Reviewed work against its targets", "Cases reviewed within two working days in October; bands mark poor and acceptable", 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>Regional review rates compared with separate targets and qualitative ranges.</summary>
public static class BulletRecipe {
    /// <summary>Creates one measured value per region, each with its own target and range boundaries.</summary>
    public static Chart Create(string variant = "wide", ThemeMode mode = ThemeMode.Light) {
        if (variant is not ("wide" or "compact" or "sparse" or "options" or "compact-options" or "dense" or "compact-dense"))
            throw new ArgumentOutOfRangeException(nameof(variant));
        if (variant is "dense" or "compact-dense") {
            var values = new[] { 0d, 2611.111, 3722.222, 4833.333, 5944.444, 7055.555, 8166.666, 12345.6789 };
            var chart = Chart.Create().Title("Service completion against target").DataLabels();
            for (var index = 0; index < values.Length; index++) chart.AddBullet("Regional service " + (index + 1), values[index], 9500.125,
                0, 10000, new[] { 4000d, 8000 });
            return chart;
        }
        // Share of each region's October cases reviewed within two working days, against its own target;
        // the bands mark poor and acceptable results for that region.
        var regions = new (string Id, string Name, double Reviewed, double Target, double Poor, double Acceptable)[] {
            ("north", "North", 86, 90, 60, 80), ("south", "South", 74, 85, 55, 75), ("east", "East", 91, 90, 60, 80),
            ("west", "West", 68, 80, 50, 70), ("central", "Central", 79, 85, 55, 75), ("online", "Online", 95, 92, 70, 85)
        };
        var review = Chart.Create().ValueFormat(ChartValueFormat.Number("0'%'", CultureInfo.InvariantCulture));
        foreach (var region in variant == "sparse" ? regions.Take(2) : regions)
            review.AddSeries(ChartSeries.CreateBullet(new ChartSeriesId(region.Id), region.Name, region.Reviewed, region.Target,
                rangeEnds: new[] { region.Poor, region.Acceptable }));
        return review;
    }
}
```

<!-- PowerForge markdown artifact sha256:F82C0DE98D1DA08AB20EAFF44CE624F29F96784C20F44133579A9F536DF47017 -->
