Replies: 1 comment
-
You can contact the authors of chart.js |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
chart.js has a number of plugins that I would like to use in my application. I used the following lines:
// Char.js and plugins
import { Chart } from "chart.js";
import autocolors from 'chartjs-plugin-autocolors';
import zoomPlugin from 'chartjs-plugin-zoom';
Chart.register(autocolors);
Chart.register(zoomPlugin);
his.chartBarOption = {
animation: {
duration: 0
},
plugins: {
autocolors: {
enabled: true,
},
zoom: {
zoom: {
wheel: {
enabled: true,
},
pinch: {
enabled: true,
},
mode: "xy",
}
},
legend: {
labels: {
color: textColor
}
},
tooltip: {
callbacks: {
label: function (context) {
let label = context.dataset.label || '';
It doesn't give any errors, but it doesn't work either. I am doing something wrong? Or is it that the Chart component does not allow the use of those pluggins.
Translated by Google Translate.
Texto Original:
chart.js tiene una serie de pluggins que me gustaría usar en mi aplicación. Utilicé las siguientes líneas:
// Char.js y plugins
import { Chart } from "chart.js";
import autocolors from 'chartjs-plugin-autocolors';
import zoomPlugin from 'chartjs-plugin-zoom';
Chart.register(autocolors);
Chart.register(zoomPlugin);
this.chartBarOption = {
animation: {
duration: 0
},
plugins: {
autocolors: {
enabled: true,
},
zoom: {
zoom: {
wheel: {
enabled: true,
},
pinch: {
enabled: true,
},
mode: "xy",
}
},
legend: {
labels: {
color: textColor
}
},
tooltip: {
callbacks: {
label: function (context) {
let label = context.dataset.label || '';
No da ningún error, pero tampoco funciona. Estoy haciendo algo mal? o es que en el componente Chart no se permite utilizar esos pluggins.
Beta Was this translation helpful? Give feedback.
All reactions