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

135
Views
Desplazamiento suave en el gesto del panel de gráficos

Establecí un gesto de panel en el gráfico para hacer que el gráfico se desplace horizontalmente, pero el problema es que cuando el usuario se mueve rápidamente, el gesto moverá el gráfico en un porcentaje muy pequeño, ¿cómo puedo hacer un desplazamiento suave, de modo que si el usuario se mueve rápido, el gráfico se mueve rápidamente también.

Tenga en cuenta que: drawChart() desplazará el gráfico hasta el píxel event.x y volverá a dibujar el gráfico.

Aquí está mi código de gesto panorámico:

 private mobileHandleEvent(event: WindowEvent): boolean { let pos = this._lastPoint = {x: event.pointerPosition.x, y: event.pointerPosition.y}; switch (event.evt.type) { case TouchEvent.START: { if (this._checkButton(event) && this._checkHit(event)) { this._prevPoint = {x: pos.x, y: pos.y}; this._which = event.evt.type === TouchEvent.START ? 1 : event.evt.which; this._state = GestureState.STARTED; this.drawChart(); return true; } break; } case TouchEvent.MOVE: { let offset = this.moveOffset; if (this.isActive()) { offset.x = 1.5 * (pos.x - this._prevPoint.x); offset.y = 1.5 * (pos.y - this._prevPoint.y); let minMoveDistance = this.minMoveDistance; if ((this.horizontalMoveEnabled && Math.abs(offset.x) >= minMoveDistance) || (this.verticalMoveEnabled && Math.abs(offset.y) >= minMoveDistance)) { this._state = GestureState.CONTINUED; this.drawChart(); }} return true; } break; } case TouchEvent.END: { if (this.isActive()) { this._state = GestureState.FINISHED; this.drawChart(); return true; } break; } } return false; }
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!