通常,我应该能够通过将属性添加到数据集来添加一个填充。但我不能让它工作,我也找不到任何类似的信息。也许有个插件不见了?
const chartData = {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
radius: 0,
borderColor: 'rgb(75, 192, 192)',
backgroundColor: 'rgb(75, 192, 192)',
tension: 0.1,
hoverOffset: 4,
data: [65, 59, 80, 81, 56, 55, 40],
fill: true
}]
}我的CartJS注册如下:
import {
Chart as ChartJS,
Title,
Tooltip,
LineElement,
LinearScale,
PointElement,
CategoryScale,
Plugin
} from 'chart.js'
import { useConstructionRiskStore } from '../../core/stores/constructionRiskStore'
ChartJS.register(
Title,
Tooltip,
LineElement,
LinearScale,
PointElement,
CategoryScale
)很可能只是一些愚蠢的东西..。我知道呀。
发布于 2022-05-04 14:59:33
在使用树搜索时,您必须导入并注册Filler插件以使fill工作:
import {Chart, Filler} from 'chart.js'
Chart.register(Filler)https://stackoverflow.com/questions/72115121
复制相似问题