Skip to content

Commit e6ae05a

Browse files
committed
fix: typecheck
1 parent 86ab06e commit e6ae05a

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

packages/analytics/analytics-echarts/src/components/BaseAnalyticsEcharts.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,13 @@ import type { ECBasicOption } from 'echarts/types/dist/shared'
5656
const {
5757
option,
5858
enableBrush = false,
59-
zoom = false,
6059
granularity = undefined,
6160
zoomActionItems = undefined,
6261
theme = 'light',
6362
renderMode = 'svg',
6463
} = defineProps<{
6564
option: ECBasicOption
6665
enableBrush?: boolean
67-
zoom?: boolean
6866
granularity?: GranularityValues
6967
zoomActionItems?: ZoomActionItem[]
7068
theme?: 'light' | 'dark'

packages/analytics/analytics-echarts/src/components/CrossSectionChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const { option } = composables.useExploreResultToEChartCrossSectional({
4242
exploreResult: toRef(() => data),
4343
chartType: toRef(() => type),
4444
stacked: toRef(() => stacked),
45-
colorPalette,
45+
colorPalette: toRef(() => colorPalette),
4646
tooltipState,
4747
})
4848
</script>

packages/analytics/analytics-echarts/src/composables/useExploreResultToEChartTimeseries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
import composables from '.'
1313
import type { ECBasicOption } from 'echarts/types/dist/shared'
1414
import type { TooltipState } from 'src/components/ChartTooltip.vue'
15-
import type { Threshold, ThresholdType } from 'src/components/AnalyticsEcharts.vue'
15+
import type { ThresholdType, Threshold } from 'src/types'
1616

1717
// types
1818
type DatasetLabel = { id: string, name: string }

packages/analytics/analytics-echarts/src/composables/useExploreResultToEchartCrossSectional.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function useExploreResultToEChartCrossSectional({
2424
chartType: Ref<ReportChartTypes>
2525
tooltipState: Ref<TooltipState>
2626
stacked?: Ref<boolean>
27-
colorPalette?: Ref<string[]> | Ref<Record<string, string>>
27+
colorPalette?: Ref<string[] | Record<string, string> | undefined>
2828
}) {
2929
const { i18n } = composables.useI18n()
3030

@@ -40,7 +40,6 @@ export default function useExploreResultToEChartCrossSectional({
4040
const dimensionKeys = display && Object.keys(display)
4141
const isMultiMetric = metricNames && metricNames.length > 1
4242
const hasDimensions = display && dimensionKeys && dimensionKeys.length > 0
43-
const isMultiDimension = hasDimensions && dimensionKeys.length > 1
4443

4544
if (!records.length || !metricNames) {
4645
return { series: [], xAxis: {}, yAxis: {} }
@@ -201,6 +200,11 @@ export default function useExploreResultToEChartCrossSectional({
201200
data,
202201
itemStyle: { color: baseColor },
203202
stack: stacked.value ? 'total' : undefined,
203+
label: {
204+
show: true,
205+
position: stacked.value ? 'inside' : 'top',
206+
formatter: '{c}',
207+
},
204208
selectedMode: 'single', // or 'multiple' if you want multi-select
205209
select: {
206210
itemStyle: {
@@ -238,6 +242,11 @@ export default function useExploreResultToEChartCrossSectional({
238242
itemStyle: { color: baseColor },
239243
stack: stacked.value ? 'total' : undefined,
240244
isSegmentEmpty: dimension.id === 'empty',
245+
label: {
246+
show: true,
247+
position: 'top',
248+
formatter: '{c} requests',
249+
},
241250
selectedMode: 'single', // or 'multiple' if you want multi-select
242251
select: {
243252
itemStyle: {
@@ -327,7 +336,6 @@ export default function useExploreResultToEChartCrossSectional({
327336
type: 'value',
328337
axisLine: { show: true },
329338
},
330-
selectedMode: 'single',
331339
series,
332340
} as ECBasicOption
333341
} catch (err) {

packages/analytics/analytics-echarts/src/utils/colors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { KUI_COLOR_BACKGROUND_NEUTRAL, KUI_COLOR_TEXT_DANGER, KUI_COLOR_TEXT_WARNING_WEAK } from '@kong/design-tokens'
2-
import type { ThresholdType } from 'src/components/AnalyticsEcharts.vue'
2+
import type { ThresholdType } from '../types'
33
interface AnalyticsChartColors {
44
[dimensionValue: string]: string
55
}

packages/analytics/dashboard-renderer/src/components/AnalyticsEchartsRenderer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@chart-data="onChartData"
99
>
1010
<div class="analytics-chart">
11-
<AnalyticsEcharts
11+
<TimeseriesChart
1212
:data="data"
1313
:stacked="chartOptions.stacked ?? false"
1414
:threshold="chartOptions.threshold"
@@ -25,7 +25,7 @@
2525
import type { RendererProps } from '../types'
2626
import QueryDataProvider from './QueryDataProvider.vue'
2727
import { computed } from 'vue'
28-
import { AnalyticsEcharts } from '@kong-ui-public/analytics-echarts'
28+
import { TimeseriesChart } from '@kong-ui-public/analytics-echarts'
2929
import type { AbsoluteTimeRangeV4, ExploreResultV4 } from '@kong-ui-public/analytics-utilities'
3030
3131
const props = defineProps<RendererProps<any> & { extraProps?: Record<string, any> }>()

0 commit comments

Comments
 (0)