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

Mixing [x, y] and [y] series data for column type charts with 2 y-axises makes chart disappear on series toggle #6469

Closed
wspurgin opened this issue Mar 14, 2017 · 1 comment

Comments

@wspurgin
Copy link

This issue is current as of v5.0.9 (2017-03-08) and has existed since 4.2.7 (2016-09-21).

The chart renders the first time correctly, but toggling a series off (or on) whose data was defined with the [y1,y2,y3,...] style causes the entire graph (axises, gridlines, other series, etc.) to disappear.

I'm able to produce this error with column charts when using categories, multiple axises, and "mixing" the style of defining the series data. For example:

{
    chart: {
        type: 'column'
    },
    xAxis: {
        categories: ['A', 'B', 'C', 'D']
    },
    yAxis: [{
        title: { text: "Primary" }
    }, {
        title: { text: "Secondary" },
        opposite: true
    }]
//...
    series: [{
        data: [1,2,3,4]
    }, {
        data: [
            ['A', 4],
            ['C', 3],
            ['D', 2],
            ['B', 1]
        ],
        yAxis: 1
    }]
}

From what I can tell this only a problem when multiple axises are used. I haven't been able to reproduce for data with only one axis. This is an issue when, like in the more complicated fiddle below, you want to show a histogram based on one axis, and a spline based on a separate axis.

If all the data is sorted for the spline in the same way as the histogram series, then just using the data: [ y1, y2, y3,...] style for all series is a good temporary fix. However, if the data is unsorted and you have to rely on the data: [ [x1, y1], [x2,y2], ...] to place the series values correctly, this becomes problematic. For those facing that problem, the temporary fix is to manually sort by the X values (if you can). Otherwise the only other option is to downgrade to v4.2.6 (the latest version that still allows the mixing of data definitions).

Expected behaviour

Toggling Series on and off shows and hide series (and if necessary hides axises).

Actual behaviour

Toggling a series with the [y] style series data definition off cause all series (and all axises) to disappear. All series must be turned off and only the series with the [x, y] style data turned on for chart to reappear (but only with that one series).

Live demo with steps to reproduce

Simplified Examples (2 series based off of highcharts 2 axis example):
http://jsfiddle.net/8pefrwkr/1/
http://jsfiddle.net/8pefrwkr/2/

More Complex Example (more series and mixed series types)
http://jsfiddle.net/8pefrwkr/

Affected browser(s)

Chrome, Firefox.

@wspurgin
Copy link
Author

BTW, There may be other browsers affected; I only tested the ones I had.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants