ZingChart: Floating Bar Chart
Asked Answered
H

1

7

Does ZingChart support a floating bar chart? This would be similar to their waterfall, but giving control over colors and labels.

E.g. http://www.amcharts.com/demos/floating-bar-chart/

I'm looking for something like this, but with a time based series. Currently I use a Google "Timeline" chart to achieve this, but find their implementation buggy with respect to color assignment:

https://developers.google.com/chart/interactive/docs/gallery/timeline#labeling-the-bars

Thank you.

Hafner answered 4/8, 2015 at 15:11 Comment(0)
L
7

ZingChart does not have "Floating Bars" as a standard chart type, but you can easily achieve the same functionality with the hbar chart type. The offsetValues property controls the start point of a bar, and the values controls the end points.I have created a demo of this functionality here : http://demos.zingchart.com/view/SHJBSDJI

Feel free to reach out if you have any further questions - I am on the ZingChart team.

Loggins answered 4/8, 2015 at 16:7 Comment(4)
Thanks @coddee. I'll try this out. Is there a way to control the colours on your waterfall chart? That would give me what I'm looking for as well. I see there is an "options" hash available for your chart types, but I've not had a lot of luck tracking down documentation on that object.Hafner
@Hafner For waterfall, we don't have a ton of documentation at the moment (we are working on a huge overhall) but I can point you to the zingchart.com/docs/chart-types/waterfall page. The options object has positive, negative, intermediate values. Under the hood, it's actually just a vertical-bar with some additional attributes. That means you can style each chart in a similar way you can style bar charts.(zingchart.com/docs/json-attributes-syntax/graph-objects/…) Here's a demo : demos.zingchart.com/view/1M3VLVG6Loggins
Am I right to assume that "positive" value colors must be the same for all positive values? Can they vary?Hafner
@Hafner Positive values must be the same color. If you really wanted to change the colors for each group, you will have to dig a bit deeper into the library's functionality to create your own visualization. My suggestion would be to use a standard vertical bar chart, utilize the method in the original post with offsetValues and values to adjust the placement of the bars. You can then add "rules" and "tokens" to each of the bars and to color them any way you want (Use the token %i and change the background color for each %i == n). More info : zingchart.com/docs/features/rulesLoggins

© 2022 - 2024 — McMap. All rights reserved.