如何让 rechart 的 lineChart DOT 像滑块的拇指一样移动?

问题描述

目前,折线图的标签和点连接到 rc-slider,随着滑块的拇指移动标签和点移动并相应地显示相应的数据。

我还希望线条的 DOT 像滑块的拇指一样工作(DOT 应该可以在线拖动)

图表和滑块的数据长度相同

在 CustomizedLabel 和 CustomizedDot 函数中,如果图表的数据索引 === 滑块的数据索引,我只是渲染它们

如果不可能,有人可以建议另一个图书馆或可能的方法。谢谢。

折线图代码

<LineChart data={sliderChartData}>
            <XAxis tick={false} dataKey="name" />
            <YAxis tick={false} />
            <ReferenceLine
              y={0}
              strokeWidth={2}
              stroke={dashedLineColor}
              strokeDasharray="3 3"
            />
            <Line
              type="monotone"
              activeDot={false}
              dot={<CustomizedDot />}
              dataKey="tranchA"
              stroke={lightBlueColor}
              strokeWidth={4}
            >
              <LabelList
                dataKey="tranchA"
                content={renderCustomizedLabelTrancheA}
              />
            </Line>
            <Line
              type="monotone"
              activeDot={false}
              dot={<CustomizedDot />}
              dataKey="tranchB"
              stroke={lightBlueColor}
              strokeWidth={4}
            >
              <LabelList
                dataKey="tranchB"
                content={renderCustomizedLabelTrancheB}
              />
            </Line>
          </LineChart>

This is the chart

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...