Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

362
Vistas
Set gradient color to line chart in plotly (js)

How can I set the line to gradient color? I would like to be the minimum value red and the maximum value green, and everything in between should be gradient.

This is my code for setting the data:

// setting the data for the graph
      this.graph.data = [{
        type: 'scatter',
        mode: 'lines',
        y: Array.from(this.dataForGraph.values()),
        x: Array.from(this.dataForGraph.keys()),
      }];

This is the graph related code:

  public graph: any = {
    layout: {
      width: this.eRef?.nativeElement.clientWidth,
      height: 400,
      plot_bgcolor: 'white',
      margin: {
        l: 60,
        r: 30,
        b: 30,
        t: 80,
      },
      xaxis: {
        type: 'date',
      },
      yaxis: {
        title: { text: "Load [MW]" },
        autorange: true,
      }
    },
    data: [

    ],
    
  };
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda