Incorrect layered-charts , when the values in second chart is zero.
See original GitHub issueWhat is the problem?
The scale for chart one and chart 2 differs when the maximum value in both the data sets are different or When second area chart has maximum value like 1, 5 etc. –>
What platform?
- Android
React Native version: 0.55.2
Code to reproduce
render() {
const data0 = [ 50, 10, 40, 95, 0, 0, 85, 91, 35, 53, 0, 24, 50, 0, 0 ]
const data1 = [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 ]
return (
<View style={ { flexDirection: 'row', height: 200 } }>
<AreaChart
style={ { flex: 1 } }
data={ data0 }
svg={{ fill: 'rgba(134, 65, 244, 0.5)' }}
contentInset={ { top: 20, bottom: 0 } }
curve={ shape.curveNatural }
ticks={1}
>
</AreaChart>
<AreaChart
style={ StyleSheet.absoluteFill }
data={ data1 }
svg={{ fill: 'rgba(34, 128, 176, 0.5)' }}
contentInset={ { top: 20, bottom: 0 } }
curve={ shape.curveNatural }
ticks={1}
/>
</View>
)
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Excel Charts Displaying Incorrect Values on Vertical Axis
I am creating charts in Excel 2010; when I select data and create the chart, the vertical axis amounts do not agree with...
Read more >Keeping specific Y-Axis order/sort in Altair for Layered Charts
This is a known bug in sorting + layering within Altair/Vega-Lite. It has been fixed upstream in Vega-Lite (see vega-lite#2177), ...
Read more >The Effects of Chart Size and Layering on the Graphical ...
The first graph is a filled line chart — a line chart with the area between the data value on the line and...
Read more >st.altair_chart - Streamlit Docs
You can do this by creating layered charts, which let you overlay two different charts on top of each other. The idea is...
Read more >Multi-View Composition / UW Interactive Data Lab | Observable
However, this is pretty misleading as it aggregates the measurements ... By default, layered charts use a shared domain: the values for the ......
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
Finally, I fixed it by removing
contentInset={{ top: 40, bottom: 20 }}
, addingyMin={0}
And using custom thecy
property of the decorator (react-native-svg.Circle
) in case of value 0 to avoid the decorator to be cut.Thanks, @JesperLekland for the response. yMin didn’t solve it for me. I think that its because of this line
contentInset={{ top: 40, bottom: 20 }}
I must set the bottom to avoid the decorator to be cut off. Do you have any solution for it?