Skip to content

Commit 0319dc8

Browse files
committed
Squashed commit of the following:
commit 6fb9af5 Author: Tom Auty <[email protected]> Date: Fri Jun 17 14:52:46 2016 -0400 Don't extend w/ flow this way commit 8a2ec6b Author: Tom Auty <[email protected]> Date: Fri Jun 17 14:50:00 2016 -0400 Add chart flowtype commit 7d22dd9 Author: Tom Auty <[email protected]> Date: Fri Jun 17 14:42:13 2016 -0400 Fix defaultProp for axisLabelColor commit a1d1cd9 Author: Tom Auty <[email protected]> Date: Fri Jun 17 14:33:51 2016 -0400 Haha maybe if I name it correctly commit f59f6ac Author: Tom Auty <[email protected]> Date: Fri Jun 17 14:30:24 2016 -0400 Example was too confusing... commit 245e366 Author: Tom Auty <[email protected]> Date: Fri Jun 17 14:26:34 2016 -0400 Try to fix this? commit 70136d1 Author: Tom Auty <[email protected]> Date: Fri Jun 17 14:20:10 2016 -0400 Fix example commit ba22ef2 Author: Tom Auty <[email protected]> Date: Fri Jun 17 14:17:53 2016 -0400 Fix all lint errors. Commit dist for now commit a4d56b7 Author: Tom Auty <[email protected]> Date: Fri Jun 17 14:11:17 2016 -0400 Dist and build function commit 76b37a5 Author: Tom Auty <[email protected]> Date: Fri Jun 17 14:06:51 2016 -0400 Move example project to example folder commit 80a0ae4 Author: Tom Auty <[email protected]> Date: Mon Jun 6 18:08:52 2016 -0400 Comment out more unused props commit 1d6ea3f Author: Tom Auty <[email protected]> Date: Mon Jun 6 18:08:07 2016 -0400 Remove linking instructions :) commit 907a3f6 Author: Tom Auty <[email protected]> Date: Mon Jun 6 18:07:05 2016 -0400 Update API chart in readme. Comment out unused props for now commit 62e43b4 Author: Tom Auty <[email protected]> Date: Fri Jun 3 18:22:26 2016 -0400 Somewhat hacky way to prevent the gap btw chart and x-axis commit f355466 Author: Tom Auty <[email protected]> Date: Fri Jun 3 18:03:40 2016 -0400 Working fillColor on lineChart commit 861d2b8 Author: Tom Auty <[email protected]> Date: Fri Jun 3 16:01:17 2016 -0400 Strange line charts. Working pie commit 5383f23 Author: Tom Auty <[email protected]> Date: Fri Jun 3 14:00:59 2016 -0400 Fix flow errors. Pie chart currently broken :( commit 6836d3b Author: Tom Auty <[email protected]> Date: Fri Jun 3 13:43:02 2016 -0400 Many updates to accommodate flat properties commit be9dca9 Author: Tom Auty <[email protected]> Date: Fri Jun 3 13:42:48 2016 -0400 Clean up eslint commit c140a2a Author: Tom Auty <[email protected]> Date: Fri Jun 3 12:21:45 2016 -0400 Fix component import for 0.26 commit d322f29 Author: Tom Auty <[email protected]> Date: Fri Jun 3 12:12:23 2016 -0400 Finalize upgrade commit 3220bc7 Author: Tom Auty <[email protected]> Date: Fri Jun 3 12:11:46 2016 -0400 Upgrade to RN 0.26 commit f8d7830 Author: Tom Auty <[email protected]> Date: Sat Apr 30 13:50:05 2016 -0400 Use the 'Wedge' component for circle construction. Currently not working 100% commit a8a6403 Merge: a129039 6ca1ff8 Author: Tom Auty <[email protected]> Date: Fri Apr 29 17:32:06 2016 -0400 Merge pull request #69 from Dyscrete/2.0 Added MIT License commit 6ca1ff8 Author: Sam <[email protected]> Date: Fri Apr 29 14:30:23 2016 -0700 Added MIT License commit a129039 Author: Tom Auty <[email protected]> Date: Wed Apr 27 14:24:49 2016 -0400 Static x and y axis heights for Android. Use onLayout vs measure commit 61d9fe2 Author: Tom Auty <[email protected]> Date: Tue Apr 26 16:58:01 2016 -0400 Fix potential crashes as a result of no data commit b2c7dde Author: Tom Auty <[email protected]> Date: Tue Apr 26 16:32:11 2016 -0400 Support dataPointColor, dataPointFillColor commit 99f1693 Author: Tom Auty <[email protected]> Date: Tue Apr 26 16:21:33 2016 -0400 showDataPoint and dataPointRadius support commit 171e346 Author: Tom Auty <[email protected]> Date: Tue Apr 26 14:20:55 2016 -0400 Add touch event to onDataPointPress commit 6508349 Author: Tom Auty <[email protected]> Date: Tue Apr 26 14:20:06 2016 -0400 onDataPointPress touch handler for bar chart commit 375277e Author: Tom Auty <[email protected]> Date: Tue Apr 26 14:04:35 2016 -0400 boolean -> bool :) commit 679d92f Author: Tom Auty <[email protected]> Date: Tue Apr 26 14:02:00 2016 -0400 Fix all eslint errors :) commit 2ec90d7 Author: Tom Auty <[email protected]> Date: Tue Apr 26 13:51:36 2016 -0400 Fix easy eslint problems commit 61be78e Author: Tom Auty <[email protected]> Date: Tue Apr 26 13:27:55 2016 -0400 Support really small gridLineWidth using hairlineWidth commit faf5834 Author: Tom Auty <[email protected]> Date: Tue Apr 26 13:18:35 2016 -0400 Fix over-rendering grid lines commit 7ab4bd3 Author: Tom Auty <[email protected]> Date: Tue Apr 26 12:56:33 2016 -0400 Fix crash for pie chart. Working now :) commit aef1279 Author: Tom Auty <[email protected]> Date: Tue Apr 26 11:00:39 2016 -0400 Wrap pie in touchable commit cc0ffcf Author: Tom Auty <[email protected]> Date: Tue Apr 26 10:10:58 2016 -0400 Pie Chart MVP (crashes on init, hehe) commit 55ab1bb Author: Tom Auty <[email protected]> Date: Mon Apr 25 17:58:51 2016 -0400 Remove some deprecated stuff. commit fa94b05 Author: Tom Auty <[email protected]> Date: Mon Apr 25 17:58:36 2016 -0400 Updates with a table of properties commit 3bbecc7 Author: Tom Auty <[email protected]> Date: Mon Apr 25 17:43:36 2016 -0400 Copy README.md from master commit 746137e Author: Tom Auty <[email protected]> Date: Mon Apr 25 17:36:37 2016 -0400 Support hide grid lines props commit e6cd991 Author: Tom Auty <[email protected]> Date: Mon Apr 25 17:33:24 2016 -0400 Draw Grid commit d8dd3ac Author: Tom Auty <[email protected]> Date: Mon Apr 25 16:55:04 2016 -0400 Remove checks for equal min/max bound. We can reliably use gridSteps to create grids now commit ff4813d Author: Tom Auty <[email protected]> Date: Mon Apr 25 16:54:02 2016 -0400 Terrible gridlines commit 6093589 Author: Tom Auty <[email protected]> Date: Mon Apr 25 16:27:34 2016 -0400 Support axisLabelColor commit d5d792c Author: Tom Auty <[email protected]> Date: Mon Apr 25 16:14:53 2016 -0400 Misused fillColor commit dbbc32c Author: Tom Auty <[email protected]> Date: Mon Apr 25 16:03:32 2016 -0400 Vaguely animated charts... commit 2ca30ca Author: Tom Auty <[email protected]> Date: Mon Apr 25 15:08:26 2016 -0400 Fix for showXAxisLabels commit b719963 Author: Tom Auty <[email protected]> Date: Mon Apr 25 15:00:05 2016 -0400 Use ART for drawing a super basic line chart commit 05c42d8 Author: Tom Auty <[email protected]> Date: Mon Apr 25 14:40:42 2016 -0400 Move LayoutAnimation config to container component. PropType readability commit 934683c Merge: 15c9d96 144d2b0 Author: Tom Auty <[email protected]> Date: Mon Apr 25 14:21:35 2016 -0400 Merge branch '2.0' of github.com:tomauty/react-native-chart into 2.0 commit 15c9d96 Author: Tom Auty <[email protected]> Date: Mon Apr 25 14:21:23 2016 -0400 Basic working bar chart commit 144d2b0 Author: Tom Auty <[email protected]> Date: Mon Apr 25 14:21:23 2016 -0400 Basic working pie chart commit ef74e13 Author: Tom Auty <[email protected]> Date: Mon Apr 25 12:34:39 2016 -0400 Static y-Axis width. Prevents layout flicker and should work for most data points. Optionally provide as propType commit 74ceb0d Author: Tom Auty <[email protected]> Date: Mon Apr 25 12:25:06 2016 -0400 Fix axis alignment for bar chart. Move computeBounds to Chart fn commit 07d5e23 Author: Tom Auty <[email protected]> Date: Mon Apr 25 11:52:01 2016 -0400 Remove 'convertedProps' commit 6555659 Author: Tom Auty <[email protected]> Date: Mon Apr 25 11:50:12 2016 -0400 Support yAxisTransform commit 6a09940 Author: Tom Auty <[email protected]> Date: Mon Apr 25 11:42:39 2016 -0400 Compute bounds with and without tightBounds on yAxis commit f9b65d5 Author: Tom Auty <[email protected]> Date: Wed Apr 13 18:05:23 2016 -0400 getRoundNumber for gridStep commit 83a1a7c Author: Tom Auty <[email protected]> Date: Wed Apr 13 18:01:12 2016 -0400 Abstract layout update function. Start on bounds computation commit 6ba2023 Author: Tom Auty <[email protected]> Date: Wed Apr 13 17:17:26 2016 -0400 X and Y axis props supported commit 8dd743e Author: Tom Auty <[email protected]> Date: Wed Apr 13 16:48:16 2016 -0400 Solidify chart layout and axes commit 24cf674 Author: Tom Auty <[email protected]> Date: Wed Apr 13 14:51:17 2016 -0400 init
1 parent a4be236 commit 0319dc8

