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

feat: replace vue-charts with nuxt-echarts #7

Merged
merged 2 commits into from
Jun 27, 2024
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

- 🔔 Notification store

- 📉 Data visualization with [vue-echarts](https://github.com/ecomfe/vue-echarts)
- 📉 Data visualization with [nuxt-echarts](https://github.com/kingyue737/nuxt-echarts)

- 🎨 Theme color customization and dark mode

Expand Down
2 changes: 0 additions & 2 deletions app.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import { THEME_KEY } from 'vue-echarts'

const theme = useTheme()
provide(
THEME_KEY,
Expand Down
1 change: 0 additions & 1 deletion components/Chart/ChartBar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import type { ECOption } from '~/plugins/echarts'
const option: ECOption = {
backgroundColor: 'transparent',
tooltip: {
Expand Down
2 changes: 0 additions & 2 deletions components/Chart/ChartLine.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import type { ECOption } from '~/plugins/echarts'

const data = [
['2022-06-05', 116],
['2022-06-06', 129],
Expand Down
1 change: 0 additions & 1 deletion components/Chart/ChartPie.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import type { ECOption } from '~/plugins/echarts'
const option: ECOption = {
backgroundColor: 'transparent',
tooltip: {
Expand Down
1 change: 0 additions & 1 deletion components/Chart/ChartRadar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import type { ECOption } from '~/plugins/echarts'
const option: ECOption = {
backgroundColor: 'transparent',
radar: {
Expand Down
7 changes: 0 additions & 7 deletions modules/vue-echarts.ts

This file was deleted.

18 changes: 15 additions & 3 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ Object.keys(mdicons).forEach((key) => {
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
build: {
transpile: ['vue-echarts', 'resize-detector'],
},
modules: [
'@pinia/nuxt',
'@vueuse/nuxt',
'vuetify-nuxt-module',
'nuxt-auth-utils',
'nuxt-echarts',
'@nuxt/eslint',
'@nuxt/test-utils/module',
],
Expand All @@ -41,6 +39,20 @@ export default defineNuxtConfig({
},
},
},
echarts: {
charts: ['LineChart', 'BarChart', 'PieChart', 'RadarChart'],
renderer: 'svg',
components: [
'DataZoomComponent',
'LegendComponent',
'TooltipComponent',
'ToolboxComponent',
'GridComponent',
'TitleComponent',
'DatasetComponent',
'VisualMapComponent',
],
},
vite: {
plugins: [
regexpPlugin({
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"eslint": "^9.5.0",
"happy-dom": "^14.12.3",
"nuxt": "^3.12.2",
"nuxt-echarts": "^0.0.9",
"playwright-core": "^1.45.0",
"prettier": "^3.3.2",
"rollup-plugin-regexp": "^5.0.1",
Expand All @@ -32,8 +33,7 @@
"@pinia/nuxt": "^0.5.1",
"@vueuse/nuxt": "^10.11.0",
"echarts": "^5.5.0",
"nuxt-auth-utils": "^0.1.0",
"vue-echarts": "^6.7.3"
"nuxt-auth-utils": "^0.1.0"
},
"pnpm": {
"peerDependencyRules": {
Expand Down
76 changes: 0 additions & 76 deletions plugins/echarts.ts

This file was deleted.

Loading