kurkle / chartjs-plugin-gradient

Easy gradients for Chart.js
MIT License
37 stars 6 forks source link

Chart with stacked scales has got a different coloring than expected #8

Closed stockiNail closed 2 years ago

stockiNail commented 2 years ago

The gradient size is based on chart area but, being the plugin bound to a scale and being a chart configured with stacked scale, the coloring is not as expected.

Plugin options:

gradient: {
  backgroundColor: {
    axis: 'y',
    colors: {
      0: 'green',
      50: 'blue',
      100: 'red'
    }
  }
}

Currently (chart area based):

gradientChartArea

Expected:

gradientScale