Skip to content

Commit

Permalink
Update docs structure
Browse files Browse the repository at this point in the history
  • Loading branch information
styd committed Feb 5, 2024
1 parent 094e249 commit 18c136a
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 60 deletions.
35 changes: 18 additions & 17 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@

## Usage

* [Cartesian Charts: Part 1](usage/cartesian-charts/part1.md)
* [Line Chart](usage/cartesian-charts/part1.md#line-chart)
* [Stepline Chart](usage/cartesian-charts/part1.md#stepline-chart)
* [Area Chart](usage/cartesian-charts/part1.md#area-chart)
* [Column Chart](usage/cartesian-charts/part1.md#column-chart)
* [Bar Chart](usage/cartesian-charts/part1.md#bar-chart)
* [Range Bar Chart](usage/cartesian-charts/part1.md#range-bar-chart)
* [Cartesian Charts: Part 2](usage/cartesian-charts/part2.md)
* [Scatter Chart](usage/cartesian-charts/part2.md#scatter-chart)
* [Candlestick Chart](usage/cartesian-charts/part2.md#candlestick-chart)
* [Box Plot Chart](usage/cartesian-charts/part2.md#box-plot-chart)
* [Cartesian Charts: Part 3](usage/cartesian-charts/part3.md)
* [Mixed Charts](usage/cartesian-charts/part3.md#mixed-charts)
* [Syncing Charts](usage/cartesian-charts/part3.md#syncing-charts)
* [Brush Chart](usage/cartesian-charts/part3.md#brush-chart)
* [Annotations](usage/cartesian-charts/part3.md#annotations)
* [Multiple Y-Axes](usage/cartesian-charts/part3.md#multiple-y-axes)
* [Cartesian Charts](usage/cartesian-charts/README.md)
* [Part 1](usage/cartesian-charts/part1.md)
* [Line Chart](usage/cartesian-charts/part1.md#line-chart)
* [Stepline Chart](usage/cartesian-charts/part1.md#stepline-chart)
* [Area Chart](usage/cartesian-charts/part1.md#area-chart)
* [Column Chart](usage/cartesian-charts/part1.md#column-chart)
* [Bar Chart](usage/cartesian-charts/part1.md#bar-chart)
* [Range Bar Chart](usage/cartesian-charts/part1.md#range-bar-chart)
* [Part 2](usage/cartesian-charts/part2.md)
* [Scatter Chart](usage/cartesian-charts/part2.md#scatter-chart)
* [Candlestick Chart](usage/cartesian-charts/part2.md#candlestick-chart)
* [Box Plot Chart](usage/cartesian-charts/part2.md#box-plot-chart)
* [Part 3](usage/cartesian-charts/part3.md)
* [Mixed Charts](usage/cartesian-charts/part3.md#mixed-charts)
* [Syncing Charts](usage/cartesian-charts/part3.md#syncing-charts)
* [Brush Chart](usage/cartesian-charts/part3.md#brush-chart)
* [Annotations](usage/cartesian-charts/part3.md#annotations)
* [Multiple Y-Axes](usage/cartesian-charts/part3.md#multiple-y-axes)
* [Heatmap Chart](usage/heatmap-chart.md)
* [Radar Chart](usage/radar-chart.md)
* [Bubble Chart](usage/bubble-chart.md)
Expand Down
41 changes: 41 additions & 0 deletions docs/usage/cartesian-charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
### Cartesian Charts

Example series used for cartesian charts:

```erb
<% series = [
{name: "Inactive", data: @inactive_properties},
{name: "Active", data: @active_properties}
] %>
```
To build the data, you can use gem [groupdate](https://github.com/ankane/groupdate).
In my case, it was:

```ruby
@inactive_properties = Property.inactive.group_by_week(:created_at).count
@active_properties = Property.active.group_by_week(:created_at).count
```

and I'll get the data in this format:
```ruby
{
Sun, 29 Jul 2018=>1,
Sun, 05 Aug 2018=>6,
..
}
```
PS: `Property` can be any model you have and `inactive` and `active`
are just some normal ActiveRecord scopes. Keep scrolling down to see
accepted data formats.

Example options used for cartesian charts:

```erb
<% options = {
title: 'Properties Growth',
subtitle: 'Grouped Per Week',
xtitle: 'Week',
ytitle: 'Properties',
stacked: true
} %>
```
43 changes: 0 additions & 43 deletions docs/usage/cartesian-charts/part1.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,3 @@
### Cartesian Charts: Part 1

Example series used for cartesian charts:

```erb
<% series = [
{name: "Inactive", data: @inactive_properties},
{name: "Active", data: @active_properties}
] %>
```
To build the data, you can use gem [groupdate](https://github.com/ankane/groupdate).
In my case, it was:

```ruby
@inactive_properties = Property.inactive.group_by_week(:created_at).count
@active_properties = Property.active.group_by_week(:created_at).count
```

and I'll get the data in this format:
```ruby
{
Sun, 29 Jul 2018=>1,
Sun, 05 Aug 2018=>6,
..
}
```
PS: `Property` can be any model you have and `inactive` and `active`
are just some normal ActiveRecord scopes. Keep scrolling down to see
accepted data formats.

Example options used for cartesian charts:

```erb
<% options = {
title: 'Properties Growth',
subtitle: 'Grouped Per Week',
xtitle: 'Week',
ytitle: 'Properties',
stacked: true
} %>
```


#### Line Chart

```erb
Expand Down

0 comments on commit 18c136a

Please sign in to comment.