Skip to content

[Bug] Incorrect ratio / rendering when using padAngle with values < 1 #4073

@luckyDaveKim

Description

@luckyDaveKim

Description

Summary

When using donut charts with padAngle enabled, internal calculations result in Infinity when all data values are fractional numbers less than 1.

This issue does not occur in v3.15.1, but does occur in v3.17.2, indicating a regression.

Environment

  • billboard.js version
    • ✅ v3.15.1 → works as expected
    • ❌ v3.17.2 → incorrect ratio / rendering
  • Browser: Chrome (latest)
  • Chart type: donut
  • No custom plugins

Steps to check or reproduce

v3.15.1 v3.17.2
JS Bin sample sample
Image Image Image

Steps to Reproduce

bb.generate({
  bindto: "#donutChart",
  data: {
    type: "donut",
    columns: [
      ["A", 0.42],
      ["B", 0.28],
      ["C", 0.28]
    ]
  },
  donut: {
    padAngle: 0.03
  }
});

Expected Behavior

  • The chart should display valid values that correctly reflect the calculated ratios.
  • This is exactly how it behaves in v3.15.1

Actual Behavior (v3.17.2)

  • In certain cases, the internal ratio calculation results in invalid values (Infinity)
  • The issue disappears immediately if:
    • padAngle is removed, or
    • values are scaled (e.g. 42, 28, 28 instead of 0.42, 0.28, 0.28)

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