我使用react-chart js
在我的图我画一个多垂直线使用annotation
这是我的示例代码我曾用来画线
const testValue = ['0.019', '0.033', '0.305', '0.428', '0.582', '0.826'];
const splitArrayPopup = map(testValue, el => ({
type: 'line',
mode: 'vertical',
scaleID: 'x-axis-0',
value: parseFloat(el),
borderColor: '#e0e2e2',
borderWidth: 1,
borderDash: [3, 3],
label: {
content: parseFloat(el),
position: 'bottom',
enabled: true,
backgroundColor: 'transparent',
fontColor: '#e0e2e2',
fontStyle: 'normal',
yPadding: 0,
yAdjust: -10,
},
}));
我需要在图表的底部显示我的标签文本,我的意思是在图表之外,现在我要进入图表。
1条答案
按热度按时间nwsw7zdq1#
超晚,但你可以禁用裁剪图表边界,允许你的标签被视为画布的图表的定义视图之外:
注意:如果div没有足够的空间,标签仍然会被切断。在这种情况下,您需要增加包含图表的div的空间。