Skip to content

Commit

Permalink
Renamed to react-chart.js. Updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonnold committed Apr 23, 2020
1 parent dc8c721 commit 0b18c32
Show file tree
Hide file tree
Showing 28 changed files with 1,639 additions and 326 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# react-chart-js
# @jhonnold/react-chart.js

[![NPM](https://img.shields.io/npm/v/@jhonnold/react-chart-js.svg)](https://www.npmjs.com/package/@jhonnold/react-chart-js)
[![downloads](https://img.shields.io/npm/dm/@jhonnold/react-chart-js.svg)](https://npm-stat.com/charts.html?package=@jhonnold/react-chart-js&from=2020-01-01)
[![build status](https://img.shields.io/travis/jhonnold/react-chart-js.svg?branch=master)](https://travis-ci.org/jhonnold/react-chart-js)
[![NPM](https://img.shields.io/npm/v/@jhonnold/react-chart.js.svg)](https://www.npmjs.com/package/@jhonnold/react-chart.js)
[![downloads](https://img.shields.io/npm/dm/@jhonnold/react-chart.js.svg)](https://npm-stat.com/charts.html?package=@jhonnold/react-chart.js&from=2020-01-01)
[![build status](https://img.shields.io/travis/jhonnold/react-chart.js.svg?branch=master)](https://travis-ci.org/jhonnold/react-chart.js)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](http://opensource.org/licenses/MIT)

> React Components for the popular [Chart.JS](https://github.com/chartjs/Chart.js) libary
> React Components for the popular [Chart.js](https://github.com/chartjs/Chart.js) libary
## Install

```bash
npm install --save @jhonnold/react-chart-js
npm install --save @jhonnold/react-chart.js
```

## Getting Started

```tsx
import { BarChart } from '@jhonnold/react-chart-js';
import { BarChart } from '@jhonnold/react-chart.js';

<BarChart data={...} />
```
Expand All @@ -25,7 +25,7 @@ import { BarChart } from '@jhonnold/react-chart-js';

Direct examples of each chart type can be found in `examples`.

Live Examples: [Github Pages](https://jhonnold.github.io/react-chart-js/)
Live Examples: [Github Pages](https://jhonnold.github.io/react-chart.js/)

### Components
```tsx
Expand All @@ -39,7 +39,7 @@ import ChartComponent, {
BubbleChart,
PieChart,
ScatterChart,
} from '@jhonnold/react-chart-js';
} from '@jhonnold/react-chart.js';
```

## Configure
Expand Down Expand Up @@ -85,12 +85,12 @@ If true, will tear down and redraw chart on all updates
#### type
Type: `'line' | 'bar' | 'horizontalBar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble' | 'pie' | 'scatter'`

Chart.JS chart type (required only on ChartComponent)
Chart.js chart type (required only on ChartComponent)

#### data (required)
Type: `((canvas: HTMLCanvasElement | null): Chart.ChartData) | Chart.ChartData`

The data object that is passed into the Chart.JS chart ([more info](https://www.chartjs.org/docs/latest/getting-started/)).
The data object that is passed into the Chart.js chart ([more info](https://www.chartjs.org/docs/latest/getting-started/)).

This can also be a function, that receives a canvas element and returns the data object.
```tsx
Expand All @@ -114,13 +114,13 @@ const data = canvas => {
#### options
Type: `Chart.ChartOptions`

The options object that is passed into the Chart.JS chart ([more info](https://www.chartjs.org/docs/latest/general/options.html))
The options object that is passed into the Chart.js chart ([more info](https://www.chartjs.org/docs/latest/general/options.html))


#### plugins
Type: `Chart.PluginServiceRegistrationOptions[]`

The plugins array that is passed into the Chart.JS chart ([more info](https://www.chartjs.org/docs/latest/developers/plugins.html))
The plugins array that is passed into the Chart.js chart ([more info](https://www.chartjs.org/docs/latest/developers/plugins.html))


## License
Expand Down
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This example was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

It is linked to the react-chart-js package in the parent directory for development purposes.
It is linked to the react-chart.js package in the parent directory for development purposes.

You can run `npm install` and then `npm start` to test your package.
Loading

0 comments on commit 0b18c32

Please sign in to comment.