2222 :end-time =" endTime "
2323 @zoom-start =" onZoomStart "
2424 @zoom-end =" onZoomEnd "
25+ @legend-clicked =" onLegendClicked "
2526 />
2627 <KDataTable v-else
2728 :ref =" components [index ].onTableRef "
5556 :end-time =" endTime "
5657 @zoom-start =" onZoomStart "
5758 @zoom-end =" onZoomEnd "
59+ @legend-clicked =" onLegendClicked "
5860 />
5961 <KDataTable v-else
6062 :ref =" components [index ].onTableRef "
@@ -84,11 +86,6 @@ import KPanel from '../../../../core/client/components/KPanel.vue'
8486import KTimeSeriesChart from ' ../../../../core/client/components/chart/KTimeSeriesChart.vue'
8587import KDataTable from ' ../../../../core/client/components/chart/KDataTable.vue'
8688
87- const emit = defineEmits ([' zoom-start' , ' zoom-end' ])
88- // const timeseries = [
89- // { label: 'group1', series: [] }
90- // { label: 'group2', series: [] }
91- // ]
9289const props = defineProps ({
9390 timeSeries: { type: Array , default : () => [] },
9491 xAxisKey: { type: String , default: ' x' },
@@ -102,6 +99,9 @@ const props = defineProps({
10299 exportOptions: { type: Object , default : () => ({}) }
103100})
104101
102+ // Emits
103+ const emit = defineEmits ([' zoom-start' , ' zoom-end' , ' legend-clicked' ])
104+
105105// data
106106const components = ref ([])
107107const startTime = ref (null )
@@ -195,6 +195,9 @@ function onZoomEnd ({ chart, start, end }) {
195195 endTime .value = moment .utc (end)
196196 emit (' zoom-end' , { chart, start, end, zoomHistory })
197197}
198+ function onLegendClicked (legendItem , legend ) {
199+ emit (' legend-clicked' , legendItem, legend)
200+ }
198201function update () {
199202 _ .forEach (components .value , component => {
200203 if (component .chart ) component .chart .update ()
0 commit comments