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

320
Vistas
Plotly JS How can I draw a line graph that has no beginning before the start point and no end after the last point?

For example I have wrote this code below to generate the following graph:

const trace = {
    x: [-51.0, -50.0, 0.0, 0.6, 0.7, 0.75],
    y: [-100.0, -0.0001, 0.0, 0.0051, 0.0155, 100.0],
    // x: [-50.0, 0.0, 0.6, 0.7, 0.75],
    // y: [-0.0001, 0.0, 0.0051, 0.0155, 100.0],
    type: "scatter",
    mode: "lines+markers",
    name: "diode-curve-graph",
    fill: "tonexty",
  };

  const layout = {
     margin: {
      l: 20,
      r: 10,
      b: 25,
      t: 5,
      pad: 0
    },
    font: {
      size: 11,
      family: "IBM Plex Sans, sans-serif",
      color: "#161b1d"
    },
    modebar: {
      activecolor: "#161b1d"
    },
    xaxis: {
      autorange: true,
      rangemode: "auto",
      zeroline: true,
      ticks: 'outside',
    },
    yaxis: {
      autorange: true,
      rangemode: "tozero",
      zeroline: true,
      tickformatstops: [
        {
          enabled: true,
          dtickrange: [null, 0.01],
          value: ".e"
        },
        {
          enabled: true,
          dtickrange: [0.01, 100],
          value: ".f"
        },
        {
          enabled: true,
          dtickrange: [100, null],
          value: ".e"
        },
      ],
      // ticks: 'outside',
    }
  };

  const config = {
    responsive: true,
    displaylogo: false,
    locale: "pt-BR",
    displayModeBar: false,
    scrollZoom: true
  }

  Plotly.newPlot("diode-curve-graph", [trace], layout, config);

enter image description here

But I'm trying to pass the information that the line is infinity, without beginning and end, like this red line represents:

enter image description here

It could be a simple arrow in the first point and last point pointing to the direction that the lines continues, but I couldn't do it too.

Thanks in advance!

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