Skip to content

Mixed chart type specification #4184

@benmccann

Description

@benmccann

The docs say for mixed chart type that the overall type must be bar (example from docs below). As a user, I don't understand this restriction.

  • What if I want to specify two lines? This seems to be possible. In this case, I can set the overall type as line and the docs appear to be wrong in saying that the type can only be "bar"
  • Why does my chart even have a type? This is redundant with the types specified in the dataset. If I have a bar and a line, but set the overall type to line then it breaks. This is strange and I don't understand the reason for it
 var myChart = new Chart(ctx, {
     type: 'bar',
     data: {
         labels: ['Item 1', 'Item 2', 'Item 3'],
         datasets: [
             {
                 type: 'bar',
                 label: 'Bar Component',
                 data: [10, 20, 30],
             },
             {
                 type: 'line',
                 label: 'Line Component',
                 data: [30, 20, 10],
             }
         ]
     }
 });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions