This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

PVPC trend graph in visu
#41
(16.02.2024, 07:21)admin Wrote: There's an option to use gradient fill: https://quickchart.io/documentation/refe...ient-fills

How to get the syntax right? And how to add the height options for different colors?

Code:
local params = {
  type = 'bar',
  data = {
    labels = labels,
    datasets = {
      {
        label = 'Price',
        data = data,
          backgroundColor = 'rgb(255, 99, 132)',
        borderColor = 'rgb(255, 99, 132)',
          backgroundColor = 'getGradientFillHelper('vertical', '#36a2eb', '#a336eb', '#eb363')',


    }
  }
  }
}
Reply
#42
Check the example for the correct syntax. Copy the line with getGradientFillHelper as is then modify the colors as needed.
There are no height options, the color positions are set proportionally. For 3 colors the first one is at 100% height, second at 50% height, third at 0% height.
Reply
#43
(19.02.2024, 06:01)admin Wrote: Check the example for the correct syntax. Copy the line with getGradientFillHelper as is then modify the colors as needed.
There are no height options, the color positions are set proportionally. For 3 colors the first one is at 100% height, second at 50% height, third at 0% height.

Ok, couldn't get it to work, but also I would like the colors be at static y-axis values, while still having scaling in the y-axis. So not a solution for me.
Reply
#44
Yeah, got it to what I wanted.

Attached Files Thumbnail(s)
   
Reply


Forum Jump: