-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #334 from dcos-labs/ph/feat/add-chart-component
DCOS-54458 feat(chart): add chart component
- Loading branch information
Showing
9 changed files
with
177 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Chart | ||
|
||
Exposing [react-chartist](https://github.com/fraserxu/react-chartist) | ||
|
||
## LineChart | ||
|
||
The Linechart is rendering a single line on a graph based on provided data. the data is build up as a `key: value` object. The `key` is representing the label (e.g. a year) and the `value` is representing the datum (e.g. number of spacex launches) the component will generate a graph out of the information. | ||
|
||
The LineChart is exposing the following props | ||
```TS | ||
{ | ||
data: { | ||
[label: string]: number; | ||
}; | ||
type: string; | ||
} | ||
``` | ||
|
||
And an implementation example looks like this: | ||
```JSX | ||
<LineChart | ||
data={{ | ||
2006: 1, | ||
2007: 1, | ||
2008: 2, | ||
2009: 1, | ||
2010: 2, | ||
2012: 2, | ||
2013: 3, | ||
2014: 6, | ||
2015: 6, | ||
2016: 8, | ||
2017: 18, | ||
2018: 21, | ||
2019: 4 | ||
}} | ||
/> | ||
``` |
Oops, something went wrong.