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

77
Views
Is it possible to customize the chart.js y axis?

Nice to meet you. I'm making a chart with version chart.js3.6.2, and I want to make a label-like shape on the y-axis like an image. I tried to use generateLegend, but it was already deleted, where is the center code implemented in 3.x or higher? Thank you.

enter image description here - i want

=========================================

enter image description here - my code

            options : {
                plugins: {
                    
                    legend: {
                        display: false
                    },

                    autocolors: false,
                    annotation: {
                      annotations: {
                        line1: {
                          type: 'line',
                          yMin: 2.2,
                          yMax: 2.2,
                          borderDash: [4, 3],
                          borderColor: 'rgb(255, 99, 132)',
                          borderWidth: 1,
                        }, 
                        line2: {
                          type: 'line',
                          yMin: 2.4,
                          yMax: 2.4,
                          borderDash: [4, 3],
                          borderColor: 'rgb(255, 99, 132)',
                          borderWidth: 2,
                          label: {
                              enabled: true,
                              fontStyle: 'normal',
                              position: 'start',
                              content: 2.2,
                              backgroundColor:  'rgb(255, 99, 132)'
                        }
                        }
                      }
                    }
                  },
                responsive: true,
                spanGaps: true,

                scales: {
                    y: {
                        min:0,
                        max:max,
                        ticks: {
                            stepSize:0.2
                        }                    
                    },
                    x: {
                        grid:{
                            display: false,     
                        }
                    }
                 
                }, 
                gridLines:{
                            lineWidth:0
                        }
            }
        });
    }

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!