score:0
html elements (like your select/options input) are positioned using css styling -- typically by assigning a "class" (if you want to style several elements the same way), or by "id" (which must be unique within your html document).
so the simplest way to "position" your select list is by including directives like this in the <style>
section of your page:
<style>
#desplegable {
left: 10px;
top: 5px;
}
</style>
less desirable would be to just include those css directives right on the select
element itself, using the d3 style(name, value)
function:
svg.append("select")
.attr("id","desplegable")
.style("left", "10px")
.style("top", "5px")
... etc ...
generally, trying to pixel position html elements is an exercise in frustration -- for both you and your users with different resolution screens and devices. but if you need to give your element some margins or alignment, there are many css directives that should help you get it looking the way you want.
imo, the easiest way to try out different styling is to use f12
to open the browser's dev console -- when you find the element on the page, use the right-hand list of styles to interactively tweak it...
Source: stackoverflow.com
Related Query
- How can I set the position of a drop down list with D3.js?
- D3 How to update the chart after selection from drop down menu with new data
- How to make drop down (mouseover) list (made with D3) stay longer?
- How can I bring a circle to the front with d3?
- d3.js - How can I set the cursor to hand when mouseover these elements on SVG container?
- MultiBar chart with nvd3 / d3 only shows labels for every other tick on the x-axis. How can I get them all to show up?
- How can I show a graph using d3 force layout with initial positions set and no movement at all?
- How can I start with all the nodes collapsed in d3js?
- How can I set min/max of the x-axis in Rickshaw / D3?
- How can I set the each line color or width in SVG path
- putting the country on drop down list using d3 via csv file
- Using Javascript D3 library, how can I determine mouse position in data set of an area element on mousemove event?
- With D3, how can I set attribute ("fill", "none") of axis path and line, but not text (without editing stylesheet)
- How can I make my lines spin with the globe?
- How can I dynamically change the position and the size of direction arrows on a directed d3.js force layout?
- Using d3 in meteor on windows 8.1, how can I display a world map, zoomed in on the US, with country borders and US state borders?
- How can I offset the initial starting position of a d3 zoom?
- How can I make the animation of a circle continous with hovering like this gif in d3.js?
- How to set default value appearing in dropdown list with D3?
- How can I apply a clipPath in SVG with multiple paths and NOT clip out the area between the paths?
- How to set the last option from a drop-down list as selected using D3.js
- How can I set the transform origin to the middle of this rectangle in D3?
- How can I detect panning and zooming by the user with d3 zoomBehavior?
- How can I set the background color of a svg element which contains a D3 heat map?
- How can you change the height of an x-axis with d3.js
- How can i set the tick text of x-axis between bar in a bar chart in c3.js or d3.js?
- How can I create a basic bar chart with unique counts on the y axis and a category on the x axis?
- D3: How can I cause the stroke of an SVG path generated with D3 to be clipped to the interior of the same path?
- D3.js - How to create transitions with drop down control for donut chart?
- How can I use the latest version of the d3 js library with Angular Dart?
More Query from same tag
- How to display two d3 wordclouds on one page
- I want to redraw dots every time I click update
- Adding a title to child element of svg:g element in D3.js
- D3.js chart responsive behavior
- Download pdf/word button javascript /jquery
- D3 / Javascript
- NVD3 - Pie Chart - Disable Hover and Where to Find Options
- How to get abbreviated month name as X-axis in Linechart in DC.js
- d3js : how to put circles at the end of an arc
- d3.js, how to draw multiple circles at the same (lat,long)?
- D3.js: Cannot make Y axis scrollable and X axis fixed
- d3.js scatter plot - zoom/drag boundaries, zoom buttons, reset zoom, calculate median
- path not drawn in d3 stacked area chart
- d3js: Unable to place horizontally bars within the axis
- D3: .transition() not working with events
- Bootstrap and D3 problems
- D3: Add border around clip-path
- d3 data selection for creating a simple chart
- d3.json console.log returns undefined or JSON.parse returns unexpected character at line 1
- D3: How to handle zooming and tooltips in a single chart?
- How do I tell d3 to not repeat values in ticks?
- Transition of labels in D3.js: Rename label names on change and transition smoothly
- How to update d3 graphics if I load from external data?
- On making chart responsive the x,y axis line disappears
- y scale in scatterplot scales y axis differently than y values D3.js
- D3.js hierarchy calculated summary by field
- d3 x scale and labels at the bottom
- How to draw circles at different times with D3js?
- d3js w3c selector
- d3js How to make Grids as `dotted` or `dashed`?