You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add borderRadius to bar charts. Closes#7701 (#7951)
* Add helper to parse border radius options
* feat: Implement borderRadius for bar charts
* chore: add demo of bar charts with border radius
* chore: document bar borderRadius
* chore: update typescript with bar borderRadius property
* fix horizontal borders test failing due to antialiasing
* chore: Add border-radius visual test
| [`indexAxis`](#general) | `string` | `'x'` | The base axis for the dataset. Use `'y'` for horizontal bar.
92
94
| [`label`](#general) | `string` | - | - | `''`
93
95
| [`order`](#general) | `number` | - | - | `0`
@@ -116,13 +118,14 @@ The style of each bar can be controlled with the following properties:
116
118
| `borderColor` | The bar border color.
117
119
| [`borderSkipped`](#borderskipped) | The edge to skip when drawing bar.
118
120
| [`borderWidth`](#borderwidth) | The bar border width (in pixels).
121
+
| [`borderRadius`](#borderradius) | The bar border radius (in pixels).
119
122
| `clip` | How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. `0` = clip at chartArea. Clipping can also be configured per side: `clip: {left: 5, top: false, right: -2, bottom: 0}`
120
123
121
124
All these values, if `undefined`, fallback to the associated [`elements.bar.*`](../configuration/elements.md#bar-configuration) options.
122
125
123
126
#### borderSkipped
124
127
125
-
This setting is used to avoid drawing the bar stroke at the base of the fill.
128
+
This setting is used to avoid drawing the bar stroke at the base of the fill, or disable the border radius.
126
129
In general, this does not need to be changed except when creating chart types
127
130
that derive from a bar chart.
128
131
@@ -142,6 +145,10 @@ Options are:
142
145
143
146
If this value is a number, it is applied to all sides of the rectangle (left, top, right, bottom), except [`borderSkipped`](#borderskipped). If this value is an object, the `left` property defines the left border width. Similarly, the `right`, `top`, and `bottom` properties can also be specified. Omitted borders and [`borderSkipped`](#borderskipped) are skipped.
144
147
148
+
#### borderRadius
149
+
150
+
If this value is a number, it is applied to all corners of the rectangle (topLeft, topRight, bottomLeft, bottomRight), except corners touching the [`borderSkipped`](#borderskipped). If this value is an object, the `topLeft` property defines the top-left corners border radius. Similarly, the `topRight`, `bottomLeft`, and `bottomRight` properties can also be specified. Omitted corners and those touching the [`borderSkipped`](#borderskipped) are skipped. For example if the `top` border is skipped, the border radius for the corners `topLeft` and `topRight` will be skipped as well.
151
+
145
152
### Interactions
146
153
147
154
The interaction with each bar can be controlled with the following properties:
@@ -151,6 +158,7 @@ The interaction with each bar can be controlled with the following properties:
151
158
| `hoverBackgroundColor` | The bar background color when hovered.
152
159
| `hoverBorderColor` | The bar border color when hovered.
153
160
| `hoverBorderWidth` | The bar border width when hovered (in pixels).
161
+
| `hoverBorderRadius` | The bar border radius when hovered (in pixels).
154
162
155
163
All these values, if `undefined`, fallback to the associated [`elements.bar.*`](../configuration/elements.md#bar-configuration) options.
0 commit comments