How to use the g2-mobile.Global function in g2-mobile

To help you get started, we’ve selected a few g2-mobile 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 alibaba / rax / components / rax-charts / src / Chart.js View on Github external
import {createElement, Component, PropTypes, findDOMNode} from 'rax';
import {isWeex, isWeb} from 'universal-env';
import Canvas from 'rax-canvas';

import GM from 'g2-mobile';

if (isWeb) {
  GM.Global.pixelRatio = 2;
}

class Chart extends Component {
  constructor(props) {
    super(props);
  }

  setRef = (ref) => {
    this.chartInstance = ref;
  };

  componentDidMount() {
    var context = this.chartInstance.getContext();
    this.draw(context);
  }
github fireyy / react-antd-admin / src / views / Home / index.jsx View on Github external
import React from 'react'
import { Row, Col, Table, Alert, Icon } from 'antd';

import GM from 'g2-mobile';
GM.Global.pixelRatio = 2;
const Util = GM.Util;

import PanelBox from '../../components/PanelBox';

import createGM from '../../utils/gm';
import { chartData, pieData, barData } from '../../../fake/chart2.js';

import './index.less'

var Shape = GM.Shape;
var G = GM.G;
//自定义绘制数据的的形状
Shape.registShape('point', 'dashBoard', {
  getShapePoints:function(cfg){
    var x = cfg.x;
    var y = cfg.y;

g2-mobile

The mobile version of g2

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis