Skip to main content

All Questions

Tagged with
0 votes
1 answer
40 views

Why the legend merged with the d3.js line chart when zooming?

I am trying to add a legend to the d3.js example named Line chart with zoom in d3.js 1°) I added the script: // Add legend rectangle line.append('rect') .attr('x', width - 80) ....
Vincent Schoebrechts's user avatar
0 votes
1 answer
55 views

How to pass ids and names to d3 from rails

As with any rationalized database, the IDs, names and data are stored in separate tables. The current script (below) shows the IDs in the legend but I would like to pass in and show the names. The ...
ASing's user avatar
  • 107
3 votes
1 answer
375 views

Creating a legend for a scatter plot in D3

I have written the following code snippets to create a legend for a scatter plot. Basically, it is a simple example that uses Susie Lu's D3-legend module to create a legend for a scatter plot. The ...
Reem Al-Assaf's user avatar
2 votes
2 answers
48 views

Different shape based on datum

I am trying to append another shape when one of the values satisfy the condition as follows: const keys = ["A", "B", "C", "D", "E", "E", "G"] const colors = ['#1e90ff', '#008000', '#d3d3d3', '#...
Mush-A's user avatar
  • 445
1 vote
1 answer
144 views

How to fix overlapping tick labels for svg legend using D3

I have an color legend created using linear gradient and D3 concept. The issue currently I am facing is that the ticks labels of the legend gets overlapped. I have to show the Min and Max values all ...
Eric's user avatar
  • 133
0 votes
0 answers
94 views

Issue with creating legend if min and max value supplied are not in between 0 and 1

I have created continuous legend using scale Linear in d3js and it works fine. But I also have scenario where min and max value are not in between 0 and 1 but have value [2315, 4516]. So I am passing ...
Eric's user avatar
  • 133
2 votes
1 answer
183 views

How to use logarithm sampling if data are between 0 and 1 to create legend using D3

I am creating an continuous legend(have created using linear gradient) using D3 for linear sampling. Now I have to use same legend for logarithm sampling. But my data are between 0 and 1 as shown ...
Eric's user avatar
  • 133
0 votes
2 answers
271 views

Reverse the direction of the color in linear gradient legend

I have an continuous legend(both vertical and horizontal) and currently the color are flown from red to blue but I want it to be in reverse direction like from blue to red. I have shared by code ...
Eric's user avatar
  • 133
0 votes
0 answers
116 views

How to display svg title content like an list rather than in straight line

I am creating discrete legend using SVG, where I am appending title to the rect to show content on hover but the content of title is displayed in straight line, which I want to come one after the ...
Eric's user avatar
  • 133
0 votes
1 answer
346 views

How to create vertical continuous legend without rotating the legend

I have created the horizontal continous legend using linear gradient. But my legend can be either horizonatl or vertical based on the flag. How can i make same legend vertical but i do not want to ...
Eric's user avatar
  • 133
0 votes
1 answer
460 views

How to avoid overlapping and stack long text legends in D3 graph?

I have D3 graph base on Multi-line graph 3 with v7: Legend, this sample contains few and shorts legends for the graph. In my sample I want to increase the length for legends and stack the data if is ...
Tabares's user avatar
  • 4,247
1 vote
1 answer
2k views

Create d3 linear color legend using d3 colors

I want to create color legend using linear gradient > https://bl.ocks.org/HarryStevens/6eb89487fc99ad016723b901cbd57fde . But how can I pass my d3 colors here because its in the form like d3....
Eric's user avatar
  • 133
1 vote
1 answer
315 views

D3 map legend issue

I am creating a population map of the US. I have the map and legend working, but I made a drop down menu that allows me to filter by race. This works and changes the data on the map and legend, but I ...
Danny Pacheco's user avatar
0 votes
1 answer
562 views

How to use my own color table instead of using d3 color set ( interpolateviridis ) to create legend

I have following set of color table where first value in the first array refers to point and following 3 values are RGB points. Ex: For the point 0.00, the RGB value should be 1.00, 0.00, 0.00. ...
Eric's user avatar
  • 133
0 votes
0 answers
161 views

How do I align tick values/label properly below the tick line

I am working on continuous color legend using d3.interpolateViridis. I have problem in aligning the legend tick values. I want to display my domain values horizontally(below tick but in straign line ...
Harry's user avatar
  • 49

15 30 50 per page
1
2 3 4 5
8