You need to set the
boxColour variable inside the
click handler, otherwise it's only set once and not updated when the colour changes. Changed jsfiddle here.
- Using SVG attributes in variables in d3
- How do you edit the attributes of an SVG symbol using D3?
- How to add an image to an svg container using D3.js
- How do I get the width of an svg element using d3js?
- SVG to PNG Server side - using node.js
- Append SVG canvas to element other than body using D3
- Using ViewBox to resize svg depending on the window size
- How to drag an svg group using d3.js drag behavior?
- IE11 does not accept SVG height and width when using D3
- Get coordinates of mouse click on svg using d3
- Using d3.js svg clipPath not clipping in Angular
- How to show a tooltip with value when mouseover a svg line graph using d3.js?
- Making a SVG Text draggable using d3.js
- Is it possible to set custom attributes of SVG objects as number and not as string?
- Draw an svg arc using d3 knowing 3 points on the arc
- How to get reference to SVG (child) elements nested in another SVG element (parent) using D3?
- Renderer2 does not render SVG element while using d3 js - Angular 4
- Using d3.js to create an SVG at several divs
- Rendering MathML on svg using d3.js
- d3.js - Select node element based on attributes value using .selectAll()
- How to add filled sections to SVG circles using d3.js
- Force simulation is jittery when using svg transforms to update position
- Using D3 to fill an svg with a background image
- Modifying an SVG in HTML using d3
- Is there a performance difference between SVG attributes and styles?
- How to render end ticks always using d3 svg axis
- How do I create a minimap of an SVG using D3 v5 and show the current viewport dimensions?
More Query from same tag
- Display only line intersections of graticule
- manipulating nvd3 chart attributes
- d3: Use of the *name* argument in transition.tween()
- d3.js, applying transitions to data?
- d3 sorting of an array of objects
- d3 pie chart not loading
- Resizing the boxplot
- d3 area graph going out of bounds
- piechart over a map point using d3.js
- D3 multi-line chart line path not displaying: d attribute missing
- Stacked bar graph in D3 using internal JSON variable
- D3 with AngularJs, Multiple charts on same page with different data based on common key
- Using Jquery Mobile to create charts using d3js with fixed width
- Right-justifying an HTML table created in D3
- d3.js Color range for map not displaying as per domain range
- standard coordinates in d3.js
- Customize dc.js date x-axis
- Some clarification on reusable charts
- D3 tooltip not displaying
- Creating clusters in a sortable bar chart in D3
- Add text on hover, image on the svg circle and make the nodes less sticky in a d3 graph
- Using d3 v5, in node console and WebStorm, can't get d3.csv() to work
- Points on a map with D3.js
- Formatting multiple axes in D3 indivdiually
- d3.js:vertical moving line's intersection point with line graph
- D3 v5 - how to set background color of text (only as wide as text)
- D3 fill color using custom scale
- d3JS: Bisecting a Nested Array
- Using check box to enable call drag