Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improved default ordinal palette #831

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/color-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ as a mix-in for any concrete chart implementation.
**/

dc.colorMixin = function (_chart) {
var _colors = d3.scale.category20c();
var _colors = d3.scale.ordinal().range(
// qualitative 12 color schemes set3 from colorbrewer concatenated+removed grey and light colors
[ '#1f78b4', '#b2df8a', '#cab2d6','#33a02c', '#fb9a99', '#a6cee3' ,'#e31a1c', '#fdbf6f', '#ff7f00',
'#6a3d9a', '#b15928','#8dd3c7', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#bc80bd']);


var _defaultAccessor = true;

var _colorAccessor = function (d) { return _chart.keyAccessor()(d); };
Expand Down
2 changes: 1 addition & 1 deletion web/examples/pie.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
chart
.width(768)
.height(480)
.slicesCap(4)
.slicesCap(15)
.innerRadius(100)
.dimension(runDimension)
.group(speedSumGroup)
Expand Down