Expand description
A two-dimensional chart implementation for plotting data in a Cartesian coordinate system.
XYChart provides a flexible and extensible charting system that supports:
- X and Y axes with customizable ranges
- Tick marks and labels on both axes
- Grid lines for visual reference
- Multiple rendering layers (axes, plot, annotations)
- Coordinate transformations between world and plot coordinates
- Various plot elements like lines, shapes, images, and annotations
- Automatic margin management and view box calculations
- SVG rendering with clipping support
§Layers
The chart uses three main layers:
- axes: Contains axis elements, labels, and descriptions (unclipped)
- plot: Contains the main plot data (clipped to plot area)
- annotations: Contains annotations and labels (unclipped, top layer)
§Coordinate Systems
- World coordinates: The actual data coordinate system defined by x_range and y_range
- Plot coordinates: SVG coordinate system with (0,0) at top-left of plot area
Structs§
- Scale
Range - Scale
Range Iterator - Scale
Range With Step - Scale
Value - XYChart
- An XYChart is a two-dimensional chart that can plot data in a Cartesian coordinate system, with x and y axes. It supports various features such as adding ticks, labels, grid lines, and annotations. It can also render images and shapes on the plot area. It is designed to be flexible and extensible, allowing users to customize the appearance and behavior of the chart.
- XYChromaticity
Functions§
- plot_
to_ world_ coordinates - Converts plot (SVG) coordinates to world/data coordinates.