score:1
Accepted answer
All you need is,
var color = ["#aeb3b7", "#aeb3b7", "#aeb3b7", "#aeb3b7",
"#aeb3b7", "#3a6587", "#3a6587"];
and then,
.attr("fill", function(d, i) {
return color[i];
})
Source: stackoverflow.com
Related Query
- d3v4 How can i set a bar chart to distinct colours
- How can i set the tick text of x-axis between bar in a bar chart in c3.js or d3.js?
- How can I set max value(range) for y-axis and bar width of a bar chart using nvd3.js
- D3: How can I change data in an existing bar chart
- How can I set up a d3 chart inside a custom directive in Angular?
- How can I resize my d3.js script? is there a way to put this into a div tag where I can resize my bar chart smaller?
- How can I use D3.js "onClick" event with an nvd3 bar when zoomed in on chart data?
- how i can put more lines in Line Plus Bar Chart using nvd3.js?
- d3 - Bar Chart overlapping my text, how can I reduce the domain so it doesn't?
- How do I set the X values for a singled stacked horizontal bar chart using d3.js?
- How can I make the legend's similar to the stacked bar chart (and change the legend's label) in D3 v6?
- How can I get the d3.js bar chart start from 0 instead of from the top
- How i can move the gridline behind the bar chart ( D3)
- How can I create hierarchical bar chart in d3.js
- How can I create a basic bar chart with unique counts on the y axis and a category on the x axis?
- How can I fix this bar chart sorting?
- How can I update a bar chart in d3.js?
- How can I make a bar chart starting from the 0 point of the y axis and not from the bottom of the svg?
- D3.js Sankey Chart - How can I highlight the set of links coming from a node?
- d3js - Stacked Bar Chart in Horizontal Axis - How do I set x so the bars are seperated?
- How do I set a different range for line chart embedded in a bar chart using d3.js
- How can I add columns as categories in a bar chart using Dimple.js?
- How can I make a triple bar chart using D3?
- how do I set up a grouping query on the server side. I want set up the query so I can use it for a pie chart in front end, using d3js
- How to make exit set on d3 stacked bar chart function properly?
- how can set customize color to pie chart using D3.js?
- How to create a bar chart with C3 that doesn't group all columns in the same set
- How to set up a reference index on horizontal bar chart and transition control
- How to set text color for my d3 chart title?
- d3.js - How can I set the cursor to hand when mouseover these elements on SVG container?
More Query from same tag
- d3.js: how to create "force-directed graph clusters"
- Datamap - retrieve country code based on given x and y coordinates
- Issue creating overlapping multiple pie charts (circular progress bars)
- dc.js reduce space/padding inside svg element
- Change a shadow opacity partially in svg using filters and d3.js
- "stroke-dasharray:x,y;" mess up svg path? (Chrome)
- Inject object d3.js drag and drop
- Extra legend present
- Using D3 Queue to make a cross site call
- Display Pie chart, Grouped and Stacked bar chart in one page
- Mapping in d3 ordinal scales
- How do I draw a zoomable d3 line chart over time?
- d3.scale on JSON Data
- D3.js Traverse Through Nested Array to Find Max Value
- Apply mapping to attached data
- Why getting Undefined value when i compare my input value to csv column
- How to fix the draggable function in a bubble chart with text inside?
- Issues showing tooltips in a dynamic d3 stack bar chart
- unable to create an automatic filling array without writing it manually
- Dynamic variable selection in r2d3
- D3 Hierarchy Links Don't Use Accessor Function
- How can I make 2 different elements in a SVG group have different drag behaviours?
- Child elements not appearing in webpage
- Push R matrix to D3 to create an animated ellipse chart
- TCPDF draws <defs> tags
- Scatterplot keeps copying itself
- Recording and saving an SVG animation as an animated GIF
- D3 Time scales based only on hours and not bound to dates
- D3.JS and mapping buckets
- Understanding d3.js source: stuck at function.call() and "=+"