Charts 如何更改ChartJS线段中的pointBackgroundColor?
我试图更改图形线段部分的点背景色,但它似乎只适用于边界色。这是我的密码。有人知道如何改变它们吗?顺便说一下,我正在使用chart.js版本3.1.1Charts 如何更改ChartJS线段中的pointBackgroundColor?,charts,chart.js,Charts,Chart.js,我试图更改图形线段部分的点背景色,但它似乎只适用于边界色。这是我的密码。有人知道如何改变它们吗?顺便说一下,我正在使用chart.js版本3.1.1 const data = { datasets: [ { type: 'line', label: `${props.stationSelected.selected.label2}`, borderColor: '#feb1c3',
const data = {
datasets: [
{
type: 'line',
label: `${props.stationSelected.selected.label2}`,
borderColor: '#feb1c3',
backgroundColor: '#feb1c3',
pointRadius: 3,
pointBackgroundColor: '#feb1c3',
fill: false,
data: hourlyData,
tension: 0.5,
segment: {
borderColor: ctx => findEstimate(ctx, '#7c7c7c'), // this works
pointBackgroundColor: ctx => findEstimate(ctx, '#7c7c7c'), // this does not work
}
},
],
}
const findEstimate = (ctx, value) => {
const dt = ctx.p0.$context.raw.gageHeightDateTime
const start = modalDataRaw.gageHeightDateTimeStart
const stop = modalDataRaw.gageHeightDateTimeEnd
if (dt >= start && dt <= stop) {
return value
}
}
const数据={
数据集:[
{
键入:“行”,
标签:`${props.stationSelected.selected.label2}`,
边框颜色:“#feb1c3”,
背景颜色:“#feb1c3”,
点半径:3,
pointBackgroundColor:“#feb1c3”,
填充:假,
数据:hourlyData,
张力:0.5,
部分:{
borderColor:ctx=>findestmate(ctx,#7c7c'),//这很有效
pointBackgroundColor:ctx=>FinDestinate(ctx,#7c7c7c'),//这不起作用
}
},
],
}
常量findestmate=(ctx,值)=>{
const dt=ctx.p0.$context.raw.gageHightDateTime
const start=modalDataRaw.gageHightDateTimeStart
常数停止=modalDataRaw.GageHightDateTimeEnd
如果(dt>=开始和&dt