1 Star 0 Fork 0

silianpan / p-charts

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

p-charts

Chart components based on AntV G2

doc gitee Travis status antv-g2-deps antv-l7-deps NPM version

GitHub stars GitHub commit activity GitHub top language GitHub license

Document

Blog

Examples

Gitee

Getting Started

installation

npm install -S p-charts
# or
yarn add p-charts

Usage

// main.js
import PCharts from 'p-charts'
Vue.use(PCharts)

p-pie

<template>
  <p-pie
    :data="PieJson"
    :options="options"
    ref="pieRef"
    @pie-title-click="handleTitleClick"
    @pie-label-click="handleLabelClick"
  />
</template>

<script>
import PieJson from './data/pie1.json'
export default {
  data() {
    return {
      PieJson,
      options: {
        fieldMap: {
          time: 'year',
          name: 'budgetSubject',
          // 统计指标,可以更换
          value: 'budgetNum'
        },
        title: `总收入和总支出占比情况-预算数(单位:万元)`,
        colorList: ['#1890ff', '#37c661']
      }
    }
  },
  methods: {
    updateData() {
      this.$refs.pieRef.initData()
    },
    handleTitleClick() {
      console.log('title-click')
    },
    handleLabelClick(data) {
      console.log('label-click', data)
    }
  }
}
</script>

Development

# install dependencies
npm install
# or
yarn

# serve with hot reload at localhost:8080
npm run dev
# or
yarn dev

# build for production with minification
npm run build
# or
yarn build

Comments ( 0 )

Sign in for post a comment

About

Chart components based on AntV G2 spread retract
Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more
1
https://gitee.com/twofloor/p-charts.git
git@gitee.com:twofloor/p-charts.git
twofloor
p-charts
p-charts
master

Search