Skip to content

Commit 86a59a8

Browse files
authored
Add Bar chart (#39)
* renamed bar chart on index to IndexViewChart * Refactored Chart and extracted common functions to mixin * Updated Index and Detail View * Updated readme to add references for Bar Chart * Compilation Updates * Style Fixes * Updated style rules * Removed alpha ordered imports from StyleCI
1 parent ab3c019 commit 86a59a8

File tree

10 files changed

+126
-43464
lines changed

10 files changed

+126
-43464
lines changed

.styleci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ enabled:
66
- compact_nullable_typehint
77
- concat_with_spaces
88
- explicit_string_variable
9+
- length_ordered_imports
910
- method_chaining_indentation
1011
- no_empty_comment
1112
- ordered_class_elements
@@ -18,3 +19,4 @@ enabled:
1819

1920
disabled:
2021
- concat_without_spaces
22+
- alpha_ordered_imports

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
![Banner](resources/imgs/banner.png "Banner")
22

33
## Introduction
4-
This package allows you to easily add chart.js graphs to your nova resources. This project is under active development, and currently only supports Line Datasets. You are welcome to request or contribute additional charts by opening an issue.
4+
This package allows you to easily add chart.js graphs to your nova resources. This project is under active development, and currently only supports Line and Bar Charts. You are welcome to request or contribute additional charts by opening an issue.
55

66
![Cover Image](screenshots/CoverImage.jpg "Cover Image")
77

@@ -122,7 +122,7 @@ class Employee extends Model implements Chartable
122122
'label' => 'Minimum Required',
123123
'borderColor' => '#f87900',
124124
'fill' => '+1',
125-
'backgroundColor' => 'rgba(20,20,20,0.2)',
125+
'backgroundColor' => 'rgba(20,20,20,0.2)',//For bar charts, this will be the fill color of the bar
126126
'data' => [8, 7, 12, 19, 12, 10, 19, 9, 10, 20, 12, 11],
127127
],
128128
[
@@ -233,7 +233,7 @@ You can add following settings to model settings
233233
4. `identProp`: Model property representing the primary key. defaults to `id`.
234234
5. `labelProp`: Model property used for display label in chart. defaults to `id`.
235235
6. `indexColor`: Bar Chart color in index view. Falls back to `color`
236-
7. `type`: For future expansion. right now this parameter is ignored.
236+
7. `type`: `line` or `bar`. defaults to `line`.
237237
8. `options`: Options are passed directly to ChartJS instance can be used to customize your Chart as detailed in the [documentation](https://www.chartjs.org/docs/latest/)
238238

239239
## Adding Chart Data

dist/css/field.css

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)