@@ -58,12 +58,21 @@ export function getOverviewVisualizationSpec(
58
58
title : 'Count' ,
59
59
axis : { grid : true , ticks : false } ,
60
60
} ,
61
+ tooltip : [ { field : 'finding' , aggregate : 'sum' , type : 'quantitative' , title : 'Findings' } ] ,
61
62
} ;
62
63
63
- if ( groupBy === 'log_type' ) {
64
- findingsEncoding [ 'color' ] = { field : 'logType' , type : 'nominal' , title : 'Log type' } ;
64
+ if ( groupBy === 'logType' ) {
65
+ findingsEncoding [ 'color' ] = {
66
+ field : 'logType' ,
67
+ type : 'nominal' ,
68
+ title : 'Log type' ,
69
+ scale : {
70
+ range : euiPaletteColorBlind ( ) ,
71
+ } ,
72
+ } ;
65
73
}
66
74
75
+ const lineColor = '#ff0000' ;
67
76
return getVisualizationSpec (
68
77
'Plot showing average data with raw values in the background.' ,
69
78
visualizationData ,
@@ -75,11 +84,16 @@ export function getOverviewVisualizationSpec(
75
84
{
76
85
mark : {
77
86
type : 'line' ,
78
- color : '#ff0000' ,
87
+ color : lineColor ,
88
+ point : {
89
+ filled : true ,
90
+ fill : lineColor ,
91
+ } ,
79
92
} ,
80
93
encoding : {
81
94
x : { timeUnit, field : 'time' , title : '' , axis : { grid : false , ticks : false } } ,
82
95
y : { aggregate, field : 'alert' , title : 'Count' , axis : { grid : true , ticks : false } } ,
96
+ tooltip : [ { field : 'alert' , aggregate : 'sum' , title : 'Alerts' } ] ,
83
97
} ,
84
98
} ,
85
99
]
@@ -135,6 +149,7 @@ export function getFindingsVisualizationSpec(
135
149
{
136
150
mark : 'bar' ,
137
151
encoding : {
152
+ tooltip : [ { field : 'finding' , aggregate : 'sum' , type : 'quantitative' , title : 'Findings' } ] ,
138
153
x : {
139
154
timeUnit : dateOpts . timeUnit ,
140
155
field : 'time' ,
@@ -176,6 +191,7 @@ export function getAlertsVisualizationSpec(
176
191
{
177
192
mark : 'bar' ,
178
193
encoding : {
194
+ tooltip : [ { field : 'alert' , aggregate : 'sum' , title : 'Alerts' } ] ,
179
195
x : {
180
196
timeUnit : dateOpts . timeUnit ,
181
197
field : 'time' ,
@@ -210,7 +226,30 @@ export function getTopRulesVisualizationSpec(visualizationData: any[]) {
210
226
return getVisualizationSpec ( 'Most frequent detection rules' , visualizationData , [
211
227
{
212
228
mark : { type : 'arc' , innerRadius : 90 } ,
229
+ transform : [
230
+ {
231
+ joinaggregate : [
232
+ {
233
+ op : 'sum' ,
234
+ field : 'count' ,
235
+ as : 'total' ,
236
+ } ,
237
+ ] ,
238
+ } ,
239
+ {
240
+ calculate : 'datum.count/datum.total' ,
241
+ as : 'percentage' ,
242
+ } ,
243
+ ] ,
213
244
encoding : {
245
+ tooltip : [
246
+ {
247
+ field : 'percentage' ,
248
+ title : 'Percentage' ,
249
+ type : 'quantitative' ,
250
+ format : '2.0%' ,
251
+ } ,
252
+ ] ,
214
253
theta : { aggregate : 'sum' , field : 'count' , type : 'quantitative' } ,
215
254
color : {
216
255
field : 'ruleName' ,
0 commit comments