tradingview / lightweight-charts

Performant financial charts built with HTML5 canvas
https://www.tradingview.com/lightweight-charts/
Apache License 2.0
9.49k stars 1.63k forks source link

Support the second price axis #129

Closed kobermeit closed 4 years ago

kobermeit commented 5 years ago

Is your feature request related to a problem? Please describe.

I'm drawing multiple line series and a candlestick series on a chart. I can see the price axis on the right, but I can't see the axis for the other series, which makes it hard to read. With my old ecahrts library, I had 3 axis on the chart (2 on the left, 1 on the right).

Describe the solution you'd like Ability to set something like "showAxis: true" on each series and then configure if its on the left or right.

Additional context

Below is a screenshot of the current chart I have in eCharts. This is live and working, but I prefer the lightweight TV chart as the scrolling is far smoother than eCharts.

image

timocov commented 5 years ago

Did you see other our products to display charts https://www.tradingview.com/HTML5-stock-forex-bitcoin-charting-library/ ? There is "Technical Analysis Charts" and there is such feature (demo https://charting-library.tradingview.com/).

We don't plan to add them to lightweight-charts yet.

kobermeit commented 5 years ago

@timocov Thanks, I actually have that TV charting library and currently using it in my product in another section. I just wanted to use lightweight for this chart instead and was hoping it would support this. But if the best solution is to use the full chart library, then that's fine :)

timocov commented 5 years ago

We want to keep lightweight-charts library lightweight 😉. Multiple axis feature is epic for the library and would add a lot of code and would increase the size of the lightweight-charts. Thus, unfortunately, I'm going to close this issue.

Tucsky commented 5 years ago

@timocov what about creating two "overlay series" on the same axis ? without showing that axis on the side, would that fit in the lightweight vision?

Exemple : I have a the price serie, sma, and 3 overlay series, I want to scale thoses 3 series on the same SCALE otherwise seeing them overlapping each other based on their respective range makes very low sense imo. image

timocov commented 5 years ago

without showing that axis on the side, would that fit in the lightweight vision?

If I understand you correctly this is already done in the lightweight-charts.

Tucsky commented 5 years ago

@timocov Well thats would be great, I do hope Im just missing a setting here :)

Let me try explain again: In other word thoses 3 volume series below aren't "locked" in the same volume scale (which actually makes sense because I neved told lightweight-chart to do so), I just called addLineSeries or addBarSeries without telling the chart to create those 3 on the same scale (that setting im looking for)

scaleissue

The green line shouldn't go above the red or red above green as I pan left or right because the top / bottom of the visible point changed

kirchet commented 5 years ago

@Tucsky, for now, there is no way to add an ovelay series to the same scale as other overlay series. Probably we should add this possibility.

Tucsky commented 5 years ago

@kirchet thank you for considering it! Im gonna wait patiently. Thats an awesome lib really, keeping it simple is what makes it so fast and accessible, but thats the only downside ive seen so I had to try :)

timocov commented 4 years ago

Good news everyone! We decided to add possibility to add the second price axis to the chart. If you have some specific requests for that until it isn't in the production - feel free to post your thought here.