Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line Chart Incorrectly Renders for Series with Different Date Ranges #110

Open
zaidqureshi95 opened this issue Mar 5, 2024 · 0 comments

Comments

@zaidqureshi95
Copy link

zaidqureshi95 commented Mar 5, 2024

Description

I am using ECharts within a React Native application to visualize financial data from two companies (APPL and Lucid) over the past 5 years using a LineStack chart. APPL has data spanning the full 5 years, whereas Lucid, being established in 2023, has data only from 2023 onwards. The expected behavior is for the Lucid line to start from 2023 on the X-axis, aligning with its actual data start date. However, the chart incorrectly renders the LCID line starting from 2019, aligning it with the APPL data start date, despite Lucid not having data for those earlier years.

Expected Behavior

The Lucid line should start from 2023 on the chart, with no line rendered for Lucid before this year, as it does not have data prior to 2023.

Actual Behavior

The Lucid line is rendered starting from 2019 (alongside APPL), incorrectly implying that there is Lucid data from 2019 onwards.

Steps to Reproduce

Integrate ECharts with a React Native application.
Use the following dummy data for APPL and Lucid, representing their financial data over the past 5 years:

const option = {
    tooltip: {
        trigger: 'axis',
    },
    legend: {},
    xAxis: {
        type: 'category',
        data: ['2019', '2020', '2021', '2022', '2023']
    },
    yAxis: {
        type: 'value'
    },
    series: [
        {
            name: 'APPL',
            type: 'line',
            data: [820, 932, 901, 934, 1290]
        },
        {
            name: 'Lucid',
            type: 'line',
            // Lucid established in 2023, so no data before then
            data: [0, 0, 0, 0, 500] // Incorrect workaround to illustrate the issue; ideally, these zeros should not be needed for correct rendering.
        }
    ]
};

Render the chart using the above option configuration.

Environment

  • ECharts version: 5.5.0
  • React Native version:0.69
  • Browser and its version Chrome 122.0.6261.94
  • Operating System and its version: MacOS 14.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant