Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #258

Merged
merged 20 commits into from
Jul 30, 2023
Merged

Dev #258

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added frontend/src/assets/color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions frontend/src/assets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ export { default as avatar } from './avatar.jpg'

export { default as building } from './building.glb?url'

export { default as color } from './color.png'

export { default as earth_bump } from './earth_bump.png'

export { default as earth_cloud } from './earth_cloud.png'
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/chart/BasicBarChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { onBeforeUnmount, onMounted, ref } from 'vue'
import * as echarts from 'echarts/core'
import { BarChart, type BarSeriesOption } from 'echarts/charts'
import { LabelLayout, UniversalTransition } from 'echarts/features'
import { GridComponent, type GridComponentOption, TitleComponent, type TitleComponentOption, TooltipComponent, type TooltipComponentOption, ToolboxComponent, type ToolboxComponentOption, LegendComponent, type LegendComponentOption, TransformComponent } from 'echarts/components'
import { LabelLayout, UniversalTransition } from 'echarts/features'
import { CanvasRenderer } from 'echarts/renderers'

type EchartsOptions = echarts.ComposeOption<BarSeriesOption | GridComponentOption | LegendComponentOption | TitleComponentOption | ToolboxComponentOption | TooltipComponentOption>
Expand Down
34 changes: 31 additions & 3 deletions frontend/src/components/chart/BasicCandlestickChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
import { onBeforeUnmount, onMounted, ref } from 'vue'
import * as echarts from 'echarts/core'
import { CandlestickChart, type CandlestickSeriesOption } from 'echarts/charts'
import { GridComponent, type GridComponentOption, TitleComponent, type TitleComponentOption } from 'echarts/components'
import { GridComponent, type GridComponentOption, TitleComponent, type TitleComponentOption, TooltipComponent, type TooltipComponentOption, ToolboxComponent, type ToolboxComponentOption, LegendComponent, type LegendComponentOption, TransformComponent } from 'echarts/components'
import { LabelLayout, UniversalTransition } from 'echarts/features'
import { CanvasRenderer } from 'echarts/renderers'

type EchartsOptions = echarts.ComposeOption<CandlestickSeriesOption | GridComponentOption | TitleComponentOption>
type EchartsOptions = echarts.ComposeOption<CandlestickSeriesOption | GridComponentOption | LegendComponentOption | TitleComponentOption | ToolboxComponentOption | TooltipComponentOption>

echarts.use([CandlestickChart, GridComponent, TitleComponent, CanvasRenderer])
echarts.use([CandlestickChart, GridComponent, LegendComponent, TitleComponent, ToolboxComponent, TooltipComponent, TransformComponent, LabelLayout, UniversalTransition, CanvasRenderer])

const el = ref<HTMLDivElement | null>(null)

