- DC.js - Dashboard Working Example
- DC.js - Legend
- DC.js - Data Grid
- DC.js - Data Table
- DC.js - Data Count
- DC.js - Heat Map
- DC.js - Bubble Chart
- DC.js - Scatter Plot
- DC.js - Series Chart
- DC.js - Composite Chart
- DC.js - Bar Chart
- DC.js - Line Chart
- DC.js - Pie Chart
- DC.js - coordinateGridMixin
- DC.js - marginMixin
- DC.js - colorMixin
- DC.js - capMixin
- DC.js - baseMixin
- DC.js - Mixins
- Introduction to D3.js
- Introduction to Crossfilter
- DC.js - Concepts
- DC.js - Installation
- DC.js - Introduction
- DC.js - Home
DC.js Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
DC.js - colorMixin
colorMixin provides the color support for all the charts, which need to visuapze using colors. The hierarchy of the colorMixin is defined in the diagram below.
colorMixin provides the following pst of methods to work with colors and they are as follows −
colorAccessor( [colorAccessor])
Gets or sets the color accessor function. This will map a distinct color value in the color scale for each data point in the underlying Crossfilter group. The default color accessor is as follows −
mychart.colorAccessor(function (d, i){return i;})
colorDomain( [domain])
Gets or sets the current domain for the color mapping function and it must be suppped as an array.
calculateColorDomain()
Sets the color domain by determining the min and max values of the data element found using the colorAccessor() function.
colors( [colorScale])
Gets or sets a color scale. It accepts the d3.scale.
chart.colors(d3.scale.category20b()); chart.colors(d3.scale.ordinal().range([ red , green , blue ]));
pnearColors(r)
A shortcut method to set interpolated pnear color scale.
chart.pnearColors(["#4575b4", "#ffffbf", "#a50026"]);
ordinalColors(r)
A shortcut method to set the ordinal color scale.
chart.ordinalColors([ red , green , blue ]);Advertisements