【发布时间】:2019-12-01 02:18:19
【问题描述】:
我在 Angular 6 中安装了 ng2-charts,我想知道如何为工具提示定义新位置。我在 Charts.js 中找到了该指南,但我不明白在哪里可以定义它。 https://www.chartjs.org/docs/latest/configuration/tooltip.html
Angular6
barChartPlugins = [pluginDataLabels];
chartOptions: any = {
responsive: true,
maintainAspectRatio: false,
tooltips: {
enabled: true,
position: 'nearest'
},
scales: {
xAxes: [{
gridLines: {
lineWidth: 0.2
}
}],
yAxes: [{
ticks: {
beginAtZero: true
},
gridLines: {
lineWidth: 0.5
}
}]
},
plugins: {
datalabels: {
display: false
},
}
};
【问题讨论】:
标签: angular chart.js ng2-charts