Comments (6)
Hey,
There are some current capabilities with d2b to add sunburst labels and disable click zooming. Here is a fiddle that uses that functionality. https://jsfiddle.net/3cyeddyp/
Right now the annotations are limited to the axis chart components (e.g. bar, line, area, scatter, ..). I would like to add built in annotation hooks to the other charts, but I'm still considering how this should be done. The main issue is that the annotations are rendered in SVG, so a large chart padding would need to be added around the sunburst to allow room for the annotations. This might make it a bit unusable for mobile devices, so an extra configuration would need to be added to disable annotations and padding given some mobile threshold.
This is definitely something I'd like to add in the near future though so stay tuned. Thanks for checking out d2b 👍.
from d2b.
Ohh, that's awesome, thanks for the quick answer ! I agree, the annotations may lead to weird behavior on mobile/small screens.
But without the annotations, the label are really hard to read IMHO. Let me know if you need some tests/ideas ;-)
Also, I have another question : is it possible to not have the root displayed ? I mean not having a root node displayed, but directly few nodes on the same level ?
from d2b.
About the label/zoom, I already tried to modify these config, but I didn't succeed.
I'm using the vue integration, and set this in my data
chartConfig: function (chart) {
chart.show_labels(true),
chart.zoomable(false)
},
But it looks like I'm not able to access these attributes (if I set them with chart.zoomable = false
I haven't errors, but it doesn't work)
from d2b.
Ah, you are using Vue. Here is the updated fiddle with Vue integration: https://jsfiddle.net/3cyeddyp/3/
There is extra configuration in there for doing other things with the sunburst (like hiding the root node, and eliminating the donut). Go ahead and play around with it to see what you need.
The main thing with your snippet is that you need to access chart.sunburst()
which returns the internal d2b.svgSunburst
rather than d2b.chartSunburst
. This has the showLabels
and zoomable
configurations.
chartConfig: function (chart) {
chart.sunburst()
.showLabels(true),
.zoomable(false)
},
from d2b.
One other thing, if you are looking to hide the breadcrumbs there is configuration for that in this fiddle: https://jsfiddle.net/3cyeddyp/4/
from d2b.
Thanks a lot for your quick and detailed answers ! :)
from d2b.
Related Issues (20)
- X axis doesn't start at first datapoint, and doesn't end at last datapoint. HOT 15
- add format prop for sunburst HOT 3
- Sunburst colors. HOT 3
- Zoomable sunburst ring sizes in zoomed form are visually misleading. HOT 13
- Chart.sunburst() configuration sorting. HOT 5
- Inner labels in pieChart HOT 3
- How to format axis labels? HOT 1
- Using a band scale with barchart, triggers tooltips in the wrong position. HOT 4
- How to hide/remove legend ? HOT 2
- How to set initial position of nodes in sankey diagram? HOT 1
- Add example to sort bar chart HOT 10
- Import Problem
- Radial color gradients within arcs
- d2b.chartSankey node click listener
- Sunburst mobile clicks HOT 1
- Graph Stacking With Single Graph HOT 1
- events on charts in Vue HOT 13
- Import problem HOT 6
- cannot read property 'filter' of undefined when using vueChartPie HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d2b.