33 files changed

+2257
-150
lines changed

.babelrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"retainLines": true,
3+
"compact": true,
4+
"comments": false,
5+
"presets": ["react-native"],
6+
"plugins": ["transform-flow-strip-types"],
7+
"sourceMaps": false
8+
}

.buckconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

.eslintrc

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,43 @@
11
{
2-
"parser": "babel-eslint",
3-
"env": {
4-
"browser": true,
5-
"node": true
6-
},
7-
"settings": {
8-
"ecmascript": 6,
9-
"jsx": true
10-
},
11-
"plugins": [
12-
"react",
13-
"react-native"
14-
],
15-
"extends": "airbnb",
16-
"rules": {
17-
"indent": [2, "tab"],
18-
"quote-props": 0,
19-
"max-len": [2, 150, 4, {"ignoreComments": true, "ignoreUrls": true, "ignorePattern": "^\\s*var\\s.+=\\s*require\\s*\\("}],
20-
"strict": 0,
21-
"no-console": 0,
22-
"quotes": 0,
23-
"no-unused-vars": [1, {"args": "after-used", "argsIgnorePattern": "^_"}],
24-
"no-param-reassign": [2, {"props": false}],
25-
"react/jsx-no-bind": [1, { "allowArrowFunctions": true }],
26-
"camelcase": 0,
27-
"no-alert": 0,
28-
"no-underscore-dangle": 0,
29-
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
30-
"react-native/no-unused-styles": 2
31-
}
2+
"parser": "babel-eslint",
3+
"globals": {},
4+
"env": {
5+
"node": true
6+
},
7+
"settings": {
8+
"ecmascript": 6,
9+
"jsx": true
10+
},
11+
"plugins": [
12+
"react",
13+
"react-native",
14+
"flowtype",
15+
"flow-vars"
16+
],
17+
"extends": "airbnb",
18+
"rules": {
19+
"arrow-body-style": [0, "as-needed"],
20+
"camelcase": 0,
21+
"flow-vars/define-flow-type": 1,
22+
"flow-vars/use-flow-type": 1,
23+
"indent": [2, "tab"],
24+
"max-len": [2, 150, 4, {"ignoreComments": true, "ignoreUrls": true, "ignorePattern": "^\\s*var\\s.+=\\s*require\\s*\\("}],
25+
"no-alert": 0,
26+
"no-console": 1,
27+
"no-labels": 0,
28+
"no-param-reassign": [2, {"props": false}],
29+
"no-underscore-dangle": 0,
30+
"no-unused-vars": [1, {"args": "after-used", "argsIgnorePattern": "^_"}],
31+
"no-use-before-define": 0,
32+
"quote-props": 0,
33+
"quotes": 0,
34+
"react-native/no-unused-styles": 1,
35+
"react/jsx-indent": [2, "tab"],
36+
"react/jsx-indent-props": [2, "tab"],
37+
"react/jsx-no-bind": [1, { "allowArrowFunctions": true }],
38+
"react/no-multi-comp": 0,
39+
"react/prefer-stateless-function": 0,
40+
"space-infix-ops": 0,
41+
"strict": 0
42+
}
3243
}

