Project

ChartForgeX

Render deterministic charts, dashboards, topology, hierarchy, and report visuals directly from .NET.

Stars 47
Forks 2
NuGet downloads 75,067
Release ChartForgeX-v2.0.0
Language: HTML Updated: 2026-10-12

API Reference

Class

LabelPlacementService

Namespace ChartForgeX.Rendering
Assembly ChartForgeX
Modifiers sealed

Places labels with the same font resolution and shaping used by PNG text, with a bounded measurement cache.

Inheritance

  • Object
  • LabelPlacementService

Remarks

For the same fonts and input order, placement is deterministic. Unresolvable fonts use portable measurements. Intersections with other labels and marks are rejected. Intentional containment in an associated mark is allowed.

Constructors

public LabelPlacementService() #

Methods

public TextMetrics Measure(String text, TextStyle style) #
Returns: TextMetrics

Measures shaped text with real font metrics, or a portable estimate if no font is available.

Parameters

text System.String requiredposition: 0
style ChartForgeX.Typography.TextStyle requiredposition: 1
public IReadOnlyList<PlacedLabel> Place(IReadOnlyList<LabelPlacementRequest> requests, ChartRect bounds, IReadOnlyList<LabelObstacle>? obstacles = null, Double gap = 2) #
Returns: IReadOnlyList<PlacedLabel>

Places a complete scene, returning results in the original request order.

Parameters

requests System.Collections.Generic.IReadOnlyList<ChartForgeX.Rendering.LabelPlacementRequest> requiredposition: 0
Label requests in stable input order.
bounds ChartForgeX.Primitives.ChartRect requiredposition: 1
The usable scene rectangle.
obstacles System.Collections.Generic.IReadOnlyList<ChartForgeX.Rendering.LabelObstacle>? = null optionalposition: 2
Mark rectangles to avoid.
gap System.Double = 2 optionalposition: 3
Minimum separation in logical pixels.