Last active
April 13, 2017 14:17
-
-
Save mvbattan/3f0d76595014432c11842261eea90000 to your computer and use it in GitHub Desktop.
index.js - v3
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
import SeparatorsLayer from './SeparatorsLayer'; | |
import PointsPath from './PointsPath'; | |
import { Point } from './pointUtils'; | |
import { startingPoint, vectorTransform } from './Scaler'; | |
const lightBlue = '#40C4FE'; | |
const green = '#53E69D'; | |
const lightBluePoints = [Point(0, 0), Point(1, 2), Point(2, 3), Point(3, 6), Point(5, 6)]; | |
const greenPoints = [Point(0, 2), Point(3, 4), Point(4, 0), Point(5, 10)]; | |
const MAX_VALUE = 10; | |
const Y_LEVELS = 5; | |
const X_LEVELS = 5; | |
export default class lineChartExample extends Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<SeparatorsLayer topValue={MAX_VALUE} separators={Y_LEVELS} height={100}> | |
<PointsPath | |
color={lightBlue} | |
pointList={lightBluePoints.map( | |
(point) => vectorTransform(point, MAX_VALUE, X_LEVELS) | |
)} | |
opacity={0.5} | |
startingPoint={startingPoint} | |
/> | |
<PointsPath | |
color={green} | |
pointList={greenPoints.map( | |
(point) => vectorTransform(point, MAX_VALUE, X_LEVELS) | |
)} | |
opacity={0.5} | |
startingPoint={startingPoint} | |
/> | |
</SeparatorsLayer> | |
</View> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment