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) }); var context = new VisualRenderContext(new VisualLayoutOptions(new VisualSize(360, 360)), 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());