Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

253
Views
El elemento d3.select da nulo al acceder en vuejs

Estoy tratando de volver a escribir el código a continuación en vuejs.

 var tooltipLine = d3.select('#groupG').append('line') var x = d3.time.scale().range([0, that.width]); x.domain([that.graphData[0].soldOn, that.graphData[that.graphData.length - 1].soldOn]); const date = x.invert(d3.mouse(tooltipBox.node())[0]); tooltipLine.attr('stroke', 'black') .attr('x1', (Math.ceil(x(date)/that.barWidth) * (that.barWidth/2)) + (Math.floor(x(date)/that.barWidth) * (that.barWidth/2))) .attr('x2', (Math.ceil(x(date)/that.barWidth) * (that.barWidth/2)) + (Math.floor(x(date)/that.barWidth) * (that.barWidth/2))) .attr('y1', 0) .attr('y2', that.height);

En Vuejs (en la sección de plantillas)

 <line stroke="none" id="tooltip-line" :x1="x1" :x2="x2" y1="0" :y2="height"></line> computed: { x1() { var x = d3.time.scale().range([0, this.width]); x.domain([this.graphData[0].soldOn, this.graphData[this.graphData.length - 1].soldOn]); console.log("Tooltip Line", this.tooltipLine); //this leads to null const date = x.invert(d3.mouse(this.tooltipRect.node())[0]); return (Math.ceil(x(date)/this.barWidth) * (this.barWidth/2)) + (Math.floor(x(date)/this.barWidth) * (this.barWidth/2)); } }

Por favor, compruebe la salida a continuación:

La información sobre herramientas en vuejs d3.select('#tooltip-line') da nulo Información sobre herramientas en vuejs

Información sobre herramientas en JS d3.select('#groupG').append('line') da objeto de línea Información sobre herramientas en JS

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!