Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initChart (props) {
const {data} = props;
const chart = new GM.Chart({
id: this.chartId
});
chart.source(data);
__operation(chart);
this.chart = chart;
}
initChart(props) {
const { data } = props;
const chart = new GM.Chart({
id: this.chartId
});
chart.source(data);
__operation(chart);
this.chart = chart;
}
draw(context) {
const {children, data, config} = this.props;
const el = findDOMNode(this.chartInstance);
if (!children) {
return;
}
context.render();
this.chart = new GM.Chart({
el,
context
});
this.chart.source(data, config);
this.chart.axis(false);
this.renderChildren(context);
}
renderWebChart = () => {
const {id, margin} = this.props;
this.chart = new GM.Chart({
id: id,
margin: margin
});
};
/**
* Created by godsong on 16/12/12.
*/
var GM = require('g2-mobile');
var CanvasElement=require('./CanvasElement')
var _ready = false;
var _context;
var _renderQueue = [];
var _chartRender = GM.Chart.prototype.render;
GM.Chart.prototype.render = function () {
if (_ready) {
_chartRender.call(this);
_context.render();
}
else {
_renderQueue.push(this);
}
};
var G2Chart=GM.Chart;
GM.Chart=function(config){
var canvasElement=new CanvasElement();
config.el=canvasElement;
return new G2Chart(config);
}
module.exports = function (name) {
switch (name.toLowerCase()) {
var CanvasElement=require('./CanvasElement')
var _ready = false;
var _context;
var _renderQueue = [];
var _chartRender = GM.Chart.prototype.render;
GM.Chart.prototype.render = function () {
if (_ready) {
_chartRender.call(this);
_context.render();
}
else {
_renderQueue.push(this);
}
};
var G2Chart=GM.Chart;
GM.Chart=function(config){
var canvasElement=new CanvasElement();
config.el=canvasElement;
return new G2Chart(config);
}
module.exports = function (name) {
switch (name.toLowerCase()) {
case 'g2':
return GM;
case 'gm':
return GM;
default:
return GM;
}
};
module.exports.ready = function (context,id,weexElement) {
_ready = true;
/**
* Created by godsong on 16/12/12.
*/
var GM = require('g2-mobile');
var CanvasElement=require('./CanvasElement')
var _ready = false;
var _context;
var _renderQueue = [];
var _chartRender = GM.Chart.prototype.render;
GM.Chart.prototype.render = function () {
if (_ready) {
_chartRender.call(this);
_context.render();
}
else {
_renderQueue.push(this);
}
};
var G2Chart=GM.Chart;
GM.Chart=function(config){
var canvasElement=new CanvasElement();
config.el=canvasElement;
return new G2Chart(config);
}
module.exports = function (name) {
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;
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);
G.drawLines([point1, point2], canvas, {