chartjs / chartjs/chartjs-plugin-datalabels

adding `direction: rtl;` to body in css messes with center alignment

Open
#184 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
920
Forks
507
PR merge metrics
No merged PRs in 30d

Description

I've tried it with bar graph

`body { direction: rtl; }`

![image](https://user-images.githubusercontent.com/1413249/83952216-ef55b900-a83f-11ea-9982-7a9701857ba2.png)

without `body { direction: rtl; }`

![image](https://user-images.githubusercontent.com/1413249/83952224-009ec580-a840-11ea-93fe-1a9f36dc5675.png)

```
var graph_data = {
labels: [200,301,404,500],
datasets: [
{
data: [67,1,0,0]
options: {
responsive:false
}
}
]
};
var myBarChart = new Chart(graph_ctx, {
type: 'bar',
data: graph_data,
options: {
legend: {
display: false
},
title: {
text: "bar graph",
display:true
},
animation: {
duration: 2000,
},
plugins: {
datalabels: {
color:'white',
display: function(context) {
return context.dataset.data[context.dataIndex] !== 0; // or >= 1 or ...
},
textShadowColor: 'black',
textShadowBlur: 2
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.