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

245
Visualizações
Echarts how to change background color when the first series exceeds the second

I want to change the background color in echarts like that:

example

The dotted line is the average serie. I want to color the first serie when the value exceed the average but I don't find what to use on the documentation.

My options options are like that for now, but only one color because I don't know how to do it

options() {
      return {
        xAxis: {
          type: 'time',
          zlevel: 2,
          boundaryGap: false,
          splitLine: {
            show: true,
          },
          axisLabel: {
            formatter(value) {
              return format(new Date(value), "HH'h'mm", {
                locale: fr,
              })
            },
            inside: true,
            color: '#000',
          },
          axisTick: {
            alignWithLabel: true,
            inside: true,
          },
          min: startOfDay(new Date()),
          max: endOfDay(new Date()),
          interval: 3600000 * 3, // 3 hours in milliseconds
        },
        yAxis: {
          show: false,
          type: 'value',
        },
        series: [
          {
            data: this.dataMeasures,
            type: 'line',
            smooth: true,
            areaStyle: {
              color: '#FDD835',
            },
            lineStyle: {
              width: 0,
            },
          },
          {
            data: this.dataAverage,
            type: 'line',
            smooth: true,
            lineStyle: {
              color: '#000',
              type: 'dashed',
            },
          },
        ],

        grid: [
          {
            left: 0,
            right: 50,
            bottom: 0,
            top: 0,
            containLabel: true,
          },
        ],
      }
    }

Any idea to do that ?

Thank you !

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