Opal::UI::PieChart
Inherits Opal::UI::Element < Opal::UI::Themable < Reference < Object
Renders interactive 2D circular or donut PieCharts with slices, percentage breakdowns, TrueColor fills, and legend keys.
Constructors
Class methods
print(slices : Array(PieSlice), title : String | Nil = nil, donut : Bool = false, io : IO = STDOUT, width : Int32 | Nil = nil, height : Int32 = 12, inner_radius_ratio : Float64 = 0.42, color : Bool | Nil = nil, theme : Theme | Nil = nil) : Nil
Class convenience method printing styled pie chart directly to IO
print(raw_slices : Array(Tuple(String, Float64)), title : String | Nil = nil, donut : Bool = false, io : IO = STDOUT, width : Int32 | Nil = nil, height : Int32 = 12, inner_radius_ratio : Float64 = 0.42, color : Bool | Nil = nil, theme : Theme | Nil = nil) : Nil
Overload printing tuples of {label, value} directly to IO
to_string(slices : Array(PieSlice), title : String | Nil = nil, donut : Bool = false, width : Int32 | Nil = nil, height : Int32 = 12, inner_radius_ratio : Float64 = 0.42, color : Bool | Nil = nil, theme : Theme | Nil = nil) : String
Class convenience method returning styled pie chart string
to_string(raw_slices : Array(Tuple(String, Float64)), title : String | Nil = nil, donut : Bool = false, width : Int32 | Nil = nil, height : Int32 = 12, inner_radius_ratio : Float64 = 0.42, color : Bool | Nil = nil, theme : Theme | Nil = nil) : String
Overload accepting tuples of {label, value}
Instance methods
add(label : String, value : Float64, color : Color | Symbol | String = :cyan, formatted_value : String | Nil = nil) : Nil
Sourcedonut?
Sourceinner_radius_ratio
Sourceslices
Sourcetitle
Sourcetotal_value
Source