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

346
Views
ajusteContenido(); para rightPriceScale - gráficos ligeros

¿Hay alguna forma de ajustar el contenido a la escala de precios correcta en gráficos ligeros? No encontré ninguna información para eso en la documentación.

Estoy tratando de mostrar dos series de datos, pero están en diferentes rangos (decenas de miles frente a decenas)

Aquí está mi jsfiddle. Agradecería cualquier pista. https://jsfiddle.net/05zx4e76/5/

 var chart = LightweightCharts.createChart(tvchart, { width: '600', height: '300', rightPriceScale: { visible: true, borderColor: 'rgba(197, 203, 206, 1)', lockVisibleTimeRangeOnResize: true, }, localization: { locale: 'en-US', }, leftPriceScale: { visible: true, borderColor: 'rgba(197, 203, 206, 1)', lockVisibleTimeRangeOnResize: true, }, grid: { horzLines: { color: '#363C4E', }, vertLines: { color: '#2B2B43', }, }, crosshair: { mode: LightweightCharts.CrosshairMode.Normal, }, timeScale: { borderColor: 'rgba(197, 203, 206, 1)', }, handleScroll: { vertTouchDrag: false, }, layout: { backgroundColor: '#2B2B43', lineColor: '#2B2B43', textColor: '#D9D9D9', } }); chart.applyOptions({ timeScale: { rightOffset: 12, barSpacing: 3, fixLeftEdge: false, rightBarStaysOnScroll: false, borderVisible: false, borderColor: '#fff000', visible: true, timeVisible: true, secondsVisible: false } } );
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Si intenta utilizar la compilación de development en lugar de la de production (simplemente reemplace una cadena en la ruta al paquete independiente), obtendrá un error: Error: Assertion failed: data must be asc ordered by time, index=1, time=1643907722, prev time=1643911322 , eso significa que los datos de su serie de líneas no están ordenados como deberían.

Si ordena sus datos inicialmente o agrega .sort((a, b) => a.time - b.time) junto a la matriz de datos de línea, funcionará como se esperaba.

https://jsfiddle.net/Lfegob51/

about 4 years ago · Juan Pablo Isaza Report

0

Resuelto por lo siguiente:

 chart.priceScale('right').applyOptions({ scaleMargins: { top: 0.96, bottom: 0, }, });

No tengo idea de cómo funciona. La documentación no tiene una descripción adecuada. https://tradingview.github.io/lightweight-charts/docs/api/interfaces/PriceScaleOptions

about 4 years ago · Juan Pablo Isaza Report
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!