question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stacked chart bar with border radius looks strange

See original GitHub issue

Expected Behavior

Stacked bar charts with border radius should only be applied to the uppermost element or lowermost element in case of negative value.

Current Behavior

Border radius is applied to every stacked element. Screenshot here

Steps to Reproduce

Set chart to bar, set border radius and set dataset to stack.

Context

I can’t use this feature because it doesn’t look good enough.

Environment

  • Chart.js version:
  • Browser name and version:
  • Link to your project:

Chrome 89.0.4389.114 (64 bits) Chart.js v3.1.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LeeLenaleeecommented, Apr 11, 2021

Thanks @LeeLenaleee. In the scriptable context, the chart should be available as ctx.chart.

Yes it indeed does have the chart, my bad looked over it in the console log

0reactions
etimbergcommented, Apr 11, 2021

Here’s a version that works more broadly, but if has some caveats.

  1. Does not handle multiple stacks
  2. Does not handle the dataset.order property
  3. Does not handle mixed chart types.

https://jsfiddle.net/b4haynxc/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overlapping and rounded stack in stacked column graph in ...
The problem with the column 2015 is that I am not able to add border radius to the top-left and top-right corners alone....
Read more >
Rounded corners on stacked bar chart · Issue #23 - GitHub
Any chance to see this working on stacked bar charts? Currently the rounded corners are applied to the bottom bar as well.
Read more >
How to Add Border Radius on Each Stacked Bar Chart in ...
How to Add Border Radius on Each Stacked Bar Chart in Chart JSIn this video we will explore how to add border radius...
Read more >
How to Create Rounded Bars Including Bottom in Chart JS
The chart.js-rounded- bar - charts namespace will not work out of the box as expected. Using the borderRadius gives you slightly different ......
Read more >
Allow specifying borderRadius for individual corners –
'Border radius' on a column chart currently affects all 4 corners of a column identically. Please, could we have the ability to set ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found