Skip to content

Line Graph Incorrectly Connects Datasets with Leading/Trailing Nulls #747

@Moeed-Farooq

Description

@Moeed-Farooq

i have encountered an issue with react-native-chart-kit when rendering multiple datasets that include null values at the beginning or end. This leads to an unintended line being drawn between the datasets, when one dataset ends with a number and the next dataset begins with null values, the chart draws a line connecting the last valid point of the first dataset to the first non-null point of the second dataset. However, if the order is reversed—placing the dataset with leading nulls first—the line break is rendered correctly.

Example:

// This results in an incorrect line connection:
[ [100, 91.67, 88.57, 54.29, 70], [null, null, 100, 0, 0] ]

// This renders correctly:
[ [null, null, 100, 0, 0], [100, 91.67, 88.57, 54.29, 70] ]

This might be an issues in LineChart under renderLine()

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