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

240
Views
Show value range in yAxis of nvd3 graph

We have a requirement where instead of showing a whole number we need to show a range in yAxis of nvd3 chart.

For example currently the yAxis values are 100, 200, 300.... 1000 or 150, 300, 450....1500. Instead of showing these whole number we need to show 0-99, 100-199.... 900-1000 or 0-149, 150-299, 300-449.... 1400-1500 etc.

The number of data points are always 10 in yAxis.

How can we achieve this solution ?

Example of a chart -

enter image description here enter image description here

Here is the code :-

 this.chartOptionsProgress = this.ChartHelper.options({
      type: 'multiBarHorizontalChart',
      height: 400,
      margin: {
        top: 10,
        right: 50,
        bottom: 20,
        left: 200
      },
      showValues: true,
      showLegend: false,
      valueFormat: function (d) {
        if (d == 0.01) {
          return "*";
        } else {
          return self.numberFilter.transform(parseInt(d));
        }
      },
      color: function (i) {
        return self.ChartHelper.defaultColors[0];
      }
      },
      showXAxis: true,
      showYAxis: true,
      forceY: [0],
      yAxis: {
        axisLabelDistance: 40,
        margin: {
          top: 30
        },
        tickFormat: (d) => {
          return this.numberFilter.transform(parseInt(d));
        }
      },
      xAxis: {
        margin: {
          right: 100
        }
      }
    });
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!