Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting bottom borderWidth for a bar chart has no effect #6172

Closed
mustpax opened this issue Mar 28, 2019 · 1 comment
Closed

Setting bottom borderWidth for a bar chart has no effect #6172

mustpax opened this issue Mar 28, 2019 · 1 comment

Comments

@mustpax
Copy link

mustpax commented Mar 28, 2019

Expected Behavior

Setting borderWidth with an object should make it possible to set the width of the bottom border on a bar chart.

Current Behavior

Setting borderWidth for bottom border has no effect.

This:

borderWidth: {
        top: 0,
        bottom: 5,
        right: 0,
        left: 0
}

Is equivalent to

borderWidth: 0

Possible Solution

Draw the bottom border of a bar chart if borderWidth is explicitly specified with an object and bottom > 0. If the borderWidth is specified as a number, retain previous functionality.

Steps to Reproduce (for bugs)

Interactive live demo: https://codesandbox.io/s/j363lr39ry

Note Line 27 in src/index.js where borderRadius.bottom is specified, but this has no effect on the displayed bar chart.

Context

Building a custom bar chart for a client. The client wants the chart to have no x or y-axis. Instead each bar will have a distinct color border. We will display labels and scales for the bar chart through other means.

When we removed the axes we noticed that the bottom border for the bars did not exist. We then tried to explicitly set the bottom border via borderWidth but were unable to do so.

If the maintainers are open to it, we're willing to submit a patch to fix the issue with your guidance.

Environment

  • Chart.js version: 2.8.0
  • Browser name and version: Chrome 72
@mustpax
Copy link
Author

mustpax commented Mar 29, 2019

Resolved my own issue! I just set borderSkipped: false and all 4 borders show up now. Thanks!

@mustpax mustpax closed this as completed Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant