Skip to content

multiple numbers are overwritten for valuesOverPoints set to 1 #415

Open
@sankarcn

Description

@sankarcn

Expected Behaviour

When we chart a stacked bar graph with valuesOverPoints set to 1, then the value shown on top should have the total.

Actual Behaviour

Looks like multiple numbers are overwritten on each other giving a very unreadable output.

Steps to Reproduce:

new Chart("#chart", {
  "data": {
    "labels": [
      "Planned",
      "Actual",
      "Profit"
    ],
    "datasets": [
      {
        "name": "Planned",
        "values": [
          1350,
          1350,
          0
        ],
        "chartType": "bar"
      },
      {
        "name": "Overrun",
        "values": [
          0,
          7499,
          0
        ],
        "chartType": "bar"
      },
      {
        "name": "Profit",
        "values": [
          0,
          0,
          14188
        ],
        "chartType": "bar"
      }
    ],
    "yMarkers": [
      {
        "label": "",
        "value": 1350,
        "options": {
          "labelPos":"center"
        }
      }
    ]
  },
  "type": "bar",
  "height": 250,
  "barOptions": {
    "stacked": true,
    "spaceRatio": 0.2
  },
  "valuesOverPoints": 1,
  "axisOptions": {
    "yAxisMode": "tick",
    "xAxisMode": "tick",
    "xIsSeries": 0
  },
  "colors": [
    "#2986cc",
    "#f1c232",
    "#2cb100"
  ]
});

Error

NOTE: Add a GIF/Screenshot if required.

Frappé Charts version:
Codepen / Codesandbox:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions