在 Nivo @nivo/ResponsiveLine 中添加一条平行于 x 轴的简单目标线
Add a simple target line parallel to x-axis, in Nivo @nivo/ResponsiveLine
试图让这条与x轴平行的灰线作为目标标记(在y轴的67%处)。
你可以像这样放置一个标记道具:
markers={[
{
axis: 'y',
value: 520,
legend: 'TEST',
lineStyle: {
stroke: 'red',
},
textStyle: {
fill: 'red',
},
},
]}
这个值决定了marker的位置,你可以根据你传递的数据来计算。
试图让这条与x轴平行的灰线作为目标标记(在y轴的67%处)。
你可以像这样放置一个标记道具:
markers={[
{
axis: 'y',
value: 520,
legend: 'TEST',
lineStyle: {
stroke: 'red',
},
textStyle: {
fill: 'red',
},
},
]}
这个值决定了marker的位置,你可以根据你传递的数据来计算。