0

试图在鼠标悬停位置获取 x 和 y 值。

<XYPlot
    xType="time"
    getX={ d => d[0] }
    getY={ d => d[1] }
    width={300}
    height={300}>
      <LineSeries
        color="orange"
        data={graphData}
        onSeriesMouseOver={(event)=> {
          console.log('val', event)
        }}
      />
      <XAxis />
      <YAxis />
  </XYPlot>

当我记录事件时,我得到 {event: Class}。文档不清楚如何获得价值 在此处输入图像描述

我试过 event.target.value 和 event.currentTarget 但它们是未定义的。有没有人遇到过这个问题并有解决方案或解决方法?

当我展开事件对象时,我得到以下

event: Class
altKey: (...)
bubbles: (...)
button: (...)
buttons: (...)
cancelable: (...)
clientX: (...)
clientY: (...)
ctrlKey: (...)
currentTarget: (...)
defaultPrevented: (...)
detail: (...)
dispatchConfig: null
eventPhase: (...)
getModifierState: (...)
isDefaultPrevented: (...)
isPropagationStopped: (...)
isTrusted: (...)
metaKey: (...)
movementX: (...)
movementY: (...)
nativeEvent: (...)
pageX: (...)
pageY: (...)
relatedTarget: (...)
screenX: (...)
screenY: (...)
shiftKey: (...)
target: (...)
timeStamp: (...)
type: (...)
view: (...)
_dispatchInstances: null
_dispatchListeners: null
_targetInst: null
preventDefault: (...)
stopPropagation: (...)
4

0 回答 0