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

Gauge shows wrong threshold color if there is more than one data value for the series #2750

Closed
GDFaber opened this issue Feb 9, 2020 · 1 comment · Fixed by #2755
Closed

Comments

@GDFaber
Copy link
Contributor

GDFaber commented Feb 9, 2020

  • C3 version: 0.7.13
  • D3 version: 5.15.0
  • Browser: Chrome 80.0.3987.87
  • OS: Windows 10

Problem description
If a gauge chart gets more than one data row/column, the values are summed up for each series, which works nicely as far as I can tell.

However there seems to be a problem finding the right level color after summing up the values: The arcs as well as the legend are colored according to the first data value instead of the sum (the tooltips show the correct color).

How to reproduce
Go to https://c3js.org/samples/chart_gauge.html and change the example code like this:

var chart = c3.generate({
    data: {
        columns: [
            ['data1', 20, 20],
            ['data2', 40, 40]
        ],
        type: 'gauge',
    },
    color: {
        pattern: ['#FF0000', '#F97600', '#F6C600', '#60B044'],
        threshold: {
            values: [30, 60, 90, 100]
        }
    }
});
@GDFaber
Copy link
Contributor Author

GDFaber commented Feb 16, 2020

I might have fixed it, but need to do more testing first to be sure it doesn't break anything else instead.

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

Successfully merging a pull request may close this issue.

1 participant