How to use the @antv/g2.track function in @antv/g2

To help you get started, we’ve selected a few @antv/g2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github d2-projects / d2-admin / src / components / _G2 / mixins / G2.js View on Github external
import G2 from '@antv/g2'
import * as DataSet from '@antv/data-set'

// 关闭 G2 的体验改进计划打点请求
G2.track(false)

export default {
  props: {
    // 图表数据
    data: {
      type: Array,
      required: false,
      default: () => []
    },
    // [图表设置项] 高度
    height: {
      type: Number,
      required: false,
      default: 300
    },
    // [图表设置项] 开启自动填充父元素高度
github d2-projects / d2-admin / src / components / charts / G2 / mixins / G2.js View on Github external
// Chart对象属性参数
import propsChart from './props/chart'
// 扩展属性
import propsD2 from './props/d2'

// 工具
const sleep = async (time = 0) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve()
    }, time)
  })
}

// 关闭 G2 的体验改进计划打点请求
G2.track(false)

export default {
  props: {
    // Chart对象属性参数
    ...propsChart,
    // 扩展属性
    ...propsD2
  },
  data () {
    return {
      // 在页面中不需要再引入 直接使用 this.G2
      G2,
      // 数据处理模块
      DataSet,
      // 图表实例
      chart: null
github apache / flink / flink-runtime-web / web-dashboard / src / app / share / customize / job-chart / job-chart.component.ts View on Github external
ngAfterViewInit() {
    this.cdr.detach();
    G2.track(false);
    this.chartInstance = new G2.Chart({
      container: this.chart.nativeElement,
      height: 150,
      forceFit: true,
      padding: 'auto'
    });
    this.chartInstance.legend(false);
    this.chartInstance.source(this.data, {
      time: {
        alias: 'Time',
        type: 'time',
        mask: 'HH:mm:ss',
        tickCount: 3
      },
      type: {
        type: 'cat'