Logic Machine Forum
PVPC trend graph in visu - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: PVPC trend graph in visu (/showthread.php?tid=4202)

Pages: 1 2 3


RE: PVPC trend graph in visu - icuzz - 17.02.2024

(16.02.2024, 07:21)admin Wrote: There's an option to use gradient fill: https://quickchart.io/documentation/reference/colors-and-backgrounds/#gradient-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')',


    }
  }
  }
}



RE: PVPC trend graph in visu - admin - 19.02.2024

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.


RE: PVPC trend graph in visu - icuzz - 20.02.2024

(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.


RE: PVPC trend graph in visu - icuzz - 01.03.2024

Yeah, got it to what I wanted.