Expand All @@ -26,13 +27,40 @@ onMounted(() => {
color: '#333',
},
},
legend: {
data: ['data'],
left: 'right',
top: 'bottom',
textStyle: {
color: '#999',
},
},
grid: {
top: '5%',
left: '5%',
right: '5%',
bottom: '5%',
containLabel: true,
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
},
toolbox: {
feature: {
saveAsImage: {},
},
},
xAxis: {
data: ['A', 'B', 'C', 'D', 'E'],
},
yAxis: {},
series: [
{
type: 'candlestick',
name: 'data',
data: [
[20, 34, 10, 38],
[40, 35, 30, 50],
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/chart/BasicLineChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { onBeforeUnmount, onMounted, ref } from 'vue'
import * as echarts from 'echarts/core'
import { LineChart, type LineSeriesOption } from 'echarts/charts'
import { LabelLayout, UniversalTransition } from 'echarts/features'
import { GridComponent, type GridComponentOption, TitleComponent, type TitleComponentOption, TooltipComponent, type TooltipComponentOption, ToolboxComponent, type ToolboxComponentOption, LegendComponent, type LegendComponentOption, TransformComponent } from 'echarts/components'
import { LabelLayout, UniversalTransition } from 'echarts/features'
import { CanvasRenderer } from 'echarts/renderers'

type EchartsOptions = echarts.ComposeOption<LineSeriesOption | GridComponentOption | LegendComponentOption | TitleComponentOption | ToolboxComponentOption | TooltipComponentOption>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/chart/BasicPieChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { onBeforeUnmount, onMounted, ref } from 'vue'
import * as echarts from 'echarts/core'
import { PieChart, type PieSeriesOption } from 'echarts/charts'
import { LabelLayout, UniversalTransition } from 'echarts/features'
import { GridComponent, type GridComponentOption, TitleComponent, type TitleComponentOption, TooltipComponent, type TooltipComponentOption, ToolboxComponent, type ToolboxComponentOption, LegendComponent, type LegendComponentOption, TransformComponent } from 'echarts/components'
import { LabelLayout, UniversalTransition } from 'echarts/features'
import { CanvasRenderer } from 'echarts/renderers'

type EchartsOptions = echarts.ComposeOption<PieSeriesOption | GridComponentOption | LegendComponentOption | TitleComponentOption | ToolboxComponentOption | TooltipComponentOption>
Expand Down
109 changes: 109 additions & 0 deletions frontend/src/components/chart/BasicRadarChart.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<script setup lang="ts">
import { onBeforeUnmount, onMounted, ref } from 'vue'
import * as echarts from 'echarts/core'
import { RadarChart, type RadarSeriesOption } from 'echarts/charts'
import { GridComponent, type GridComponentOption, TitleComponent, type TitleComponentOption, TooltipComponent, type TooltipComponentOption, ToolboxComponent, type ToolboxComponentOption, LegendComponent, type LegendComponentOption, TransformComponent } from 'echarts/components'
import { LabelLayout, UniversalTransition } from 'echarts/features'
import { CanvasRenderer } from 'echarts/renderers'

type EchartsOptions = echarts.ComposeOption<RadarSeriesOption | GridComponentOption | LegendComponentOption | TitleComponentOption | ToolboxComponentOption | TooltipComponentOption>

echarts.use([RadarChart, GridComponent, LegendComponent, TitleComponent, ToolboxComponent, TooltipComponent, TransformComponent, LabelLayout, UniversalTransition, CanvasRenderer])

const el = ref<HTMLDivElement | null>(null)

onMounted(() => {
echarts
.init(el.value as HTMLDivElement, 'light', {
width: 1000,
height: 600,
})
.setOption<EchartsOptions>({
title: {
text: 'Simple Radar Chart',
left: 'center',
top: 'top',
textStyle: {
color: '#999',
},
},
legend: {
data: ['dataA', 'dataB'],
left: 'right',
top: 'bottom',
textStyle: {
color: '#999',
},
},
grid: {
top: '5%',
left: '5%',
right: '5%',
bottom: '5%',
containLabel: true,
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
},
toolbox: {
feature: {
saveAsImage: {},
},
},
radar: {
indicator: [
{
name: 'A',
},
{
name: 'B',
},
{
name: 'C',
},
{
name: 'D',
},
{
name: 'E',
},
{
name: 'F',
},
{
name: 'G',
},
],
},
series: [
{
type: 'radar',
name: 'data',
data: [
{
name: 'dataA',
value: [20, 34, 10, 38, 45, 23, 21],
},
{
name: 'dataB',
value: [40, 17, 20, 19, 22, 12, 32],
},
],
},
],
})
})

onBeforeUnmount(() => {
echarts.getInstanceByDom(el.value as HTMLDivElement)?.dispose()
})
</script>

<template>
<div ref="el" style="width: 1000px; height: 600px"></div>
</template>

<style scoped lang="scss"></style>
2 changes: 1 addition & 1 deletion frontend/src/components/chart/BasicScatterChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { onBeforeUnmount, onMounted, ref } from 'vue'
import * as echarts from 'echarts/core'
import { ScatterChart, type ScatterSeriesOption } from 'echarts/charts'
import { LabelLayout, UniversalTransition } from 'echarts/features'
import { GridComponent, type GridComponentOption, TitleComponent, type TitleComponentOption, TooltipComponent, type TooltipComponentOption, ToolboxComponent, type ToolboxComponentOption, LegendComponent, type LegendComponentOption, TransformComponent } from 'echarts/components'
import { LabelLayout, UniversalTransition } from 'echarts/features'
import { CanvasRenderer } from 'echarts/renderers'

type EchartsOptions = echarts.ComposeOption<ScatterSeriesOption | GridComponentOption | LegendComponentOption | TitleComponentOption | ToolboxComponentOption | TooltipComponentOption>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/chart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ export { default as BasicLineChart } from './BasicLineChart.vue'

export { default as BasicPieChart } from './BasicPieChart.vue'

export { default as BasicRadarChart } from './BasicRadarChart.vue'

export { default as BasicScatterChart } from './BasicScatterChart.vue'
1 change: 1 addition & 0 deletions frontend/src/data/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as periodic } from './periodic'
Loading
Loading