Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const data = {
| withDots | boolean | Show dots on the line - default: True |
| withShadow | boolean | Show shadow for line - default: True |
| withInnerLines | boolean | Show inner dashed lines - default: True |
| withOuterLines | boolean | Show outer dashed lines - default: True |
| chartConfig | Object | Configuration object for the chart, see example config object above |
|decorator | Function | This function takes a [whole bunch](https://github.com/indiespirit/react-native-chart-kit/blob/master/src/line-chart.js#L266) of stuff and can render extra elements, such as data point info or additional markup. |
|onDataPointClick| Function| Callback that takes `{value, dataset, getColor}`|
Expand Down
55 changes: 31 additions & 24 deletions src/line-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ class LineChart extends AbstractChart {
withShadow = true,
withDots = true,
withInnerLines = true,
withOuterLines = true,
style = {},
decorator,
onDataPointClick
Expand Down Expand Up @@ -254,18 +255,21 @@ class LineChart extends AbstractChart {
fill="url(#backgroundGradient)"
/>
<G>
{withInnerLines
? this.renderHorizontalLines({
...config,
count: 4,
paddingTop,
paddingRight
})
: this.renderHorizontalLine({
...config,
paddingTop,
paddingRight
})}
{withInnerLines
? this.renderHorizontalLines({
...config,
count: 4,
paddingTop,
paddingRight
})
: withOuterLines
? this.renderHorizontalLine({
...config,
paddingTop,
paddingRight
})
: null
}
</G>
<G>
{this.renderHorizontalLabels({
Expand All @@ -277,18 +281,21 @@ class LineChart extends AbstractChart {
})}
</G>
<G>
{withInnerLines
? this.renderVerticalLines({
...config,
data: data.datasets[0].data,
paddingTop,
paddingRight
})
: this.renderVerticalLine({
...config,
paddingTop,
paddingRight
})}
{withInnerLines
? this.renderVerticalLines({
...config,
data: data.datasets[0].data,
paddingTop,
paddingRight
})
: withOuterLines
? this.renderVerticalLine({
...config,
paddingTop,
paddingRight
})
: null
}
</G>
<G>
{this.renderVerticalLabels({
Expand Down