Skip to content

Commit ae60f5a

Browse files
committed
feat(frontend): style Activity timeline
Adds point styles (square, circle, star) to Activity timeline chart to better visualize datasets. Tooltip now includes counters for packets, flows and bytes together.
1 parent 4774cca commit ae60f5a

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

frontend/src/components/ActivityTimeline.vue

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ const chartOptions = computed(() => {
5050
5151
return {
5252
...CHART_COMMON_OPTIONS,
53+
interaction: {
54+
intersect: false,
55+
mode: 'index',
56+
},
5357
scales: {
5458
x: scaleXOptions,
5559
packets: {
@@ -89,6 +93,7 @@ const chartOptions = computed(() => {
8993
return `${item.formattedValue} ${unit}`
9094
},
9195
},
96+
usePointStyle: true,
9297
},
9398
annotation: {
9499
annotations: {
@@ -143,8 +148,10 @@ const chartData = computed(() => {
143148
yAxisKey: 'packets',
144149
},
145150
borderColor: CHART_COLORS[0],
146-
pointRadius: 4,
147-
pointHitRadius: 5,
151+
pointRadius: 6,
152+
pointHoverRadius: 6,
153+
pointHitRadius: 7,
154+
pointStyle: 'rect',
148155
},
149156
{
150157
label: 'Flows',
@@ -155,8 +162,10 @@ const chartData = computed(() => {
155162
yAxisKey: 'flows',
156163
},
157164
borderColor: CHART_COLORS[1],
158-
pointRadius: 4,
159-
pointHitRadius: 5,
165+
pointRadius: 6,
166+
pointHoverRadius: 6,
167+
pointHitRadius: 7,
168+
pointStyle: 'circle',
160169
},
161170
{
162171
label: 'Bytes',
@@ -167,8 +176,10 @@ const chartData = computed(() => {
167176
yAxisKey: 'bytes',
168177
},
169178
borderColor: CHART_COLORS[2],
170-
pointRadius: 4,
171-
pointHitRadius: 5,
179+
pointRadius: 6,
180+
pointHoverRadius: 6,
181+
pointHitRadius: 7,
182+
pointStyle: 'star',
172183
},
173184
],
174185
}

0 commit comments

Comments
 (0)