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

256
Views
JS amChart establece la resolución del cursor en minutos y mantiene el eje en días

Estoy configurando un formato de fecha personalizado para la información sobre herramientas de dateAxis para mostrar la hora/min/seg.

Si solo configuro un día con diferentes horas, se representa como se esperaba y puedo ver la hora adecuada en la información sobre herramientas. Sin embargo, si configuro más de un día en los datos (eso es lo que se necesita), siempre veo las 12:00:00 como hora, y solo puedo mover el cursor de un día a otro, y no a cada punto en el datos (tiempo diferente).

Entonces, la escala en días está bien. Sin embargo, ¿cómo puedo mover el cursor a cada punto de los datos y mostrar también la hora?

ingrese la descripción de la imagen aquí

 function amRangeAreaChart() { am4core.ready(function () { am4core.useTheme(am4themes_animated); var chart = am4core.create("amLineChart", am4charts.XYChart); chart.hiddenState.properties.opacity = 0; // this creates initial fade-in var data = []; var open = 100; var close = 250; for (var i = 1; i < 30; i++) { open += Math.round((Math.random() < 0.5 ? 1 : -1) * Math.random() * 4); close = Math.round(open + Math.random() * 5 + i / 5 - (Math.random() < 0.5 ? 1 : -1) * Math.random() * 2); data.push({ date: new Date(2018, 1, i, 11, i, i), open: open, close: close }); } chart.data = data; var dateAxis = chart.xAxes.push(new am4charts.DateAxis()); var valueAxis = chart.yAxes.push(new am4charts.ValueAxis()); valueAxis.tooltip.disabled = true; var series = chart.series.push(new am4charts.LineSeries()); series.dataFields.dateX = "date"; series.dataFields.openValueY = "open"; series.dataFields.valueY = "close"; dateAxis.tooltipDateFormat = "yyyy-MM-dd / hh:mm:ss"; series.tooltipText = "temp: {openValueY.value}"; series.sequencedInterpolation = true; series.fillOpacity = 0.3; series.defaultState.transitionDuration = 1000; series.tensionX = 0.8; var series2 = chart.series.push(new am4charts.LineSeries()); series2.dataFields.dateX = "date"; series2.dataFields.valueY = "open"; series2.sequencedInterpolation = true; series2.defaultState.transitionDuration = 1500; series2.stroke = chart.colors.getIndex(6); series2.tensionX = 0.8; chart.cursor = new am4charts.XYCursor(); chart.cursor.xAxis = dateAxis; chart.scrollbarX = new am4core.Scrollbar(); });

}

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!