Skip to content

Commit

Permalink
improved readme
Browse files Browse the repository at this point in the history
  • Loading branch information
masukomi committed Jan 4, 2023
1 parent 0586c32 commit 6b35f85
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 => <a b c d e f g h i j k>,
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.

Expand Down Expand Up @@ -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 => <a b c d e f g h i j k>,
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

Expand Down

0 comments on commit 6b35f85

Please sign in to comment.