mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-10-30 08:26:24 +08:00
refactor: refactor demo
This commit is contained in:
45
src/demo/examples/PolarChart.vue
Normal file
45
src/demo/examples/PolarChart.vue
Normal file
@ -0,0 +1,45 @@
|
||||
<script setup>
|
||||
import { use } from "echarts/core";
|
||||
import { LineChart } from "echarts/charts";
|
||||
import {
|
||||
PolarComponent,
|
||||
TitleComponent,
|
||||
LegendComponent,
|
||||
TooltipComponent
|
||||
} from "echarts/components";
|
||||
import { shallowRef } from "vue";
|
||||
import VChart from "../../ECharts";
|
||||
import VExample from "./Example";
|
||||
import getData from "../data/polar";
|
||||
|
||||
use([
|
||||
LineChart,
|
||||
PolarComponent,
|
||||
TitleComponent,
|
||||
LegendComponent,
|
||||
TooltipComponent
|
||||
]);
|
||||
|
||||
const option = shallowRef(getData());
|
||||
const theme = shallowRef("dark");
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-example id="polar" title="Polar plot" desc="(with built-in theme)">
|
||||
<v-chart
|
||||
:option="option"
|
||||
autoresize
|
||||
:theme="theme"
|
||||
:style="theme === 'dark' ? 'background-color: #100c2a' : ''"
|
||||
/>
|
||||
<template #extra>
|
||||
<p>
|
||||
Theme
|
||||
<select v-model="theme">
|
||||
<option :value="null">Default</option>
|
||||
<option value="dark">Dark</option>
|
||||
</select>
|
||||
</p>
|
||||
</template>
|
||||
</v-example>
|
||||
</template>
|
||||
Reference in New Issue
Block a user