Chart 3.0.0-beta.7: bar borderRadius - bottomRight & bottomLeft ??
See original GitHub issueExpected Behavior
Am I doing something wrong or is it not possible?
The topLeft
and topRight
settings work perfectly.
How can I use pointStyle
on a barchart?
Example:
Current Behavior
The --> borderSkipped: falsebottomLeft
and bottomRight
do not work for me
Possible Solution
???
Steps to Reproduce
see: https://jsfiddle.net/zibous/57Lwhcdx/
Context
var data = {
labels: ['Current', 'Today', 'Month', 'Year'],
datasets: [{
label: 'Water Consumtion 2020',
backgroundColor: ['#2980b9', '#2980b9', '#2980b9', '#2980b9'],
borderWidth: 0,
data: [15, 150, 1500, 6000],
unit: 'liter',
borderRadius: {
// topLeft: 100,
// topRight: 100,
bottomRight: 100, <--- Do not work
bottomLeft: 100, <--- Do not work
}
},
{
borderWidth: 0,
tooltip: false,
data: [9985, 9850, 8500, 4000],
showLine: false,
pointRadius: 8,
pointStyle: ['▲', '▼', '≃', '▲'] <--- possible or workaround ???
}
]
};
var options = {
type: 'bar',
data: data,
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
x: {
stacked: true,
ticks: {
major: {
enabled: true,
},
},
},
y: {
stacked: true,
ticks: {
major: {
enabled: true,
},
},
}
},
plugins: {
legend: {
display: false,
},
title: {
display: true,
text: 'Consumption of water 2020'
},
tooltip: {
callbacks: {
label: (chart) => {
if (chart.dataset.tooltip === false) {
return null;
}
return chart.formattedValue + " " + chart.dataset.unit || "";
}
}
},
},
}
};
window.onload = function() {
// global
Chart.defaults.responsive = true;
Chart.defaults.maintainAspectRatio = false;
Chart.defaults.animation = false;
Chart.defaults.locale = "de-AT";
// default font and -color
Chart.defaults.font.family = "Roboto, Quicksand,'Open Sans','Rubik','Helvetica Neue', 'Helvetica', 'Arial', sans-serif";
Chart.defaults.color = '#FFFFFF';
Chart.defaults.font.size = 14;
// title settings
Chart.defaults.plugins.title.font.size = 20
Chart.defaults.plugins.title.font.style = "normal";
// gridlines
Chart.defaults.scale.gridLines.display = false
Chart.defaults.scale.display = false;
// tooltips
Chart.defaults.plugins.tooltip.enabled = true;
Chart.defaults.plugins.tooltip.backgroundColor = "#ecf0f1";
Chart.defaults.plugins.tooltip.titleColor = "#2c3e50"
Chart.defaults.plugins.tooltip.bodyColor = "#607D8B"
Chart.defaults.plugins.tooltip.footerColor = "#34495e"
// create the chart
var ctx = document.getElementById('mybar').getContext('2d');
window.myBar = new Chart(ctx, options);
};
Environment
- Chart.js version: Chart 3.0.0-beta.7
- Browser name and version: any
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Bar Chart Border Radius | Chart.js
Bar Chart Border Radius ... const config = { type: 'bar', data: data, options: { responsive: true, plugins: { legend: { position: 'top',...
Read more >salesforce-ux/design-system/ui.component-tokens.json
... .slds-builder-header__item-action:focus"],"sassTokenName":"$color-gray-7" ... :["border-bottom-left-radius","border-bottom-right-radius","border-radius" ...
Read more >Stacked bar chart with rounded corner of bar using Chart.js ...
Coding example for the question Stacked bar chart with rounded corner of bar using ... Corner points, from bottom-left to bottom-right clockwise //...
Read more >border-radius - CSS: Cascading Style Sheets - MDN Web Docs
The border-radius CSS property rounds the corners of an element's outer ... bottom-right | bottom-left */ border-radius: 1px 0 3px 4px; ...
Read more >React Charts - Simple, immersive & interactive charts for React
Succinct & Declarative. Time is short for front-end developers as it is, so having a charting system that is great out of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A barchart doesnt use the point element, if you want to use it you have to create you’re own chart https://www.chartjs.org/docs/master/developers/charts
@danmana Thanks.