Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add temporal line chart annotations #402

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,32 @@ smart_columns:
status: {0: "Active", 1: "Archived"}
```

### Annotations

Shows overlay lines or box ranges for line queries.

Suppose your sales data and your deployments data, given a query:

```sql
SELECT date_trunc('hour', created_at), sum(value) FROM sales GROUP BY 1
```

You might want to see the influence of a deployment for those sales.

```yml
annotations:
deployments: SELECT date, name FROM deployments WHERE date BETWEEN {min_date} AND {max_date}
```

You can also show periods:

```yml
annotations:
holidays: SELECT min_date, max_date, name FROM holidays WHERE (min_date, max_date) OVERLAPS ({min_date}, {max_date})
```

Conditions for those queries are optional, but they will help to only fetch the relevant annotations for a particular chart.

### Caching

Blazer can automatically cache results to improve speed. It can cache slow queries:
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/blazer/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//= require ./chartjs-adapter-date-fns.bundle
//= require ./chartkick
//= require ./mapkick.bundle
//= require ./chartjs-plugin-annotation.js
//= require ./ace
//= require ./Sortable
//= require ./bootstrap
Expand Down