Vertical lines don't show
See original GitHub issueVERTICAL doesn’t show vertical lines. HORIZONTAL works. BOTH shows just horizontal lines.
Vertical line is shown only at x=0. Reproducible example:
import React from 'react'
import { View, StyleSheet } from 'react-native';
import { Path } from 'react-native-svg'
import { AreaChart, Grid, Line, XAxis, YAxis } from 'react-native-svg-charts'
import * as shape from 'd3-shape'
class AreaChartExample extends React.PureComponent {
render() {
const data = [ 50, 10, 40, 95, -4, -24, 85, 91, 35, 53, -53, 24, 50, -20, -80 ]
// const data2 = Array(data.length).fill(4);
const Outline = ({ line }) => (
<Path
key={'line'}
d={line}
stroke={'rgb(134, 65, 244)'}
fill={'none'}
/>
)
const xAxisHeight = 30
const verticalContentInset = { top: 10, bottom: 10 }
const axesSvg = { fontSize: 10, fill: 'grey', fontFamily: "Verdana" };
return (
<View
style={ {
height: 200,
padding: 20,
margin: 20,
flexDirection: 'row',
borderRadius: 5,
shadowOffset: {width: 0, height: 2},
shadowRadius: 5,
shadowOpacity: 0.3,
} }
>
<YAxis
data={data}
style={ { marginBottom: xAxisHeight } }
contentInset={ verticalContentInset }
svg={axesSvg}
/>
<View style={{ flex: 1, marginLeft: 10 }}>
<AreaChart
style={{ flex: 1 }}
// style={ StyleSheet.absoluteFill }
data={data}
contentInset={ verticalContentInset }
curve={shape.curveNatural}
svg={{ fill: 'rgba(134, 65, 244, 0.2)' }}
>
<Grid
svg={{strokeDasharray: [6, 8]}}
/>
<Grid
svg={{strokeDasharray: [6, 8]}}
direction={ Grid.Direction.VERTICAL }
belowChart={ false }
/>
<Outline/>
</AreaChart>
<XAxis
style={{ marginHorizontal: -10, height: xAxisHeight }}
data={data}
formatLabel={(value, index) => index}
contentInset={{ left: 10, right: 10 }}
svg={axesSvg}
/>
</View>
</View>
)
}
}
export default AreaChartExample
Same issue as here: https://github.com/JesperLekland/react-native-svg-charts/issues/249
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:5
Top Results From Across the Web
How To Fix The Vertical Lines On Your Monitor Screen?
Generally, this issue occurs when different components of the connection channel between the monitor and PC do not function properly. Loosely ...
Read more >Fix Vertical Lines on Laptop Screen. Easily! - Driver Easy
If you ever have the vertical line on laptop screen issue, don't worry. ... Right-click on the empty area of your desktop and...
Read more >Vertical lines on screen - Microsoft Community
To narrow down the issue, kindly go to BIOS and check to see if the vertical lines are persists or not. If they...
Read more >What Are the Causes of Fine Vertical Lines When Printing Low ...
Printer cleanliness and ink supply problems can cause fine vertical lines to appear in printed images; however, low resolution prints present additional ...
Read more >Vertical line does not show in geom_boxplot - Stack Overflow
In this answer: I've created a much bigger sample; I'm using yearmonth from tsibble for simplicity; I've solved the issue with the vertical...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Struggled with this issue for a while, here’s my solution. I used xPositionModifier to place the grid line in the centre of each bar instead of bordering it.
Still an issue two years on