Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
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;