.flowconfig

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
[ignore]
2+
3+
# We fork some components by platform.
4+
.*/*.web.js
5+
.*/*.android.js
6+
7+
# Some modules have their own node_modules with overlap
8+
.*/node_modules/node-haste/.*
9+
10+
# Ugh
11+
.*/node_modules/babel.*
12+
.*/node_modules/babylon.*
13+
.*/node_modules/invariant.*
14+
15+
# Ignore react and fbjs where there are overlaps, but don't ignore
16+
# anything that react-native relies on
17+
.*/node_modules/fbjs/lib/Map.js
18+
.*/node_modules/fbjs/lib/ErrorUtils.js
19+
20+
# Flow has a built-in definition for the 'react' module which we prefer to use
21+
# over the currently-untyped source
22+
.*/node_modules/react/react.js
23+
.*/node_modules/react/lib/React.js
24+
.*/node_modules/react/lib/ReactDOM.js
25+
26+
.*/__mocks__/.*
27+
.*/__tests__/.*
28+
29+
.*/commoner/test/source/widget/share.js
30+
31+
# Ignore commoner tests
32+
.*/node_modules/commoner/test/.*
33+
34+
# See https://github.com/facebook/flow/issues/442
35+
.*/react-tools/node_modules/commoner/lib/reader.js
36+
37+
# Ignore jest
38+
.*/node_modules/jest-cli/.*
39+
40+
# Ignore Website
41+
.*/website/.*
42+
43+
# Ignore generators
44+
.*/local-cli/generator.*
45+
46+
# Ignore BUCK generated folders
47+
.*\.buckd/
48+
49+
.*/node_modules/is-my-json-valid/test/.*\.json
50+
.*/node_modules/iconv-lite/encodings/tables/.*\.json
51+
.*/node_modules/y18n/test/.*\.json
52+
.*/node_modules/spdx-license-ids/spdx-license-ids.json
53+
.*/node_modules/spdx-exceptions/index.json
54+
.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
55+
.*/node_modules/resolve/lib/core.json
56+
.*/node_modules/jsonparse/samplejson/.*\.json
57+
.*/node_modules/json5/test/.*\.json
58+
.*/node_modules/ua-parser-js/test/.*\.json
59+
.*/node_modules/builtin-modules/builtin-modules.json
60+
.*/node_modules/binary-extensions/binary-extensions.json
61+
.*/node_modules/url-regex/tlds.json
62+
.*/node_modules/joi/.*\.json
63+
.*/node_modules/isemail/.*\.json
64+
.*/node_modules/tr46/.*\.json
65+
66+
67+
[include]
68+
react-native-chart.flow.js
69+
70+
[libs]
71+
node_modules/react-native/Libraries/react-native/react-native-interface.js
72+
node_modules/react-native/flow
73+
flow/
74+
75+
[options]
76+
module.system=haste
77+
78+
esproposal.class_static_fields=enable
79+
esproposal.class_instance_fields=enable
80+
81+
munge_underscores=true
82+
83+
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
84+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
85+
86+
suppress_type=$FlowIssue
87+
suppress_type=$FlowFixMe
88+
suppress_type=$FixMe
89+
90+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
91+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
92+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
93+
94+
[version]
95+
0.25.0

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
15
# Xcode
26
#
37
build/
@@ -28,4 +32,15 @@ DerivedData
2832
/node_modules/
2933
.DS_Store
3034
lib
35+
project.xcworkspace
36+
37+
# Android/IJ
38+
#
39+
.idea
40+
.gradle
41+
local.properties
42+
43+
# node.js
44+
#
45+
node_modules/
3146
npm-debug.log

.npmignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
/Example
2-
index.js
31
screenshots

.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

LICENSE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-

README.md

Lines changed: 44 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,12 @@ react-native-chart is a simple module for adding line charts, area charts, or ba
1010
## Getting Started
1111
[![NPM](https://nodei.co/npm/react-native-chart.png?downloads=true)](https://nodei.co/npm/react-native-chart/)
1212

13-
1. `npm install react-native-chart --save`
14-
2. I recommend using [rnpm](https://github.com/rnpm/rnpm) for linking.
15-
16-
2a. `npm install -g rnpm`
17-
18-
2b. `rnpm link`
19-
20-
If you'd rather not use `rnpm`, you can link the library as described [here](https://facebook.github.io/react-native/docs/linking-libraries-ios.html).
13+
1. `npm i react-native-chart --save`
2114

2215
## Usage
2316
```javascript
2417
import React, { StyleSheet, View, Component } from 'react-native';
25-
import RNChart from 'react-native-chart';
18+
import Chart from 'react-native-chart';
2619

2720
const styles = StyleSheet.create({
2821
container: {
@@ -32,43 +25,27 @@ const styles = StyleSheet.create({
3225
backgroundColor: 'white',
3326
},
3427
chart: {
35-
position: 'absolute',
36-
top: 16,
37-
left: 4,
38-
bottom: 4,
39-
right: 16,
40-
}
28+
width: 200,
29+
height: 200,
30+
},
4131
});
4232

43-
const chartData = [
44-
{
45-
name: 'BarChart',
46-
type: 'bar',
47-
color:'purple',
48-
widthPercent: 0.6,
49-
data: [30, 1, 1, 2, 3, 5, 21, 13, 21, 34, 55, 30],
50-
},
51-
{
52-
name: 'LineChart',
53-
color: 'gray',
54-
lineWidth: 2,
55-
highlightIndices: [1, 2], // The data points at indexes 1 and 2 will be orange
56-
highlightColor: 'orange',
57-
showDataPoint: true,
58-
data: [10, 12, 14, 25, 31, 52, 41, 31, 52, 66, 22, 11],
59-
}
33+
const data = [
34+
[0, 1],
35+
[1, 3],
36+
[3, 7],
37+
[4, 9],
6038
];
6139

62-
const xLabels = ['0','1','2','3','4','5','6','7','8','9','10','11'];
63-
6440
class SimpleChart extends Component {
6541
render() {
6642
return (
6743
<View style={styles.container}>
68-
<RNChart style={styles.chart}
69-
chartData={chartData}
44+
<Chart
45+
style={styles.chart}
46+
data={data}
7047
verticalGridStep={5}
71-
xLabels={xLabels}
48+
type="line"
7249
/>
7350
</View>
7451
);
@@ -77,58 +54,37 @@ class SimpleChart extends Component {
7754

7855
```
7956
## Properties
80-
All properties are optional otherwise noted
81-
### General
82-
- **`chartData`** _(ObjectArray)_ - : one nested block produces one type of chart
83-
- **`data`** - _(NumberArray)_ - Y axis values / **Required**
84-
- **`name`** - _(String)_ - name of the plot
85-
- **`type`** - _(String)_ - "line" or "bar" / Default: line"
86-
- **`fillColor`** - _(String/Color)_ - Line chart only: area fill color / If not specified, the line will not be filled
87-
- **`lineWidth`** - _(Float)_ - Line chart only: line width / Default: 1.0
88-
- **`widthPercent`** - _(Float)_ - Bar chart only: [0 - 1.0], 0.1 means very skinny, 1.0 means bars touch each other / Default: 0.5
89-
- **`showDataPoint`** - _(Boolean)_ - show or hide the data points / Default: false
90-
- **`dataPointColor`** - _(String/Color)_ - outline color of the data point / Default: blue
91-
- **`dataPointFillColor`** - _(String/Color)_ - fill color of the data point / Default: blue
92-
- **`dataPointRadius`** - _(Float)_ - the radius of the data point / Default: 1.0
93-
- **`cornerRadius`** - _(Float)_ corner radius of the bars in a bar chart / Default: 1.0 / If 0, it will be completely rectangular.
94-
- **`highlightColor`** - _(String/Color)_ - the color of the highlighted data points at the highlight indices. this will override `dataPointColor` and `dataPointFillColor`.
95-
- **`highlightIndices`** - _(NumberArray)_ - the indices to apply the `highlightColor`
96-
- **`highlightRadius`** - _(Float)_ - the radius of a highlighted data point / Default: 1.0
97-
- **`sliceColors`** _(Array)_ - array of colors for the pie chart slices. matched by index with the `chartData.data` array. if fewer specified, remaining slices will be blue for now. **Required for pie chart**
98-
99-
100-
- **`animationDuration`** _(Float)_ - duration of the animation in seconds / Default: 0.3
101-
- **`axisColor`** _(String/Color)_ - color of the X and Y axes / Default: lightgray
102-
- **`axisLineWidth`** _(Float)_ - width of the axis line / Default: 1
103-
- **`axisTitleColor`** _(String/Color)_ - color of the title of the axes / Default: gray
104-
- **`axisTitleFontSize`** _(Integer)_ - font size of axis titles / Default: 10
105-
- **`chartTitle`** _(String)_ - title of the chart
106-
- **`chartTitleColor`** _(String/Color)_ - color of the chart title / Default: gray
107-
- **`gridColor`** _(String/Color)_ - color of the grid / Default: lightgray
108-
- **`gridLineWidth`** _(Float)_ - width of the grid line / Default: 0.5
109-
- **`hideHorizontalGridLines`** _(Boolean)_ - hides the horizontal grid lines when showGrid is true / Default: false
110-
- **`hideVerticalGridLines`** _(Boolean)_ - hides the vertical grid lines when showGrid is true / Default: false
111-
- **`labelFontSize`** _(Integer)_ - font size of axis labels / Default: 10
112-
- **`labelTextColor`** _(String/Color)_ - text color of axis labels / Default: gray
113-
- **`showAxis`** _(Boolean)_ - show or hide axis / Default: true
114-
- **`showGrid`** _(Boolean)_ - show or hide grid / Default: true
115-
- **`showXAxisLabels`** _(Boolean)_ - show or hide axis labels for the X axis / Default: true
116-
- **`showYAxisLabels`** _(Boolean)_ - show or hide axis labels for the Y axis / Default: true
117-
- **`tightBounds`** _(Boolean)_ - constrict Y axis to min/max of values instead of max/minning with 0 / Default: false
118-
- **`verticalGridStep`** _(Integer)_ - number of Y axis grids / Default: 3
119-
- **`xAxisTitle`** _(String)_ - Title for the x-axis
120-
- **`xLabels`** _(StringArray)_ - array of all X axis label strings. This determines the X-axis grid as well. Need to match the number of input data in `chartData` / **Required**
121-
- **`yAxisTitle`** _(String)_ - Title for the y-axis
122-
123-
124-
## Known Issues / TODO
125-
- Needs touch support
126-
- Needs legend
127-
- Stack Bar Chart
128-
- Multi Line Chart
129-
- Scatter/Bubble chart
130-
- Testing w/ Travis CI
13157

58+
| Property | Type | Description | Required | Default |
59+
| ----------------------- | ------------------------- | --------------------------------------------------------- | -------- | --------------------- |
60+
| data | Array< [number, number] > | An array of [x, y] pairs. | **Yes** | |
61+
| type | string | pie/bar/line | **Yes** | bar |
62+
| color | string | Color of bars/line in line chart | No | #4DC4E6 |
63+
| cornerRadius | number | Corner radius of bars in bar chart | No | 0 |
64+
| fillColor | string | Fill area color in line chart | No | |
65+
| dataPointColor | string | Stroke color for line chart data point | No | |
66+
| dataPointFillColor | string | Fill color for line chart data point | No | |
67+
| dataPointRadius | number | Radius of the data point | No | 3 |
68+
| lineWidth | number | Width of line chart line | No | 1 |
69+
| showDataPoint | boolean | Show data points on line chart | No | false |
70+
| sliceColors | Array < string > | Array of colors for pie chart slices | **Yes** | [ < random colors > ] |
71+
| axisColor | string | Color of axis lines | No | #333333 |
72+
| axisLabelColor | string | Color of axis test | No | #333333 |
73+
| axisLineWidth | number | Width of axis lines | No | 1 |
74+
| gridColor | string | Color of grid lines | No | #333333 |
75+
| gridLineWidth | number | Width of grid lines | No | 0.5 |
76+
| hideHorizontalGridLines | boolean | Hide grid lines going from LTR | No | false |
77+
| hideVerticalGridLines | boolean | Hide grid lines going up -> down | No | false |
78+
| showAxis | boolean | Show the X and Y axes | No | true |
79+
| showGrid | boolean | Show the grid | No | true |
80+
| showXAxisLabels | boolean | Show X-Axis labels | No | true |
81+
| showYAxisLabels | boolean | Show Y-Axis labels | No | true |
82+
| style | object | Style on the container | No | {} |
83+
| tightBounds | boolean | Tighten min and max bounds strictly to min/max in dataset | No | false |
84+
| verticalGridStep | number | How many vertical grid lines to show | No | 4 |
85+
| xAxisHeight | number | Height of X-axis container | No | 20 |
86+
| yAxisTransform | Function | Transform data point to y-axis label | No | (_) => _ |
87+
| yAxisWidth | number | Width of the Y-axis container | No | 30 |
13288
## Info/Support
13389

13490
Work prior to repo transfer on Feb 1, 2015 was the work of Hyun Cho @ OneFold.

0 commit comments

Comments
 (0)