All Projects → wupeiwen → vue-g2

wupeiwen / vue-g2

Licence: other
基于 Vue 和 AntV/G2 的可视化组件库 📈

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to vue-g2

X6
🚀 JavaScript diagramming library that uses SVG and HTML for rendering.
Stars: ✭ 2,686 (+3579.45%)
Mutual labels:  chart, antv
Vue Echarts V3
Vue.js(v2.x+) component wrap for ECharts.js(v3.x+)
Stars: ✭ 884 (+1110.96%)
Mutual labels:  chart, vue-component
Vue Tree Chart
A vue2 component to display tree chart
Stars: ✭ 351 (+380.82%)
Mutual labels:  chart, vue-component
Vue Trend Chart
Simple trend charts for Vue.js
Stars: ✭ 216 (+195.89%)
Mutual labels:  chart, vue-component
vue-dictaphone
🎙️ Vue.js dictaphone component to record audio from the user
Stars: ✭ 22 (-69.86%)
Mutual labels:  vue-component
layui-vue
layui - vue(谐音:类 UI) 是 一 套 Vue 3.0 的 桌 面 端 组 件 库
Stars: ✭ 112 (+53.42%)
Mutual labels:  vue-component
helm-spray
Helm plugin for installing or upgrading sub-charts from an umbrella-chart using dependency orders
Stars: ✭ 64 (-12.33%)
Mutual labels:  chart
falcon-helm
Helm Charts for running CrowdStrike Falcon with Kubernetes
Stars: ✭ 34 (-53.42%)
Mutual labels:  chart
c3
c3 HTMLWidget Ploting
Stars: ✭ 39 (-46.58%)
Mutual labels:  chart
vue-magnify
vue-magnify / vue放大镜组件
Stars: ✭ 14 (-80.82%)
Mutual labels:  vue-component
vue-tiny-pagination
A Vue component for create a tiny pagination with Flexbox
Stars: ✭ 20 (-72.6%)
Mutual labels:  vue-component
onechart
A generic Helm chart for your application deployments
Stars: ✭ 30 (-58.9%)
Mutual labels:  chart
synchro-charts
Synchro Charts is a front-end component library that provides a collection of components to visualize time-series data.
Stars: ✭ 51 (-30.14%)
Mutual labels:  chart
advanced-kpi
Advanced-KPI is about creating a smart KPI object that fits to 90% of the needs of Qlik Sense users.
Stars: ✭ 19 (-73.97%)
Mutual labels:  chart
vue-music
基于Laravel5.3+Vue2.0的网易云音乐的SPA应用
Stars: ✭ 85 (+16.44%)
Mutual labels:  vue-component
green-button-grapher
JS app that parses/displays Green Button XML
Stars: ✭ 23 (-68.49%)
Mutual labels:  chart
ember-google-analytics-embed
An Ember Addon for adding analytics visualizations using the Google Analytics Embed API.
Stars: ✭ 26 (-64.38%)
Mutual labels:  chart
vue-github-buttons
GitHub buttons component for Vue.
Stars: ✭ 36 (-50.68%)
Mutual labels:  vue-component
flame-chart-js
Component for incredibly fast viewing of flame charts
Stars: ✭ 28 (-61.64%)
Mutual labels:  chart
pypi-tools
Command-line Python scripts to do things with PyPI
Stars: ✭ 18 (-75.34%)
Mutual labels:  chart

vue-g2 | 基于 VueAntV/G2 的可视化组件库

在vue-cli中使用


1.安装依赖

可以通过 npm 添加依赖

npm i @antv/[email protected] @antv/[email protected] vue-g2 --save

或者通过 yarn 添加依赖

yarn add @antv/[email protected] @antv/[email protected] vue-g2

2.引入依赖

在 main.js 中写入以下内容:

import Vue from 'vue'
import 'vue-g2'
import App from './App.vue'

Vue.config.productionTip = false

new Vue({
  render: h => h(App)
}).$mount('#app')

以上代码便完成了 vue-g2 的引入。

3.Vue组件中使用

在需要使用可视化图表的vue组件中通过 html 标签的形式使用, 如:

<template>
  <g2-pie type="pie" 
    :axis-name="{ name: '年份', value: 'GDP(亿美元)' }"
    :data="data"
    :label-option="{ show: true, offset: 20 }">
  </g2-pie>
</template>

<script>
export default {
  data () {
    return {
      data: [
        { name: '2016', value: 2 }, 
        { name: '2017', value: 1 }, 
        { name: '2018', value: 3 }
      ]
    }
  }
}
</script>

<style>
</style>

饼图

在nuxt.js(ssr)中使用


1.安装依赖

可以通过 npm 添加依赖

npm i @antv/[email protected] @antv/[email protected] vue-g2 --save

或者通过 yarn 添加依赖

yarn add @antv/[email protected] @antv/[email protected] vue-g2

2.新建插件

在 plugins 文件夹中新建 vue-g2.client.js 文件,并写入以下内容:

import 'vue-g2'

3.引入插件

将插件引入nuxt.config.js

  plugins: [
    { src: '~/plugins/vue-g2.client' }
  ]

4.Vue组件中使用

在需要使用可视化图表的vue组件中通过 html 标签的形式使用, 如:

<template>
  <g2-pie type="pie" 
    :axis-name="{ name: '年份', value: 'GDP(亿美元)' }"
    :data="data"
    :label-option="{ show: true, offset: 20 }">
  </g2-pie>
</template>

<script>
export default {
  data () {
    return {
      data: [
        { name: '2016', value: 2 }, 
        { name: '2017', value: 1 }, 
        { name: '2018', value: 3 }
      ]
    }
  }
}
</script>

饼图

在浏览器中直接使用


目前可以通过http://unpkg.com/vue-g2获取最新版本,也可通过http://unpkg.com/[email protected]/lib/vue-g2.umd.js获取指定版本。在页面上引入 js 即可开始使用。(需要引入vue、g2、data-set等前置依赖)

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>通过CDN使用vue-g2</title>
</head>
<body>
  <!-- 使用雷达图组件 -->
  <div id="example">
    <g2-radar
     style="width: 500px; height: 500px; margin: 0 auto;" 
     :is-show-area="false" 
     :show-legend="false"
     :axis-name="{a:'companya'}" 
     :data="[{item: 'Design',a: 70},{item: 'Development',a: 60},
      {item: 'Marketing',a: 50},{item: 'Users',a: 40},
      {item: 'Test',a: 60}]">
    </g2-radar>
  </div>
  <!-- CDN方式引入 vue -->
  <script src="//unpkg.com/vue"></script>
  <!-- CDN方式引入 @antv/g2 -->
  <script src="//unpkg.com/@antv/[email protected]/build/g2.js"></script>
  <!-- CDN方式引入 @antv/data-set -->
  <script src="//unpkg.com/@antv/[email protected]/build/data-set.js"></script>
  <!-- CDN方式引入 vue-g2 -->
  <script src="//unpkg.com/vue-g2/lib/vue-g2.umd.js"></script>
  <script>
    new Vue({
      el: '#example'
    })
  </script>
</body>
</html>

雷达图

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].