Comments (6)
Thanks for filing this, @lipingyang-geoai!
It looks like it may be confused between alphabetical and numeric order... notice that the colors are contiguous e.g. from 1,10 to 1,19 on the chart (slice 2-11 clockwise from the top), but have gaps where alphabetic and numeric order disagree.
EDIT: numeric order would make the colors contiguous, and make more sense for this example, but it is the multikeys that cause the legend to differ from the chart.
from dc.js.
Thanks, Gordon @gordonwoodhull, still not able to figure this out. I checked all three sunburst examples on the dc.js examples page, seem all sunburst chart has the same issue, the color scheme of the legend does not match that of the chart. Is that the way it should be?? Thanks.
from dc.js.
Whoops, meant to look at the last week. Will try to look tomorrow!
Should not be complicated, probably a scale configured wrong or something.
from dc.js.
sounds great. look forward to your suggestions!
from dc.js.
I haven't dug into the exact cause here, but it looks like you can get consistent colors by making sure the colorAccessor
for the sunburst chart uses the last part of the key:
.colorAccessor(d => {
var key = d.key;
if(Array.isArray(key))
key = key[key.length-1];
return key;
})
I am not sure why it is sometimes getting called with a scalar number and sometimes with the multikey array. This probably has something to do with the problem!
I quickly tried pasting the above code into the other three sunburst examples, and it seems to fix them. Presumably it could be changed in the sunburst constructor, which currently uses the key accessor for the color accessor:
dc.js/src/charts/sunburst-chart.js
Line 66 in 0412000
However, there may be a cleaner fix, so let's leave this open in case someone wants to investigate why this is happening.
from dc.js.
@gordonwoodhull Thank you so much, Gordon, You ROCK! it works! Ok, I will leave this issue open. But Thank you so much again! Very best!
from dc.js.
Related Issues (20)
- DataCount issues improper warning HOT 3
- Stacked bar chart legend label alignment is off in Chrome HOT 3
- Bar charts with rangeChart breaks mouse zoom on second render call. HOT 1
- "brushing on ordinal bar chart" example row chart animation is very slow HOT 4
- Line chart can't renderData point and Brush at same time HOT 3
- 2.x support - crossfilter.quicksort removed in [email protected]
- dc built in wordcloud for dc v4 possible?
- array filter feature in dc.js, how to handle when the .dimensions function takes multiple dimensions? HOT 3
- dc sunburst chart - externalLabels not working
- Seeking new maintainers HOT 5
- vulnerability: d3-color:2.0.0: 1084597(10.0)
- High vulnerability found in d3-color
- Line chart- multiple lines with multiple datasets HOT 2
- Error: No d3.js compatbility nester registered, load v5 or v6 compability layer. HOT 3
- Does it support faceted graphics? HOT 1
- Tip: make dataTable.columns accept object path
- Brushing/filtering issue since 4.1.0 - Broken example HOT 6
- Is DC v4 compatible with D3 v7? HOT 4
- I have set the users group to read only
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 dc.js.