victory
Version:
Data viz for React
48 lines (31 loc) • 1.28 kB
Markdown
1. Add Victory to your project:
```sh
$ npm install victory --save
```
2. Add your first Victory component:
```js
import React, { Component } from "react";
import { render } from "react-dom";
import { VictoryPie } from "victory";
class PieChart extends Component {
render() {
return <VictoryPie />;
}
}
render(<PieChart />, document.getElementById("app"));
```
3. `VictoryPie` component will be rendered, and you should see:
<p align="center">
<img align="center" width="471" alt="pie" src="https://cloud.githubusercontent.com/assets/3719995/20915779/b51e3652-bb3c-11e6-8243-6e7521a59115.png">
</p>
For detailed documentation and examples please see [Victory Documentation](https://formidable.com/open-source/victory)
Projects using Victory should also depend on [React][] and [prop-types][].
Want to use `Victory` with React Native? Check out [victory-native](https://github.com/FormidableLabs/victory-native)
Victory Native shares most of its code with Victory, and has a nearly identical api!
[ ]: https://facebook.github.io/react/
[ ]: https://github.com/reactjs/prop-types