class RatatuiRuby::Chart

Plots data points on a Cartesian coordinate system.

Trends and patterns are invisible in raw logs. You need to see the shape of the data to understand the story it tells.

This widget plots X/Y coordinates. It supports multiple datasets, custom axes, and different marker types.

Use it for analytics, scientific data, or monitoring metrics over time.

Examples

Chart.new(
  datasets: [
    Dataset.new(
      name: "Requests",
      data: [[0.0, 1.0], [1.0, 2.0], [2.0, 1.5]],
      style: Style.new(fg: :yellow)
    )
  ],
  x_axis: Axis.new(title: "Time", bounds: [0.0, 5.0]),
  y_axis: Axis.new(title: "RPS", bounds: [0.0, 5.0]),
  legend_position: :top_right
)