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

Support plot legends #1410

Open
1 task
umayrh opened this issue May 26, 2023 · 0 comments
Open
1 task

Support plot legends #1410

umayrh opened this issue May 26, 2023 · 0 comments

Comments

@umayrh
Copy link

umayrh commented May 26, 2023

Would you like to work on this feature?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

What problem are you trying to solve?

Since chartist-plugin-legend seem inactive, and is incompatible with Chartist v1 [1], there doesn't seem to be a way to put legends in Chartist plots anymore. Chart legends should be part of Chartist core lib and not a plugin since it's essential to make non-trivial plots meaningful.

[1] Upgrading the chartist CSS and JS sources in https://codepen.io/chimmer/pen/QVvMgz?editors=1111 breaks the demo

Describe the solution you'd like

By default, the legend should be constructed from the name field provided in the series list, and default to using the alpha-numerated classnames (so, Plot A, Plot B etc).

    new Chartist.LineChart(
      '#chart',
      {
        labels: ['a', 'b', 'c'],
        series: [{'name': 'Plot 1', data: [1, 3, 4, 7, 11, 18]}, {'name': 'Plot 2', data: [1, 2, 3, 5, 8, 13]]
      }, {
        fullWidth: false,
        },
    });

Describe alternatives you've considered

No response

Documentation, Adoption, Migration Strategy

No response

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

1 participant