Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

271
Visualizações
Chart JS - Add Interpolation points in order to highlight a segment

Background - I'm trying to highlight a Segment of points (via the segment.backgroundColor API) that are not necessarily a part of the graph. if my data is

const data = [{ x: 1, y: 1}, {x: 3, y: 1}, {x: 5, y: 1}] 

I'd like to highlight the segment between x == 2 and x == 4

To do this, I assume it'd be best to manually add {x: 2 y: 1} and {x: 4, y: 1} to the graph.

The problem - I don't know the y values x==2 and x==4 will need to have on the actual graph

My Question - Is there a way to ask charts.js to automatically derive the y values? either through config or the data points themselves, something like:

// NOT ACTUAL CODE
const data = [
  {x: 1, y: 1},
  {x: 3, y: 1},
  {x: 5, y: 1},
  {x: 4 y: 'auto/interpolate'},
  {x: 2, y: 'auto/interpolate'}]
// NOT ACTUAL CODE

or

const datasets =
 [{ data, autoInterpolateMissingPoints: true }] //NOT ACTUAL CODE
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda