Linear trend in Bar Chart visualization Vega

(Lidiya Chernova) #1

Hi guys! :wave:

Could you please give a recommendation or an example how can I create a linear trends in my bar chart in Vega?
Maybe there are some functions or templates that I can use?

Here is my graph:

(kulkarni) #2

cc @nyuriks


(Yuri Astrakhan) #3

Hi, I am not aware of any ready-made transformations to help calculate trendline, but judging by the formula, it shouldn't be possible to manually do the needed calculation, and use a rule mark to draw it. I have posted this question in the Vega slack channel, and CCed you on it.

(Lidiya Chernova) #4

Thank you, Yuri. I will try to use a formula.