leeoniya / uPlot

📈 A small, fast chart for time series, lines, areas, ohlc & bars
MIT License
8.51k stars 371 forks source link

Some Questions #170

Closed MehrdadKhnzd closed 4 years ago

MehrdadKhnzd commented 4 years ago

Is your library supports vertical zooming? Or can you add this feature easily? Or how can I proceed if I want to implement it myself and make a PR?

leeoniya commented 4 years ago

try cursor.drag.y: true.

MehrdadKhnzd commented 4 years ago

Special thanks, it works like a charm!

MehrdadKhnzd commented 4 years ago

Hello again! I decided to reopen this so I don't have to add new issues for my other questions. How can I get data from the current mouse position? I mean the ones that you're showing on the bottom of the chart yourself. I want to show them manually in other places.

leeoniya commented 4 years ago

I decided to reopen this so I don't have to add new issues for my other questions.

i'd actually prefer that you open new issues. that way the questions & answers are easy to point to later without unrelated topics in the discussion.

self.cursor.idx points to the current index in the data.

MehrdadKhnzd commented 4 years ago

Thanks for the quick answer! Ok then, I'm gonna open new issues for my new questions! :D But now for this question, how can I prevent the showing of the bottom labels?

leeoniya commented 4 years ago

legend.show: false

MehrdadKhnzd commented 4 years ago

Thanks again! One last question in this section before I open other issues! :D How can I show/hide the lines of the graph like the action that I can do with the legends of it? It seems that it's related to the series.show property but I don't know how to modify it properly without re-rendering the whole graph.

leeoniya commented 4 years ago

.setSeries(0, {show: false})

MehrdadKhnzd commented 4 years ago

I have already tried this, but it gives me this error: TypeError: Cannot read property 'style' of undefined

leeoniya commented 4 years ago

can you create a jsfiddle or provide code that i can run which triggers the issiue?

leeoniya commented 4 years ago

sorry, i meant .setSeries(1, {show: false}), since series[0] are x values and cannot be toggled on/off. not sure if that was causing the issue.

MehrdadKhnzd commented 4 years ago

Yeah, the index was the problem. Thanks again, now it works fine!