更改标签的颜色 vue-chartjs
Change color of labels vue-chartjs
如何更改标签的默认颜色?
这是默认的图表实现,希望有人能帮助我
<script>
import { Pie} from 'vue-chartjs'
export default Pie.extend({
props: ['one', 'two', 'three'],
mounted () {
// Overwriting base render method with actual data.
this.renderChart({
labels: ['One', 'Two', 'Three'],
datasets: [
{
label: 'Stuff',
backgroundColor: ['#C28535', '#8AAE56', '#B66C46'],
data: [this.one, this.two, this.three]
}
]
})
}
})
</script>
干杯
查看 Chart.js 文档 http://www.chartjs.org/docs/#chart-configuration-tooltip-configuration
我猜你指的是图例中的标签?还是工具?
无论哪种方式,您都必须将对象作为选项传递。
如何更改标签的默认颜色?
这是默认的图表实现,希望有人能帮助我
<script>
import { Pie} from 'vue-chartjs'
export default Pie.extend({
props: ['one', 'two', 'three'],
mounted () {
// Overwriting base render method with actual data.
this.renderChart({
labels: ['One', 'Two', 'Three'],
datasets: [
{
label: 'Stuff',
backgroundColor: ['#C28535', '#8AAE56', '#B66C46'],
data: [this.one, this.two, this.three]
}
]
})
}
})
</script>
干杯
查看 Chart.js 文档 http://www.chartjs.org/docs/#chart-configuration-tooltip-configuration
我猜你指的是图例中的标签?还是工具? 无论哪种方式,您都必须将对象作为选项传递。