XYGraph
A composable that lays out a chart consisting of two axes, a grid, and plot content.
The layout process is performed in several steps:
The sizes of the axis titles are determined.
The axis models are consulted to determine the tick values.
The axis labels are sub-composed and measured to determine their sizes.
The remaining space is allocated to the plot area.
The grid, axes, and plot content are composed and placed in the plot area.
The content of the XYGraph is a Composable lambda that receives an XYGraphScope. This scope provides the context of the graph's axes and allows for the conversion between data coordinates and screen coordinates, which is necessary for plotting data.
Parameters
The AxisModel for the x-axis, which controls the range, coordinate transformation, and tick marks.
The AxisModel for the y-axis, which controls the range, coordinate transformation, and tick marks.
The content for the x-axis, including the title and labels. See AxisContent.
The content for the y-axis, including the title and labels. See AxisContent.
The modifier to be applied to the graph.
The styling for the major and minor grid lines. See GridStyle.
Configuration for pan and zoom gestures. See GestureConfig.
A callback that is invoked when a pointer event occurs within the plot area. The XYGraphPointerEventScope provides a scale function to convert from screen to data coordinates.
The composable content to be displayed within the graph, which typically includes one or more plot types like io.github.koalaplot.core.line.LinePlot or io.github.koalaplot.core.line.AreaPlot.
Type Parameters
The data type for the x-axis.
The data type for the y-axis.