JavaScript d3.js and dimple.js two identical elements

I created a chart using the dimple.js library with the following code:

var myChart = new dimple.chart(svg, data);
var x = myChart.addMeasureAxis("x", "x-measure");
x.tickFormat = "%";
var y = myChart.addMeasureAxis("y", "y-measure");
y.tickFormat = "%";
myChart.addSeries(["Attribute", "Category"], dimple.plot.scatter);
myChart.draw();

I'm trying to use d3 to select the x and y axes of the chart to alter them, but the html elements are pretty much identical, so I don't know how to select them individually. Using d3.select('.dimple-axis').attr("id","x-axis"); I've been able to add a unique identifier to the x-axis (the first element listed), but I have no way of selecting the y-axis.

Here's the HTML code:

X-Axis: <g class="dimple-axis" transform="translate(0, 540)" id="x-axis" style="font-family: sans-serif; font-size: 10px;">...</g>

Y-Axis: <g class="dimple-axis" transform="translate(140, 0)" style="font-family: sans-serif; font-size: 10px;">...</g>

Any ideas on how to add an unique id to the y-axis permanently, or somehow select it using d3?

Thanks!

Answer:1

I have a JavaScript associative array, say: var myArray = new Object(); myArray["id1"] = "completed"; myArray["id2"] = "notCompleted"; myArray["id3"] = "started"; How can I update value of each item ...

I have a JavaScript associative array, say: var myArray = new Object(); myArray["id1"] = "completed"; myArray["id2"] = "notCompleted"; myArray["id3"] = "started"; How can I update value of each item ...

  1. update each value in dictionary python
  2. php update each value in array
  3. c# update each value in dictionary
  4. python update each value
  5. sql update different value each row
  6. loadrunner update value on each occurrence
  7. c# update value of each item in list

How can i stop an request which is already being processing in backend ? I am using EXT Js Framework,There are two button , 1.Search button This button queries the back end and fetches the ...

How can i stop an request which is already being processing in backend ? I am using EXT Js Framework,There are two button , 1.Search button This button queries the back end and fetches the ...

I want to calculate the height from the top to the point where i have added link. How can i calculate height for example we use: w = $(window).height(); to calculate the height of window. ...

I want to calculate the height from the top to the point where i have added link. How can i calculate height for example we use: w = $(window).height(); to calculate the height of window. ...

  1. calculate height using weight and bmi
  2. calculate height using distance and angle
  3. calculate height using shadow
  4. calculate height using camera
  5. calculate height using ulna length
  6. calculate height using knee height
  7. calculate height using time
  8. calculate height using css
  9. calculate height using tangent
  10. calculate height using degrees
  11. calculate height using trigonometry
  12. calculate height using bmi
  13. calculate height using pressure
  14. calculate height using weight
  15. calculate height using ulna
  16. calculate height using angle
  17. calculate height using jquery
  18. calculate using height
  19. calculate height building using trigonometry
  20. calculate height mountain using trigonometry

I have a button on my page that, when clicked, will try to go out and download a file from a given URL on a different domain than my page's domain. Sometimes, that download URL will return an HTTP ...

I have a button on my page that, when clicked, will try to go out and download a file from a given URL on a different domain than my page's domain. Sometimes, that download URL will return an HTTP ...