Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few questions on current capabilities of Graphic #38

Closed
tlvenn opened this issue Jan 3, 2022 · 3 comments
Closed

Few questions on current capabilities of Graphic #38

tlvenn opened this issue Jan 3, 2022 · 3 comments

Comments

@tlvenn
Copy link

tlvenn commented Jan 3, 2022

First of all, thanks a lot for this fantastic library !
I am currently evaluating Graphic to see it it would be a good fit / foundation to power graphing stock charts.

image
Looking at a very simple graph from tradingview, after looking at the example and experimenting a bit, I am wondering if the following is currently possible:

1. Alignment of the vertical axis
Pretty much all stock charts display the Vertical Axis on the right side instead of the left side. It does not seem to be supported at the moment.

2. Graph elements with different kind on the Y axis
For example, the volume bars in this graph, I am not sure how to proceed and if this is supported at all for now.

3. Stacked elements sharing the same X axis
I have the feeling this is is definitely not implemented at the moment but I could be wrong again.

Thanks a lot in advance for your guidance.

@entronad
Copy link
Owner

entronad commented Jan 3, 2022

Thanks for your attention.

  1. The right alignment can be set by position: 1 (Which means at the end of the cross axis) and flip: true (Which means labels at the right side of the axis line) in the axis specification.

  2. Multiple elements can be in the same chart. In your case, you need three in the elements list: a LineElement for price, a AreaElement with the same data of LineElement for gradient shadow, and an IntervalElement for volume. You can set axis and scale for each of them.

  3. I have to say your feeling is right. It is not possible to set two sub-charts in a chart (called "facets" in visualization) or let two
    different charts have a corresponding x axis now. That involves complex layout or data channel rules, which need a lot of work. They may be implemented in the future.

@tlvenn
Copy link
Author

tlvenn commented Jan 4, 2022

Ha awesome, thanks a lot for your prompt reply @entronad , 1 & 2 are very important to me and to a graph in general so very glad to know that this is actually already supported. I will try to create a PR and modify one example to demonstrate each.

As for 3, I don't really need it right now but for sure it would be very neat in the future but I get this is more complex. Facets (did not know that word was used in that context when it comes to visualization / graph) is definitely what I would be interested in.

This demo from ECharts has it, the declaration of the graph might give you some ideas or you actually might know how you want to expose it already but I am linking it just in case it is useful. They are basically declaring multiple X & Y axis and mapping elements (series in their language) to each. Of course I understand that most of the complexity comes from actually doing something useful with it 😄

https://echarts.apache.org/examples/en/editor.html?c=candlestick-brush

@entronad
Copy link
Owner

About corresponding of the price chart above and volume chart below, it has been possible in v0.9.0 by a method called Interaction Channel:


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants