mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-10-27 19:13:59 +08:00
feat: revamp demo
This commit is contained in:
40
demo/data/pie.ts
Normal file
40
demo/data/pie.ts
Normal file
@ -0,0 +1,40 @@
|
||||
import type { Option } from "../../src/types";
|
||||
import { DEMO_TEXT_STYLE } from "../constants";
|
||||
|
||||
export default function getData(): Option {
|
||||
const option = {
|
||||
textStyle: { ...DEMO_TEXT_STYLE },
|
||||
title: {
|
||||
text: "Traffic Sources",
|
||||
top: "5%",
|
||||
left: "center",
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "item",
|
||||
formatter: "{a} <br/>{b} : {c} ({d}%)",
|
||||
},
|
||||
legend: {
|
||||
orient: "vertical",
|
||||
top: "5%",
|
||||
left: "5%",
|
||||
data: ["Direct", "Email", "Ad Networks", "Video Ads", "Search Engines"],
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "Traffic Sources",
|
||||
type: "pie",
|
||||
radius: "55%",
|
||||
center: ["50%", "60%"],
|
||||
data: [
|
||||
{ value: 335, name: "Direct" },
|
||||
{ value: 310, name: "Email" },
|
||||
{ value: 234, name: "Ad Networks" },
|
||||
{ value: 135, name: "Video Ads" },
|
||||
{ value: 1548, name: "Search Engines" },
|
||||
],
|
||||
},
|
||||
],
|
||||
} satisfies Option;
|
||||
|
||||
return option;
|
||||
}
|
||||
Reference in New Issue
Block a user