Question on Vega Circle plot

Hi,

I'm using Elastic 7.17 version and trying to create Circle visualization using Vega.
I have the below sample data;

[
{"stage":"s1","indicator":"i1","score":3,"maxscore":4},
{"stage":"s1","indicator":"i1","score":1,"maxscore":4},
{"stage":"s1","indicator":"i2","score":2,"maxscore":4},
{"stage":"s1","indicator":"i2","score":0,"maxscore":4},
{"stage":"s1","indicator":"i3","score":4,"maxscore":4},
{"stage":"s1","indicator":"i3","score":4,"maxscore":4},
{"stage":"s2","indicator":"i1","score":3,"maxscore":4},
{"stage":"s2","indicator":"i1","score":1,"maxscore":4},
{"stage":"s2","indicator":"i2","score":4,"maxscore":4},
{"stage":"s2","indicator":"i2","score":0,"maxscore":4},
{"stage":"s2","indicator":"i3","score":3,"maxscore":4},
{"stage":"s2","indicator":"i3","score":0,"maxscore":4}
]

I'm calculating score % for each 'Stage' with some weightage for each 'Indicator' using below formula;

(sum(score,kql='indicator: i1')/sum(maxscore,kql='indicator: i1')*100*0.5)+(sum(score,kql='indicator: i2')/sum(maxscore,kql='indicator: i2')*100*0.3)+(sum(score,kql='indicator: i3')/sum(maxscore,kql='indicator: i3')*100*0.2)

So, for the able sample data, the score% will look like below;
stage1 = 25+7.5+20 = 52.5%
stage2 = 25+15+7.5 = 47.5%

Based on below scoring% range, I need to represent each stage as Red, Yellow and Green
-- 0% - 50% ---> RED
-- 50% - 80% ---> YELLOW
-- 80% - 100% --> GREEN

I'm looking to achieve as below;
Desired_Stage_Score_View

Please let me know;

  1. Can the Circle visualization be achieved using Vega with the Data set and Formula mentioned above?
  2. Can the above score calculation formula be used in Vega as is, if so, how to achieve it (I couldn't find any documentation on the same) ?
  3. Is there any sample Circle Vega code I can refer to (not the 'Arc' mark type) ?

Thanks in Advance!

Using Lens 'Metric' and 'Table' I'm able to achieve below visualizations with the formula, but, couldn't achieve the 'Circular' visualization;

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.