Comments (2)
Same here, any updates?
I'm trying to have bars for individual values (primary data) and a line for accumulative values (secondary data).
The line is not following secondary Y-axis scale :(
const data = [{value:200},{value:125},{value:175},{value:50}],
accData = [{value:200},{value:325},{value:500},{value:550}];
...
<BarChart
frontColor={greenColor}
data={data}
maxValue={600}
showLine
lineConfig={{ /* for hiding the line for primary data */
startIndex: 0,
endIndex: 0,
hideDataPoints: true,
isSecondary: false
}}
lineConfig2={{
color: blueColor,
thickness: 3,
hideDataPoints: true,
isSecondary: true
}}
lineData2={accData}
secondaryYAxis={{
maxValue: accData[accData.length-1].value + 10
}}
/>
from react-native-gifted-charts.
Hi @ilyabreev 👋
Secondary Bars can now be achieved by setting isSecondary: true
inside the data array objects. See #828
I have removed the secondaryData
prop from Bar charts, as it was useless.
This is available from versions 1.4.35
onwards. Please use the latest version of the library.
@gloriamannok 👋
Can you try again in the latest version of the library? I have made fixes and refactors related to secondary data and the secondary Y-axis.
Also, you don't have to use the hack using 2 lines and 2 lineConfigs. Just have one lineConfig
, and inside this set isSecondary: true
. It will show the line from the lineData
prop. If the lineData
prop is not provided, then it renders the line from the data
prop.
from react-native-gifted-charts.
Related Issues (20)
- In the LineChart, the pointer line is only displayed in the positive area (above 0). HOT 1
- PieChart's "sectionAutoFocus" and "focusOnPress" don't work in Web HOT 6
- overlapping labels HOT 2
- Question about styling last value of chart in Y axis HOT 3
- Can we give intervals and range on yAxis values? HOT 3
- Can we get total length of yAxis values? HOT 1
- app crashes with interpolateMissingValues=false and areaChart=true HOT 3
- Pie chart external label alignment left on left side of pie. HOT 10
- Line Charts: line segments doesn't work with CurveType = {CurveType.QUADRATIC} HOT 1
- Can we acheive yAxis addtional label? HOT 1
- Pie Chart label text overflowing HOT 1
- Issue - OnPress is not working in pie chart HOT 1
- BarChart: topLabel component not displayed above bars when isAnimated is enabled HOT 5
- How to create group bar chart (Left Y-Axis) and 2 line chart (Right Y-axis) with negative values HOT 18
- Image Capture for charts HOT 6
- Stop interpolating after the last not null datapoint HOT 7
- Inconsistent graph scaling with similar datas HOT 4
- Bug: Cannot read property 'isSecondary' of null HOT 5
- (PieChart) onPress event is not returning data properly HOT 1
- Animation is not working anymore HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-gifted-charts.