Skip to content

Commit

Permalink
bucket cost chart tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
andnorda committed Feb 10, 2025
1 parent a97be78 commit 15dc293
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/lib/chart/EChart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
let ins: EChartsType | undefined;
options = { ...defaultOptions, ...options };
options.tooltip = { ...options.tooltip, ...defaultOptions.tooltip };
options.tooltip = { ...defaultOptions.tooltip, ...options.tooltip };
const resize = () => {
ins?.resize();
Expand Down
18 changes: 10 additions & 8 deletions src/routes/team/[team]/(teamPages)/buckets/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import { format } from 'date-fns';
import type { EChartsOption } from 'echarts';
import type { PageData } from './$houdini';
import type { CallbackDataParams, TopLevelFormatterParams } from 'echarts/types/dist/shared';
import { parseImage } from '$lib/utils/image';
interface Props {
data: PageData;
Expand Down Expand Up @@ -93,16 +95,15 @@
): EChartsOption => {
return {
tooltip: {
trigger: data.length > 10 ? 'item' : 'axis',
axisPointer: {
type: 'shadow'
},
valueFormatter(value: number) {
return euroValueFormatter(value);
}
// axisPointer: {
// type: 'shadow'
// },
trigger: 'axis',
formatter: (params: CallbackDataParams[]) =>
`${params[0].name}: <b>${euroValueFormatter(params[0].value as number)}</b>`
},
grid: {
left: '1%',
left: '0',
containLabel: true
},
xAxis: {
Expand All @@ -117,6 +118,7 @@
name: 'Bucket cost',
type: 'line',
emphasis: { focus: 'series' },
symbol: 'none',
data: data.map(({ sum }) => sum)
}
} as EChartsOption;
Expand Down

0 comments on commit 15dc293

Please sign in to comment.