question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

colors for choropleth chart according to range

See original GitHub issue

Hi All,

Thanks all for creating a very useful js library. Currently i am working on a project based on choropleth map. I am facing trouble in fixing color Domains

Could anyone help me our for adjusting colors based on range of filtered values.The function in the current library does not seem to be of much help

chart.colorDomain(function() {
    [dc.utils.groupMin(this.group(), this.valueAccessor()),
     dc.utils.groupMax(this.group(), this.valueAccessor())];
});

If a project based on flexible colorDomains has been created please guide me to it.

Thanks all

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
conradleecommented, Oct 31, 2014

The working example for this problem seems to be here: https://groups.google.com/forum/#!msg/dc-js-user-group/6_EzrHSRQ30/r0_lPT-pBsAJ

var chartX = new dc.geoChoroplethChart("chartX");
chartX.on("preRender", function(chart) {
    chart.colorDomain(d3.extent(chart.data(), chart.valueAccessor()));
});
chartX.on("preRedraw", function(chart) {
        chart.colorDomain(d3.extent(chart.data(), chart.valueAccessor()));
});
0reactions
nicornkcommented, Oct 29, 2014

Has somebody a working example for this? Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Design Choropleth Colors & Intervals
The sequential color palette shows five shades of blue to represent the low-to-high range of income levels, and it works best for a...
Read more >
How to Choose Colors for Data Visualizations
In this article, we will describe the types of color palette that are used in data visualization, provide some general tips and best...
Read more >
Get better at using color palettes with choropleth maps
Understanding color palettes for choropleth maps · Sequential. A scale with 5 different steps ranging from light blue to dark blue · Diverging....
Read more >
What to consider when creating choropleth maps
A map with “discrete steps” assigns all your values to one of e.g. five distinctively different color shades. If you want readers to...
Read more >
Continuous color scales and color bars in Python
Color ranges default to the range of the input data and can be explicitly ... with a higher and lower value than the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found