javascript - Legend in a single line in d3.js -
The following image shows how I want to be like mythological objects in a d3 graph The line should be aligned with.
< P> How do I use the above d3.js? I tried several times to solve this problem. I can not put all items in the same line
Here you can
Just removed Hope this will help you. x and
y is the property of this story and he worked.
var legend = svg.append ("g") .attr ("class", "legend") .attr ("x", w) .attr ("height", 50) .attr ("width", 300) .attr ("transform", "translation (" + (w - 200) + ", -50)"); Used
y and
transform and placed legend on top right corner.
('G'). (Function (D, i) {var g = d3.select (this); g.append ("rect" "(" X ", i * 60) .attr (" y ", 65) .attr (" width " , 10) .attr ("height", 10) style ("fill", color_hash [string (i)] [1]);
x and
y attribute values changed.
G.append ("text") .attr ("x", i * 60 ("Width", 100) style ("fill", color_ship [string (i)] [1]). (Color_Hash [String (i)] [0]);
Comments
Post a Comment