← Gallery

Donut

Findings by category

Explore the example, download the output or use the C# source in your own project.

Preview
Findings by categoryChart with 1 data series: Findings.Findings by categoryOne prepared scene for SVG and native PNGDay 718.7%38Day 617.2%35Day 515.8%32Day 414.3%29Day 312.8%26Other21.2%43203Findings
Findings by category
Findings by categoryChart with 1 data series: Findings.Findings by categoryOne prepared scene for SVG and native PNGDay 718.7%38Day 617.2%35Day 515.8%32Day 414.3%29Day 312.8%26Other21.2%43203Findings
Findings by category
800 × 440 pixels

Create this example

Register the included Carlito font files to reproduce the exported typography.

using ChartForgeX.Core;
using ChartForgeX.Primitives;
using ChartForgeX.Rendering;
using ChartForgeX.Themes;
using ChartForgeX.Typography;

// The generated gallery includes these licensed font fixtures beside the outputs.
FontRegistry.Register("CFX Proof Carlito", "fonts/Carlito-Regular.ttf", 400);
FontRegistry.Register("CFX Proof Carlito", "fonts/Carlito-Bold.ttf", 700);
var chart = Chart.Create();
chart.WithXLabels("Day 1", "Day 2", "Day 3", "Day 4", "Day 5", "Day 6", "Day 7");
chart.AddDonut("Findings", new ChartPoint[] { new ChartPoint(1, 20), new ChartPoint(2, 23), new ChartPoint(3, 26), new ChartPoint(4, 29), new ChartPoint(5, 32), new ChartPoint(6, 35), new ChartPoint(7, 38) });
chart.Series[0].WithPointColorRange(0, 1, ChartColor.FromHex("#1D8A52"));
chart.Series[0].WithPointColorRange(1, 1, ChartColor.FromHex("#C78404"));
chart.Series[0].WithPointColorRange(2, 1, ChartColor.FromHex("#D4302F"));
chart.Series[0].WithPointColorRange(3, 1, ChartColor.FromHex("#1D8A52"));
chart.Series[0].WithPointColorRange(4, 1, ChartColor.FromHex("#C78404"));
chart.Series[0].WithPointColorRange(5, 1, ChartColor.FromHex("#D4302F"));
chart.Series[0].WithPointColorRange(6, 1, ChartColor.FromHex("#1D8A52"));
var context = new VisualRenderContext(new VisualLayoutOptions(new VisualSize(800, 440)), VisualTheme.Graphite(), VisualThemeMode.Light,
    new VisualFrame("Findings by category", "One prepared scene for SVG and native PNG", showSurface: false), FontSpec.FromFamily("CFX Proof Carlito"));
var prepared = chart.Prepare(context);
System.IO.File.WriteAllText("chart.svg", prepared.ToSvg());
System.IO.File.WriteAllBytes("chart.png", prepared.ToPng());
using ChartForgeX.Core;
using ChartForgeX.Primitives;
using ChartForgeX.Rendering;
using ChartForgeX.Themes;
using ChartForgeX.Typography;

// The generated gallery includes these licensed font fixtures beside the outputs.
FontRegistry.Register("CFX Proof Carlito", "fonts/Carlito-Regular.ttf", 400);
FontRegistry.Register("CFX Proof Carlito", "fonts/Carlito-Bold.ttf", 700);
var chart = Chart.Create();
chart.WithXLabels("Day 1", "Day 2", "Day 3", "Day 4", "Day 5", "Day 6", "Day 7");
chart.AddDonut("Findings", new ChartPoint[] { new ChartPoint(1, 20), new ChartPoint(2, 23), new ChartPoint(3, 26), new ChartPoint(4, 29), new ChartPoint(5, 32), new ChartPoint(6, 35), new ChartPoint(7, 38) });
chart.Series[0].WithPointColorRange(0, 1, ChartColor.FromHex("#4CC78A"));
chart.Series[0].WithPointColorRange(1, 1, ChartColor.FromHex("#EEB640"));
chart.Series[0].WithPointColorRange(2, 1, ChartColor.FromHex("#F47171"));
chart.Series[0].WithPointColorRange(3, 1, ChartColor.FromHex("#4CC78A"));
chart.Series[0].WithPointColorRange(4, 1, ChartColor.FromHex("#EEB640"));
chart.Series[0].WithPointColorRange(5, 1, ChartColor.FromHex("#F47171"));
chart.Series[0].WithPointColorRange(6, 1, ChartColor.FromHex("#4CC78A"));
var context = new VisualRenderContext(new VisualLayoutOptions(new VisualSize(800, 440)), VisualTheme.Graphite(), VisualThemeMode.Dark,
    new VisualFrame("Findings by category", "One prepared scene for SVG and native PNG", showSurface: false), FontSpec.FromFamily("CFX Proof Carlito"));
var prepared = chart.Prepare(context);
System.IO.File.WriteAllText("chart.svg", prepared.ToSvg());
System.IO.File.WriteAllBytes("chart.png", prepared.ToPng());