esnet / esnet/react-timeseries-charts

TimeMarker onClick

Open
#443 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
876
Forks
279
PR merge metrics
No merged PRs in 30d

Description

# ❔Question

I want to add time markers to the time series, to select them and to move them with the mouse.

1- I render `TimeMarkers` within the `Charts` as described in the documentation:

```javascript

...

...

```

and added an `onClick` event handler to the `TimeMarkers` `renderLine` method:

```javascript
renderLine(posx) {
return (
{
this.props.onClick(e);
}}
style={this.props.infoStyle.line}
x1={posx}
y1={0}
x2={posx}
y2={this.props.height}
/>
);
}
```

any idea why am I not getting those events?

2- Do you think it would make more sense to handle mouse events in my application and use the tracker position to identify the `TimeMarker` being clicked?

Thanks!
I love your library.

#### Environment
| Software | Name/Version|
| ---------------- | ---------- |
| react-timeseries-charts | 0.16.0
| Browser | Chrome 81
| Operating System | Macos

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.