Skip to content

Multiple datasets not working properly in line chart #474

Description

@qasimmehdi

I have a line chart with two datasets if one dataset is larger than the other it show continue further but it doesnot do that.
Screenshot from 2021-01-23 16-04-54
What I want is that the green should end and the blue line should continue.

 <LineChart
data={{
labels: [...labels],
datasets: [
{
data: [...data],
color: (opacity = 1) => `rgba(0, 255, 0,${opacity})`,
},
{
data: [...data2], //this has 50 more items that data array
color: (opacity = 1) => `rgba(51, 29, 226,${opacity})`,
},
],
}}
width={Dimensions.get('window').width}
height={220}
yAxisLabel="$"
yAxisInterval={1}
chartConfig={{
backgroundGradientFrom: COLOR.BG,
backgroundGradientTo: COLOR.BG,
backgroundColor: COLOR.BG,
decimalPlaces: 2, // optional, defaults to 2dp
color: (opacity = 1) => `rgba(0, 255, 0, ${opacity})`,
labelColor: (opacity = 1) => `rgba(255, 255, 255, ${opacity})`,
style: {
borderRadius: 16,
backgroundColor: COLOR.BG,
},
strokeWidth: 2,
}}
withShadow={false}
withInnerLines={false}
withDots={false}
/>

Edit: please also tell me how to make the line completly opaque right now they are not if I give white color to a line it is shown as gray.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions