score:0
Accepted answer
change your dataset variable and colours here, just pre-populate your required arrays and inject them into d3. i.e. d3.values(dataset)
var dataset = {
weeks: [5,10]
};
var color = d3.scale.ordinal().range(['#ccc','#c33']);
Source: stackoverflow.com
Related Query
- Data model for creating a radial bar chart with d3js
- d3 show labels only for ticks with data in a bar chart
- Creating a radial chart with a different color for each axis label
- How to draw a Bar Chart with time on xAxis and one or more numeric data for yAxis in d3js?
- How to update d3.js bar chart with new data
- d3js timeline chart - with one rectangle block for a scrub
- Data for sunburst charts with d3.hierarchy using D3js v4
- d3js Create legend for bar chart
- d3js stack chart with simple data
- D3 - How to loop through an object with keys for a bar chart
- Grouped bar chart with zoom and updateable data error
- Specifying Ticks on D3 Bar chart with Time Series data and scaleBand
- C3js - combination chart with data labels only for line
- How do I create a multiline chart using d3js with json formatted for nvd3?
- hack for d3 pie chart with 'zero' data
- D3 Grouped Bar Chart with JSON nested data
- Creating a basic bar chart in d3js
- d3.js bar chart with pos & neg bars (win/loss) for each record
- Transitioning a bar chart with negative values for the width
- Stacked Bar Chart with Time Series Data
- Using External json file for creating bubble chart using d3js
- When creating an HTML table with D3, use certain data for a row class rather than cell
- Create a bar chart with local storage data (drawing the bars doesn't work)
- rendering issue in d3 radial bar chart with labels
- How to make dynamic Bar Chart in d3js with angularjs
- Transition for grouped bar chart in d3 when updating the data values
- Prepare nested JSON data for D3 stacked bar chart
- D3 Bar Chart with Variable X and Y(variable width and height for bars)
- Only show first 25 data items in bar chart with d3.js
- d3js bar chart issue when used with jquery mobile
More Query from same tag
- Selected element won't change in d3
- D3 Tooltip on small multiples
- Retrieving data from api (request/node.js) and trying to display it using d3
- d3.js how to dynamically add nodes to a tree
- Chess moves in D3
- Using custom tick lables on x-axis in D3js
- Passing arbitrary column values to D3 visualization when reading data file
- d3js force-directed removal of old links not working with exit().remove()
- D3: What projection am I using? / How to simplify with a null projection?
- D3.js multiple force layout graphs from json file
- How to add d3 (javascript) to a vaadin application?
- how to fill hexagon with background image in d3js?
- In D3 hexbin, increase radius of multiple hexagons with mouseover
- jQuery: event delegation between different parents
- How to omit a data range with no filtering
- d3JS Histogram with ordinal scale
- D3: What is a Bisector?
- viewbox SVG attribute causes graphs to become spaced very far apart
- D3 transition does not run
- Multi line graph with ordinal x-axis
- Find in which polygon a GeoJSON point lies in, in NodeJS
- How do we change the tick values generated by a linear scale in a d3.js line plot?
- d3 counting variable of JSON
- add a new rccord to parallel coordinate chart in d3
- Add circle to line while maintaining drag mechanics
- Changing d3 bullet chart range
- Map reducing a collection of coordinate pairs
- Recreating collapsible force layout using d3 v4
- Push R matrix to D3 to create an animated ellipse chart
- add attribute to a table so I can use css on it