diff --git a/README.md b/README.md index 53f2f72..3605208 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,25 @@ Currently limited to vertical bar charts. See the end of this document for futur SYNOPSIS ======== + +## Common Usage Example +```raku +use CLI::Graphing::BarChart::Vertical; + +my $x_and_y_axis_graph = CLI::Graphing::BarChart::Vertical.new( + data => [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100], + graph_height => 10, + x_axis_labels => , + y_axis_labels => <0 1 2 3 4 5 6 7 8 9> +); + +# to get the string version of the graph +$x_and_y_axis_graph.generate(); + +# to print the graph to Standard Out +$x_and_y_axis_graph.print(); +``` + Note that the 0 x 0 point of this graph is the bottom left corner. Data and labels start from there and move outwards. @@ -73,22 +92,6 @@ My advice is to use single letter `x_axis_labels` and then use [Prettier::Table](https://github.com/masukomi/Prettier-Table/) to generate a legend that explains your x axis. -```raku -use CLI::Graphing::BarChart::Vertical; - -my $x_and_y_axis_graph = CLI::Graphing::BarChart::Vertical.new( - data => [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100], - graph_height => 10, - x_axis_labels => , - y_axis_labels => <0 1 2 3 4 5 6 7 8 9> -); - -# to get the string version of the graph -$x_and_y_axis_graph.generate(); - -# to print the graph to Standard Out -$x_and_y_axis_graph.print(); -``` # Future + Contributing