class CrystalCliGraph::Legend
- CrystalCliGraph::Legend
- Reference
- Object
Defined in:
crystal_cli_graph/legend.crConstructors
-
.new(data : Array(Int32), labels : Array(String), key_chars : Array(String), max_width : Int32)
Warning: assumes there will be a space between each word.
Instance Method Summary
- #data : Array(Int32)
- #generate : String
- #generate_horizantal_edge(max_width : Int32) : String
- #generate_legend_row(legend : String, key : String, max_width : Int32, max_key_chars : Int32) : Array(String)
- #labels : Array(String)
- #max_width : Int32
- #pad_rows_to_width(rows : Array(String), largest_legend_size : Int32) : Array(String)
- #wrap_string_to_width(string : String, width : Int32) : Array(String)
Constructor Detail
def self.new(data : Array(Int32), labels : Array(String), key_chars : Array(String), max_width : Int32)
#
Warning: assumes there will be a space between each word. This is not a valid assumption for all languages
Instance Method Detail
def generate_legend_row(legend : String, key : String, max_width : Int32, max_key_chars : Int32) : Array(String)
#
def pad_rows_to_width(rows : Array(String), largest_legend_size : Int32) : Array(String)
#