diff --git a/src/components/charts/ContinuousLine.vue b/src/components/charts/ContinuousLine.vue new file mode 100644 index 0000000..4a816ee --- /dev/null +++ b/src/components/charts/ContinuousLine.vue @@ -0,0 +1,154 @@ + + + + + diff --git a/src/components/charts/NewsChg.vue b/src/components/charts/NewsChg.vue index 6e8afd7..5896062 100644 --- a/src/components/charts/NewsChg.vue +++ b/src/components/charts/NewsChg.vue @@ -44,7 +44,8 @@ const init = (data) => { // 指定图表的配置项和数据 const option = { title: { - text: '中国A股市场情绪指数' + text: '中国A股市场情绪指数', + left: 'center' }, xAxis: { type: 'category', diff --git a/src/components/charts/UpLow.vue b/src/components/charts/UpLow.vue index 09a22d3..f13206c 100644 --- a/src/components/charts/UpLow.vue +++ b/src/components/charts/UpLow.vue @@ -30,13 +30,13 @@ const UpLow = ref() // 使用ref创建虚拟DOM引用,使用时用main.value watch(chgContent, (newValue) => { console.log('watch 已触发', newValue) - init(chgContent.value) + init() }) -const init = (chgContent) => { - const dateStr = chgContent.map(x => x.dateStr) - const upCount = chgFlag ? chgContent.map(x => x.upCount) : chgContent.map(x => x.limitUpCount) - const lowCount = chgFlag ? chgContent.map(x => x.lowCount) : chgContent.map(x => x.limitLowCount) +const init = () => { + const dateStr = chgContent.value.map(x => x.dateStr) + const upCount = chgFlag ? chgContent.value.map(x => x.upCount) : chgContent.value.map(x => x.limitUpCount) + const lowCount = chgFlag ? chgContent.value.map(x => x.lowCount) : chgContent.value.map(x => x.limitLowCount) const myChart = echarts.init(UpLow.value) // 指定图表的配置项和数据 const option = { diff --git a/src/components/charts/UpLowLine.vue b/src/components/charts/UpLowLine.vue new file mode 100644 index 0000000..39811b0 --- /dev/null +++ b/src/components/charts/UpLowLine.vue @@ -0,0 +1,152 @@ + + + + + diff --git a/src/views/stock/chg/Index.vue b/src/views/stock/chg/Index.vue index 253c3fc..8075367 100644 --- a/src/views/stock/chg/Index.vue +++ b/src/views/stock/chg/Index.vue @@ -5,6 +5,8 @@ + + @@ -13,6 +15,8 @@ import { ref, onMounted } from 'vue' import { getStockChgRecordData } from '@/api/stock/StockChgApi.js' import NewsChg from '@/components/charts/NewsChg.vue' import UpLow from '@/components/charts/UpLow.vue' +import UpLowLine from '@/components/charts/UpLowLine.vue' +import ContinuousLine from '@/components/charts/ContinuousLine.vue' const chgContent = ref([]) const uplow = ref('uplow')