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

317
Views
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
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!