class

Opal::UI::LineGraph

Inherits Opal::UI::Element < Opal::UI::Themable < Reference < Object

Renders 2D Cartesian line graphs and multi-series plots with axes, labels, tick marks, and smooth connected curves.

Constructors

new(series : Array(LineSeries) = [] of LineSeries, title : String | Nil = nil, min_y : Float64 | Nil = nil, max_y : Float64 | Nil = nil, show_grid : Bool = true, show_legend : Bool = true)
Source

Class methods

to_string(series : Array(LineSeries), title : String | Nil = nil, width : Int32 | Nil = nil, height : Int32 = 14, min_y : Float64 | Nil = nil, max_y : Float64 | Nil = nil, show_grid : Bool = true, show_legend : Bool = true, color : Bool | Nil = nil, theme : Theme | Nil = nil) : String

Class convenience method returning styled line graph string

Source
to_string(raw_series : Array(Tuple(String, Array(Float64))), title : String | Nil = nil, width : Int32 | Nil = nil, height : Int32 = 14, min_y : Float64 | Nil = nil, max_y : Float64 | Nil = nil, show_grid : Bool = true, show_legend : Bool = true, color : Bool | Nil = nil, theme : Theme | Nil = nil) : String

Overload accepting tuples of {name, data}

Source

Instance methods

add_series(name : String, data : Array(Float64), color : Color | Symbol | String = :cyan) : LineSeries
Source
max_y
Source
max_y=(max_y : Float64 | Nil)
Source
min_y
Source
min_y=(min_y : Float64 | Nil)
Source
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
Source
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source
series
Source
show_grid=(show_grid : Bool)
Source
show_grid?
Source
show_legend=(show_legend : Bool)
Source
show_legend?
Source
title
Source