Skip to content

need to eliminate the default last value of y axis and set manually max value of y axis #6513

Description

@damu9618

Chartjs

here i have attached the image of my bar chart. here last two values y axis is over lapping how i need to solve this problem.

my code:

yAxes: [
        {
          maxBarThickness: barThickness,
          gridLines: {
            drawOnChartArea: false,
            color: gridLineColor,
          },
          ticks: {
            max: progressionBarMax,
            min: progressionBarMin,
            //callback: this.getLastValue,
          },
        },
      ]

 getLastValue(value, index, values) {
    console.log(value);
    console.log(values);
    console.log(index);
    if (index === 0) {
     const step = values[values.length-2] - values[values.length-1]
      return values[1] + step;
    }

    return value;
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions