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

Incsositent behavior with data.type and data.types when dynamically loading data #1013

Closed
danelkhen opened this issue Feb 20, 2015 · 2 comments
Labels
C-bug Category: This is a bug resolved maybe

Comments

@danelkhen
Copy link
Contributor

Hi,
When creating a bar chart (data.type='bar'), with some line graph (data.types={ddd:"line"}) - initially all works ok, but when loading the same data using chart.load() - all bars turn into lines. Perhaps it's illegal to use data.type and data.types? I'm using the fact that data.type means that default type, and data.types allows you to customize specific names. When specifying all target names in data.types all works ok. I'm just wondering if this should be a bit more consistent - to have the same behavior when using new c3.generate() and chart.load().

var chart = c3.generate({
    axis: { x: { type: "categorized", } },
    data: {
        type: "bar",
        types: {"ddd": "line"},
        columns: [
            ["aaa", "a", "b", "c"],
            ["bbb", 10,20,30],
            ["ccc", 40,50,60],
            ["ddd", 70,80,90],
        ],
        x: "aaa",
        groups: [["aaa", "bbb", "ccc"]],
    },
});

window.setTimeout(function(){
chart.load({
    type: "bar",
    types: {"ddd": "line"}
    columns: [
            ["aaa", "a", "b", "c"],
            ["bbb", 30,20,30],
            ["ccc", 80,50,60],
            ["ddd", 20,80,90],
    ],
    x: "aaa",
    groups: [["aaa", "bbb", "ccc"]],
});
}, 2000);
@masayuki0812
Copy link
Member

Hi, Thanks for reporting. You're right and I think this has been fixed now. I'll release this fix in the next version 0.4.10 shortly. Thanks!

@masayuki0812 masayuki0812 added C-bug Category: This is a bug resolved maybe labels Mar 15, 2015
@masayuki0812
Copy link
Member

0.4.10 has been released, so let me close at the moment. Thanks.

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 resolved maybe
Projects
None yet
Development

No branches or pull requests

2 participants