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
Composed charts #139
Comments
I recently asked the same thing and then answer is 'not right now' https://twitter.com/jstahlman/status/939260265618706435 |
I've started something on #116, but it involves far more work than I expected :/, I'm planning to re-introduce this in a more progressive way. |
@plouc what is the progress now? |
@stahlmanDesign @ellipticaldoor do you guys solve this problem? |
Unfortunately, there is no proper guides on how to do it, but if you have a look at the code for each component, you could be able to build composed charts. |
@plouc so where I can find the layout Component? |
I'm adding some, for example https://github.com/plouc/nivo/blob/master/packages/parallel-coordinates/src/ParallelCoordinatesLayout.js. |
For now, the best you can do is having a look at the components and extract the relevant pieces, not really handy I admit :/ |
I've started to introduce a For now, it's supported on If you're willing to contribute on other components, please do not hesitate :) |
Oh, great! I'll try to take a look at adding |
And now, thanks to @ncknuna, we have |
Has anyone got a link similar to the |
Ok, here is an example I've written that is vaguely similar to what OP wanted. |
Thank you @pfreedmanJG! I've used your example as a base to reproduce what @ellipticaldoor wanted to achieve => https://codesandbox.io/s/m4ro13jjn8 |
@plouc That's great, I was wondering how to get circles rendering on top of the points! |
@plouc sorry for the slight off-topic, but why your codepen example only works if x value contains series of integers "0", "1", etc. If I change it to anything but integers it breaks inside xScale(index). |
@yojeek, because the bar chart only supports ordinal values for now, other charts (line, scatterplot) support other types like linear/time/log scales. |
@yojeek, sorry I don't respond to emails, please use GitHub instead. I had a look at the example, and fixed it => https://codesandbox.io/s/zrk1o3j29p, the problem was the use of |
@plouc are you giving supporting other |
@plouc Would it be best to support an entirely new Composite chart container instead of making Bar chart as the primary container? So it controls the layers and knows what layers to strip off from the inner charts. There might be other benefits. |
@simoami, some charts supports the same layer ids, but contains different things, but not every chart share the same layers as others. Also nivo provides specific packages for each chart type, and this approach assumes that all chart types are installed. |
Thanks @plouc. I was just throwing an idea in case it offers a predictable composition. To not be aware of charts, you could have an explicit declaration. |
- add layer to bar chart rendering D3 line - generating line using portion of bars (to avoid issue caused by grouped data) - rendering breaks if first user is missing rating values - Reference: plouc/nivo#139
- add layer to bar chart rendering D3 line - generating line using portion of bars (to avoid issue caused by grouped data) - rendering breaks if first user is missing rating values - Reference: plouc/nivo#139
@plouc is it possible to add tooltip to Line chart in such approach? |
@plouc same question as above, is there a way to make the tooltips show up for both the bar and line chart? @VolodymyrKornetskyi did you have any luck solving that? |
@andreas-ateles you could probably achieve this in your custom layer, you could for example use the |
@plouc Is it possible to add a right axis corresponding to the line layer in this type of chart?https://codesandbox.io/s/zrk1o3j29p |
@plouc Scatterplot with The changed ResponsiveScatterPlot settings:
Custom Line layer excerpt:
Error produced:
The x values are, in both cases, simply M-D date formats, e.g. 4-23 I'm working with Scatterplot version 0.72, and can provide a CodePen if needed. |
Hi, I made an example of a combined bar with a line chart. I also added a tooltip - I made a combined tooltip for both values, but there are many different possibilities here... @plouc, thank you for making the code easy enough to navigate :) |
Can I compose two different charts into one?
Like for example drawing a line in a bar chart.
The text was updated successfully, but these errors were encountered: