Skip to content

Line chart dataset order is wrong #2719

Closed

Description

@dmig

This fiddle shows the problem: https://jsfiddle.net/dmig/97pxd7eL/4/

When I specify datasets, I expect them to be drawn in that order:

  datasets: [
    {
        label: "Blue", 
      fill: true, 
      backgroundColor: "rgba(32, 162, 219, 1)",
      data: dataPack1,
    },
    {
        label: "Red",
      fill: true,
      backgroundColor: "rgba(196, 93, 105, 1)",
      data: dataPack2,
    },
    ]

Workaround is to reverse their order, but label order in legend/tooltips is also reversed,

Activity

  1. etimberg commented on Jun 6, 2016

    @etimberg
    Member

    Similar to a bunch of other issues that are open, but I can't find them at the moment.

  2. Jaded-Design commented on Jun 13, 2016

    @Jaded-Design

    If you could just point me to the section where you choose the render order of datasets I could take a look, just don't have time to dig around looking.

    Also, here is that similar issue: #2219

  3. etimberg commented on Mar 15, 2017

    @etimberg
    Member

    This will be resolved in #4008 which adds the ability to fill to another dataset. This means that the draw order will become irrelevant since the correct solution for the blue dataset will be to fill to the red one instead of all the way down to 0

  4. etimberg commented on Jul 3, 2017

    @etimberg
    Member

    Tied in with my comment on #2219

  5. etimberg commented on Dec 31, 2017

    @etimberg
    Member

    Closing per my comment from march. This can be fixed using the fill to other dataset functionality. See https://jsfiddle.net/gz4ev7jr/

  6. Alumniminium commented on Apr 24, 2024

    @Alumniminium

    fill to other dataset functionality

    Closing per my comment from march. This can be fixed using the fill to other dataset functionality. See https://jsfiddle.net/gz4ev7jr/

    Funny how your jsfiddle doesn't work.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions