How to use the g2-mobile.Shape 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 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;
    return [
      {x: x, y: y},
      {x: x, y: 0.5}
    ]
  },
  drawShape: function(cfg, canvas){
    var point1 = cfg.points[0];
    var point2 = cfg.points[1];
    point1 = this.parsePoint(point1);
    point2 = this.parsePoint(point2);

g2-mobile

The mobile version of g2

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis