-
Notifications
You must be signed in to change notification settings - Fork 31
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
Most right Tooltip is cut and conflict with datalabels #26
Comments
Hi @am-benisha , Thanks for the issue :)
new Chart(document.getElementById("my-chart-1"), {
type: "horizontalBar",
data: { ... },
options: {
plugins: {
stacked100: { enable: true },
datalabels: {
formatter: (_value, context) => {
const { datasetIndex, dataIndex } = context;
const value = context.chart.data.originalData[datasetIndex][dataIndex]
// or you can use `context.chart.data.calculatedData[datasetIndex][dataIndex]` as relative percentage.
return value || "";
}
}
}
}
});
|
I don't know what exactly do you need. So, I'll give all. HTML
JS
Hope this will help debug |
@am-benisha Thanks for the all, and sorry my poor english... I think you have two ways to display tooltip completely. (or more than)
<canvas id="myChart" height="80"></canvas>
var stackedBar = new Chart(ctx, {
type: 'horizontalBar',
data: data,
options: {
layout: {
padding: {
right: 10,
}
},
...
}
} Hope this will help you. |
Thanks for the help! |
By the way,
It may be hard to fix this issue. it will take a little more time. |
One additional note for the formatter option above. This statement fails on InternetExplorer10 and the chart gets blank:
you have to replace it with:
|
Hi y-takey,
Thanks for your awesome work of this plugin.
I have some issues and maybe you can help me with them:
I'm using datalabels plugin for showing the values over the bars. When i'm NOT using your plugin, the chart looking like this:
But when i'm using your plugin, it first replaces the data values with their relative percentage:
When we hover once over the chart, the label are changing to the right values
The most right tooltip is cut:
Thanks in advance
The text was updated successfully, but these errors were encountered: