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

Toggling off bar series, then loading data with unload: true, shows bar series again #2618

Open
dayvidwhy opened this issue May 15, 2019 · 0 comments
Labels
C-bug Category: This is a bug

Comments

@dayvidwhy
Copy link

dayvidwhy commented May 15, 2019

  • C3 version: 0.6.3 (or whatever the sample documentation uses)
  • D3 version: v5
  • Browser: Chrome 74
  • OS: MacOS

I'm having an issue where if you have a bar chart with two series, and toggle one of the series to be hidden, and then load more data, the hidden series comes back, appearing on top of/or behind the other series.

You can reproduce the issue with this snippet of code I modified from one of the samples

var chart = c3.generate({
    data: {
        x: 'x',
        columns: [
            ['x', '2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04', '2013-01-05', '2013-01-06'],
            ['data1', 30, 200, 100, 400, 150, 250],
            ['data2', 130, 340, 200, 500, 250, 350]
        ],
        type: "bar"
    },
    axis: {
        x: {
            type: 'timeseries',
            tick: {
                format: '%Y-%m-%d'
            }
        }
    }
});

setTimeout(function () {
    chart.load({
        unload: true,
        columns: [
            ['x', '2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04', '2013-01-05', '2013-01-06'],
            ['data1', 130, 300, 200, 300, 150, 250],
            ['data2', 130, 240, 300, 400, 250, 350]
        ]
    });
}, 5000);

If you copy paste this into https://c3js.org/samples/timeseries.html

After you paste the code in, hide data1 series by clicking it in the legend.

Wait until the load happens, and you see that the blue bar comes back.

Is this the intended behaviour?

If you remove the unload: true from the second code block, it doesn't happen.

@dayvidwhy dayvidwhy changed the title Toggling off bar series, then loading data, shows bar series again Toggling off bar series, then loading data with unload: true, shows bar series again May 15, 2019
@kt3k kt3k added the C-bug Category: This is a bug label May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants