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.

This is the image that shows how I want the image < 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 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   

removed 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]);   

Hope this will help you.

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

c# - Call function from DLL -