samber / chartjs-plugin-datasource-prometheus

📊 Chart.js plugin for Prometheus
https://www.npmjs.com/package/chartjs-plugin-datasource-prometheus
MIT License
109 stars 20 forks source link

Background colour defaults to border colour with more transparency wh… #17

Closed jbarkovic closed 2 years ago

jbarkovic commented 2 years ago

I started using this package, but it looks like options.fill doesn't behave as expected (at least according to my interpretation, which could be wrong).

Current functionality: When options.fill is set to something, the graphs do not render with a fill colour unless the user also specifically defines an array of colours for the backgroundColor property. This is contrary to the behaviour of the borderColor property which conveniently defaults to a 'random' colour for the user.

Proposed Functionality: When a user sets a value for options.fill, the backgroundColor property should default to a more transparent version of the border colour chosen for that data set. This is consistent with normal Graphana behaviour.

I have made a modification to the code that does this after setting options.fill to any Javascript 'truthy' value. It uses the existing commented out fill colours that are, in my eyes, were a good amount of 'more transparent'

samber commented 2 years ago

Thanks for the report. 👌

Let's merge.