Skip to content

Commit

Permalink
update stories
Browse files Browse the repository at this point in the history
  • Loading branch information
JesperLekland committed Feb 18, 2018
1 parent a6c121a commit 51b77df
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
7 changes: 4 additions & 3 deletions storybook/stories/area-stack/with-y-axis.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react'
import { StackedAreaChart } from '../../../src/index'
import { StackedAreaChart, YAxis } from 'react-native-svg-charts'
import * as shape from 'd3-shape'
import { View } from 'react-native'
import YAxis from '../../../src/y-axis'

class AreaStackWithAxisExample extends React.PureComponent {

Expand Down Expand Up @@ -54,14 +53,16 @@ class AreaStackWithAxisExample extends React.PureComponent {
{ ...this.props }
/>
<YAxis
style={ { position: 'absolute', top: 0, bottom: 0, transform: [ { translateY: -5 } ] } }
style={ { position: 'absolute', top: 0, bottom: 0 }}
data={ StackedAreaChart.extractDataPoints(data, keys) }
contentInset={ { top: 10, bottom: 10 } }
svg={ {
fontSize: 8,
fill: 'white',
stroke: 'black',
strokeWidth: 0.1,
alignmentBaseline: 'baseline',
baselineShift: '3',
} }
/>
</View>
Expand Down
3 changes: 2 additions & 1 deletion storybook/stories/extras.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ class ExtrasExample extends React.PureComponent {
/>
<Text
x={ 75 / 2 }
dy={20}
alignmentBaseline={'middle'}
textAnchor={ 'middle' }
y={ 10 }
stroke={ 'rgb(134, 65, 244)' }
>
{ `${data[5]}ºC` }
Expand Down
15 changes: 8 additions & 7 deletions storybook/stories/grid-min-max.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ class GridMinMaxExample extends React.PureComponent {

return (
<AreaChart
style={ { height: 200 } }
data={ data }
style={{ height: 200 }}
data={data}
svg={{ fill: 'rgba(134, 65, 244, 0.2)' }}
curve={shape.curveNatural}
gridMax={500}
gridMin={-500}
extras={[
({ line }) => (
<Path
key={'line '}
d={line}
stroke={'rgb(134, 65, 244)'}
fill={'none'}/>
<Path
key={'line '}
d={line}
stroke={'rgb(134, 65, 244)'}
fill={'none'}
/>
),
]}
/>
Expand Down
2 changes: 1 addition & 1 deletion storybook/stories/pie-chart/with-labels.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import PieChart from '../../../src/pie-chart'
import { PieChart } from 'react-native-svg-charts'
import { Circle, G, Line } from 'react-native-svg'

class PieChartWithLabelExample extends React.PureComponent {
Expand Down

0 comments on commit 51b77df

Please sign in to comment.