rrag / react-stockcharts

Highly customizable stock charts with ReactJS and d3
http://rrag.github.io/react-stockcharts
MIT License
3.84k stars 956 forks source link

Is it possible to set x Axis to certain date? #804

Open Tusenka opened 2 years ago

Tusenka commented 2 years ago

For example I want to see data on jan 01, is it possible to programmatically set x axis to that data without moving cursor?

Tusenka commented 2 years ago

Found the solution here https://github.com/rrag/react-stockcharts/blob/master/src/lib/scale/evaluator.js#L53 We can override data for clamp as a function. I've made closure for clamp so it can access additional tracking data.

@rrag , thank you for sharing the code) It is very delicious

VRspace4 commented 1 year ago

@Tusenka, do you mind sharing a snippet of the code you used to implement setting the X Axis to a certain date? Thanks in advance!