echarts-for-react 1.2.5 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -28
- package/lib/{echarts-for-react.js → core.js} +7 -8
- package/lib/index.js +39 -0
- package/package.json +45 -28
- package/src/{echarts-for-react.js → core.js} +8 -6
- package/src/index.js +10 -0
- package/.babelrc +0 -8
- package/.eslintrc +0 -54
- package/.npmignore +0 -3
- package/.travis.yml +0 -3
- package/__tests__/test.spec.js +0 -63
- package/demo/AirportCoordComponent.jsx +0 -321
- package/demo/CalendarComponent.jsx +0 -199
- package/demo/ChartAPIComponent.jsx +0 -127
- package/demo/ChartShowLoadingComponent.jsx +0 -93
- package/demo/ChartWithEventComponent.jsx +0 -93
- package/demo/DynamicChartComponent.jsx +0 -189
- package/demo/EchartsComponent.jsx +0 -47
- package/demo/GCalendarComponent.jsx +0 -72
- package/demo/GaugeComponent.jsx +0 -323
- package/demo/GraphComponent.jsx +0 -54
- package/demo/LiquidfillComponent.jsx +0 -32
- package/demo/LunarCalendarComponent.jsx +0 -492
- package/demo/MainPageComponent.jsx +0 -48
- package/demo/MapChartComponent.jsx +0 -203
- package/demo/ModuleLoadChartComponent.jsx +0 -54
- package/demo/SimpleChartComponent.jsx +0 -90
- package/demo/ThemeChartComponent.jsx +0 -114
- package/demo/TreemapComponent.jsx +0 -273
- package/demo/demo.css +0 -151
- package/demo/demo.jsx +0 -17
- package/demo/dist/bundle.js +0 -67
- package/demo/dist/bundle.js.map +0 -1
- package/index.html +0 -20
- package/webpack.config.js +0 -27
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactEcharts from '../lib/echarts-for-react';
|
|
3
|
-
|
|
4
|
-
const ChartShowLoadingComponent = React.createClass({
|
|
5
|
-
propTypes: {
|
|
6
|
-
},
|
|
7
|
-
_t: null,
|
|
8
|
-
getOtion: function() {
|
|
9
|
-
const option = {
|
|
10
|
-
title: {
|
|
11
|
-
text: '基础雷达图'
|
|
12
|
-
},
|
|
13
|
-
tooltip: {},
|
|
14
|
-
legend: {
|
|
15
|
-
data: ['预算分配(Allocated Budget)', '实际开销(Actual Spending)']
|
|
16
|
-
},
|
|
17
|
-
radar: {
|
|
18
|
-
// shape: 'circle',
|
|
19
|
-
indicator: [
|
|
20
|
-
{ name: '销售(sales)', max: 6500},
|
|
21
|
-
{ name: '管理(Administration)', max: 16000},
|
|
22
|
-
{ name: '信息技术(Information Techology)', max: 30000},
|
|
23
|
-
{ name: '客服(Customer Support)', max: 38000},
|
|
24
|
-
{ name: '研发(Development)', max: 52000},
|
|
25
|
-
{ name: '市场(Marketing)', max: 25000}
|
|
26
|
-
]
|
|
27
|
-
},
|
|
28
|
-
series: [{
|
|
29
|
-
name: '预算 vs 开销(Budget vs spending)',
|
|
30
|
-
type: 'radar',
|
|
31
|
-
// areaStyle: {normal: {}},
|
|
32
|
-
data : [
|
|
33
|
-
{
|
|
34
|
-
value : [4300, 10000, 28000, 35000, 50000, 19000],
|
|
35
|
-
name : '预算分配(Allocated Budget)'
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
value : [5000, 14000, 28000, 31000, 42000, 21000],
|
|
39
|
-
name : '实际开销(Actual Spending)'
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
}]
|
|
43
|
-
};
|
|
44
|
-
return option;
|
|
45
|
-
},
|
|
46
|
-
onChartReady: function(chart) {
|
|
47
|
-
this._t = setTimeout(function() {
|
|
48
|
-
chart.hideLoading();
|
|
49
|
-
}, 3000);
|
|
50
|
-
},
|
|
51
|
-
getLoadingOption: function() {
|
|
52
|
-
const option = {
|
|
53
|
-
text: '加载中...',
|
|
54
|
-
color: '#4413c2',
|
|
55
|
-
textColor: '#270240',
|
|
56
|
-
maskColor: 'rgba(194, 88, 86, 0.3)',
|
|
57
|
-
zlevel: 0
|
|
58
|
-
};
|
|
59
|
-
return option;
|
|
60
|
-
},
|
|
61
|
-
componentWillUnmount: function() {
|
|
62
|
-
clearTimeout(this._t);
|
|
63
|
-
},
|
|
64
|
-
render: function() {
|
|
65
|
-
let code = "onChartReady: function(chart) {\n" +
|
|
66
|
-
" 'chart.hideLoading();\n" +
|
|
67
|
-
"}\n\n" +
|
|
68
|
-
"<ReactEcharts \n" +
|
|
69
|
-
" option={this.getOtion()} \n" +
|
|
70
|
-
" onChartReady={this.onChartReady} \n" +
|
|
71
|
-
" loadingOption={this.getLoadingOption()} \n" +
|
|
72
|
-
" showLoading={true} />";
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<div className='examples'>
|
|
76
|
-
<div className='parent'>
|
|
77
|
-
<label> Chart loading With <strong> showLoading </strong>: (when chart ready, hide the loading mask.)</label>
|
|
78
|
-
<ReactEcharts
|
|
79
|
-
option={this.getOtion()}
|
|
80
|
-
onChartReady={this.onChartReady}
|
|
81
|
-
loadingOption={this.getLoadingOption()}
|
|
82
|
-
showLoading={true} />
|
|
83
|
-
<label> code below: </label>
|
|
84
|
-
<pre>
|
|
85
|
-
<code>{code}</code>
|
|
86
|
-
</pre>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
export default ChartShowLoadingComponent;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactEcharts from '../src/echarts-for-react';
|
|
3
|
-
|
|
4
|
-
const ChartWithEventComponent = React.createClass({
|
|
5
|
-
propTypes: {
|
|
6
|
-
},
|
|
7
|
-
getOtion: function() {
|
|
8
|
-
const option = {
|
|
9
|
-
title : {
|
|
10
|
-
text: '某站点用户访问来源',
|
|
11
|
-
subtext: '纯属虚构',
|
|
12
|
-
x:'center'
|
|
13
|
-
},
|
|
14
|
-
tooltip : {
|
|
15
|
-
trigger: 'item',
|
|
16
|
-
formatter: "{a} <br/>{b} : {c} ({d}%)"
|
|
17
|
-
},
|
|
18
|
-
legend: {
|
|
19
|
-
orient: 'vertical',
|
|
20
|
-
left: 'left',
|
|
21
|
-
data: ['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
|
|
22
|
-
},
|
|
23
|
-
series : [
|
|
24
|
-
{
|
|
25
|
-
name: '访问来源',
|
|
26
|
-
type: 'pie',
|
|
27
|
-
radius : '55%',
|
|
28
|
-
center: ['50%', '60%'],
|
|
29
|
-
data:[
|
|
30
|
-
{value:335, name:'直接访问'},
|
|
31
|
-
{value:310, name:'邮件营销'},
|
|
32
|
-
{value:234, name:'联盟广告'},
|
|
33
|
-
{value:135, name:'视频广告'},
|
|
34
|
-
{value:1548, name:'搜索引擎'}
|
|
35
|
-
],
|
|
36
|
-
itemStyle: {
|
|
37
|
-
emphasis: {
|
|
38
|
-
shadowBlur: 10,
|
|
39
|
-
shadowOffsetX: 0,
|
|
40
|
-
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
};
|
|
46
|
-
return option;
|
|
47
|
-
},
|
|
48
|
-
onChartClick: function(param, echart) {
|
|
49
|
-
console.log(param, echart);
|
|
50
|
-
alert('chart click');
|
|
51
|
-
},
|
|
52
|
-
onChartLegendselectchanged: function(param, echart) {
|
|
53
|
-
console.log(param, echart);
|
|
54
|
-
alert('chart legendselectchanged');
|
|
55
|
-
},
|
|
56
|
-
onChartReady: function(echart) {
|
|
57
|
-
console.log('echart is ready', echart);
|
|
58
|
-
},
|
|
59
|
-
render: function() {
|
|
60
|
-
let onEvents = {
|
|
61
|
-
'click': this.onChartClick,
|
|
62
|
-
'legendselectchanged': this.onChartLegendselectchanged
|
|
63
|
-
};
|
|
64
|
-
let code = "let onEvents = {\n" +
|
|
65
|
-
" 'click': this.onChartClick,\n" +
|
|
66
|
-
" 'legendselectchanged': this.onChartLegendselectchanged\n" +
|
|
67
|
-
"}\n\n" +
|
|
68
|
-
"<ReactEcharts \n" +
|
|
69
|
-
" option={this.getOtion()} \n" +
|
|
70
|
-
" style={{height: 300}} \n" +
|
|
71
|
-
" onChartReady={this.onChartReady} \n" +
|
|
72
|
-
" onEvents={onEvents} />";
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<div className='examples'>
|
|
76
|
-
<div className='parent'>
|
|
77
|
-
<label> Chart With event <strong> onEvents </strong>: (Click the chart, and watch the console)</label>
|
|
78
|
-
<ReactEcharts
|
|
79
|
-
option={this.getOtion()}
|
|
80
|
-
style={{height: 300}}
|
|
81
|
-
onChartReady={this.onChartReady}
|
|
82
|
-
onEvents={onEvents} />
|
|
83
|
-
<label> code below: </label>
|
|
84
|
-
<pre>
|
|
85
|
-
<code>{code}</code>
|
|
86
|
-
</pre>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
export default ChartWithEventComponent;
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactEcharts from '../lib/echarts-for-react';
|
|
3
|
-
|
|
4
|
-
const DynamicChartComponent = React.createClass({
|
|
5
|
-
propTypes: {
|
|
6
|
-
},
|
|
7
|
-
timeTicket: null,
|
|
8
|
-
count: 51,
|
|
9
|
-
getInitialState: function() {
|
|
10
|
-
return {option: this.getOption()};
|
|
11
|
-
},
|
|
12
|
-
fetchNewDate: function() {
|
|
13
|
-
let axisData = (new Date()).toLocaleTimeString().replace(/^\D*/,'');
|
|
14
|
-
let option = this.state.option;
|
|
15
|
-
option.title.text = 'Hello Echarts-for-react.' + new Date().getSeconds();
|
|
16
|
-
let data0 = option.series[0].data;
|
|
17
|
-
let data1 = option.series[1].data;
|
|
18
|
-
data0.shift();
|
|
19
|
-
data0.push(Math.round(Math.random() * 1000));
|
|
20
|
-
data1.shift();
|
|
21
|
-
data1.push((Math.random() * 10 + 5).toFixed(1) - 0);
|
|
22
|
-
|
|
23
|
-
option.xAxis[0].data.shift();
|
|
24
|
-
option.xAxis[0].data.push(axisData);
|
|
25
|
-
option.xAxis[1].data.shift();
|
|
26
|
-
option.xAxis[1].data.push(this.count++);
|
|
27
|
-
this.setState({option: option});
|
|
28
|
-
},
|
|
29
|
-
componentDidMount: function() {
|
|
30
|
-
if (this.timeTicket) {
|
|
31
|
-
clearInterval(this.timeTicket);
|
|
32
|
-
}
|
|
33
|
-
this.timeTicket = setInterval(this.fetchNewDate, 1000);
|
|
34
|
-
},
|
|
35
|
-
componentWillUnmount: function() {
|
|
36
|
-
if (this.timeTicket) {
|
|
37
|
-
clearInterval(this.timeTicket);
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
getOption: function() {
|
|
41
|
-
const option = {
|
|
42
|
-
title: {
|
|
43
|
-
text:'Hello Echarts-for-react.',
|
|
44
|
-
},
|
|
45
|
-
tooltip: {
|
|
46
|
-
trigger: 'axis'
|
|
47
|
-
},
|
|
48
|
-
legend: {
|
|
49
|
-
data:['最新成交价', '预购队列']
|
|
50
|
-
},
|
|
51
|
-
toolbox: {
|
|
52
|
-
show: true,
|
|
53
|
-
feature: {
|
|
54
|
-
dataView: {readOnly: false},
|
|
55
|
-
restore: {},
|
|
56
|
-
saveAsImage: {}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
grid: {
|
|
60
|
-
top: 60,
|
|
61
|
-
left: 30,
|
|
62
|
-
right: 60,
|
|
63
|
-
bottom:30
|
|
64
|
-
},
|
|
65
|
-
dataZoom: {
|
|
66
|
-
show: false,
|
|
67
|
-
start: 0,
|
|
68
|
-
end: 100
|
|
69
|
-
},
|
|
70
|
-
visualMap: {
|
|
71
|
-
show: false,
|
|
72
|
-
min: 0,
|
|
73
|
-
max: 1000,
|
|
74
|
-
color: ['#BE002F', '#F20C00', '#F00056', '#FF2D51', '#FF2121', '#FF4C00', '#FF7500',
|
|
75
|
-
'#FF8936', '#FFA400', '#F0C239', '#FFF143', '#FAFF72', '#C9DD22', '#AFDD22',
|
|
76
|
-
'#9ED900', '#00E500', '#0EB83A', '#0AA344', '#0C8918', '#057748', '#177CB0']
|
|
77
|
-
},
|
|
78
|
-
xAxis: [
|
|
79
|
-
{
|
|
80
|
-
type: 'category',
|
|
81
|
-
boundaryGap: true,
|
|
82
|
-
data: (function (){
|
|
83
|
-
let now = new Date();
|
|
84
|
-
let res = [];
|
|
85
|
-
let len = 50;
|
|
86
|
-
while (len--) {
|
|
87
|
-
res.unshift(now.toLocaleTimeString().replace(/^\D*/,''));
|
|
88
|
-
now = new Date(now - 2000);
|
|
89
|
-
}
|
|
90
|
-
return res;
|
|
91
|
-
})()
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
type: 'category',
|
|
95
|
-
boundaryGap: true,
|
|
96
|
-
data: (function (){
|
|
97
|
-
let res = [];
|
|
98
|
-
let len = 50;
|
|
99
|
-
while (len--) {
|
|
100
|
-
res.push(50 - len + 1);
|
|
101
|
-
}
|
|
102
|
-
return res;
|
|
103
|
-
})()
|
|
104
|
-
}
|
|
105
|
-
],
|
|
106
|
-
yAxis: [
|
|
107
|
-
{
|
|
108
|
-
type: 'value',
|
|
109
|
-
scale: true,
|
|
110
|
-
name: '价格',
|
|
111
|
-
max: 20,
|
|
112
|
-
min: 0,
|
|
113
|
-
boundaryGap: [0.2, 0.2]
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
type: 'value',
|
|
117
|
-
scale: true,
|
|
118
|
-
name: '预购量',
|
|
119
|
-
max: 1200,
|
|
120
|
-
min: 0,
|
|
121
|
-
boundaryGap: [0.2, 0.2]
|
|
122
|
-
}
|
|
123
|
-
],
|
|
124
|
-
series: [
|
|
125
|
-
{
|
|
126
|
-
name:'预购队列',
|
|
127
|
-
type:'bar',
|
|
128
|
-
xAxisIndex: 1,
|
|
129
|
-
yAxisIndex: 1,
|
|
130
|
-
itemStyle: {
|
|
131
|
-
normal: {
|
|
132
|
-
barBorderRadius: 4,
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
animationEasing: 'elasticOut',
|
|
136
|
-
animationDelay: function (idx) {
|
|
137
|
-
return idx * 10;
|
|
138
|
-
},
|
|
139
|
-
animationDelayUpdate: function (idx) {
|
|
140
|
-
return idx * 10;
|
|
141
|
-
},
|
|
142
|
-
data:(function (){
|
|
143
|
-
let res = [];
|
|
144
|
-
let len = 50;
|
|
145
|
-
while (len--) {
|
|
146
|
-
res.push(Math.round(Math.random() * 1000));
|
|
147
|
-
}
|
|
148
|
-
return res;
|
|
149
|
-
})()
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
name:'最新成交价',
|
|
153
|
-
type:'line',
|
|
154
|
-
data:(function (){
|
|
155
|
-
let res = [];
|
|
156
|
-
let len = 0;
|
|
157
|
-
while (len < 50) {
|
|
158
|
-
res.push((Math.random()*10 + 5).toFixed(1) - 0);
|
|
159
|
-
len++;
|
|
160
|
-
}
|
|
161
|
-
return res;
|
|
162
|
-
})()
|
|
163
|
-
}
|
|
164
|
-
]
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
return option;
|
|
168
|
-
},
|
|
169
|
-
render: function() {
|
|
170
|
-
let code = "<ReactEcharts ref='echartsInstance' \n" +
|
|
171
|
-
" option={this.state.option} />\n";
|
|
172
|
-
return (
|
|
173
|
-
<div className='examples'>
|
|
174
|
-
<div className='parent'>
|
|
175
|
-
<label> use React state to render dynamic chart</label>
|
|
176
|
-
<ReactEcharts ref='echarts_react'
|
|
177
|
-
option={this.state.option}
|
|
178
|
-
style={{height: 400}} />
|
|
179
|
-
<label> code below: use state of react to render dynamic chart</label>
|
|
180
|
-
<pre>
|
|
181
|
-
<code>{code}</code>
|
|
182
|
-
</pre>
|
|
183
|
-
</div>
|
|
184
|
-
</div>
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
export default DynamicChartComponent;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import SimpleChartComponent from './SimpleChartComponent.jsx';
|
|
4
|
-
import ChartWithEventComponent from './ChartWithEventComponent.jsx';
|
|
5
|
-
import ThemeChartComponent from './ThemeChartComponent.jsx';
|
|
6
|
-
import ChartShowLoadingComponent from './ChartShowLoadingComponent.jsx';
|
|
7
|
-
import ChartAPIComponent from './ChartAPIComponent.jsx';
|
|
8
|
-
import DynamicChartComponent from './DynamicChartComponent.jsx';
|
|
9
|
-
import MapChartComponent from './MapChartComponent.jsx';
|
|
10
|
-
|
|
11
|
-
// v1.2.0 add 7 demo.
|
|
12
|
-
import AirportCoordComponent from './AirportCoordComponent.jsx';
|
|
13
|
-
import CalendarComponent from './CalendarComponent.jsx';
|
|
14
|
-
import GaugeComponent from './GaugeComponent.jsx';
|
|
15
|
-
import GCalendarComponent from './GCalendarComponent.jsx';
|
|
16
|
-
import GraphComponent from './GraphComponent.jsx';
|
|
17
|
-
import LunarCalendarComponent from './LunarCalendarComponent.jsx';
|
|
18
|
-
import TreemapComponent from './TreemapComponent.jsx';
|
|
19
|
-
import LiquidfillComponent from './LiquidfillComponent.jsx';
|
|
20
|
-
|
|
21
|
-
import { Link } from 'react-router'
|
|
22
|
-
|
|
23
|
-
const EchartsComponent = React.createClass({
|
|
24
|
-
propTypes: {
|
|
25
|
-
},
|
|
26
|
-
render: function() {
|
|
27
|
-
if (this.props.params.type == 'simple') return (<SimpleChartComponent />);
|
|
28
|
-
if (this.props.params.type == 'loading') return (<ChartShowLoadingComponent />);
|
|
29
|
-
if (this.props.params.type == 'api') return (<ChartAPIComponent />);
|
|
30
|
-
if (this.props.params.type == 'events') return (<ChartWithEventComponent />);
|
|
31
|
-
if (this.props.params.type == 'theme') return (<ThemeChartComponent />);
|
|
32
|
-
if (this.props.params.type == 'dynamic') return (<DynamicChartComponent />);
|
|
33
|
-
if (this.props.params.type == 'map') return (<MapChartComponent />);
|
|
34
|
-
|
|
35
|
-
if (this.props.params.type == 'airport') return (<AirportCoordComponent />);
|
|
36
|
-
if (this.props.params.type == 'graph') return (<GraphComponent />);
|
|
37
|
-
if (this.props.params.type == 'calendar') return (<CalendarComponent />);
|
|
38
|
-
if (this.props.params.type == 'treemap') return (<TreemapComponent />);
|
|
39
|
-
if (this.props.params.type == 'gauge') return (<GaugeComponent />);
|
|
40
|
-
if (this.props.params.type == 'gcalendar') return (<GCalendarComponent />);
|
|
41
|
-
if (this.props.params.type == 'lunar') return (<LunarCalendarComponent />);
|
|
42
|
-
if (this.props.params.type == 'liquid') return (<LiquidfillComponent />);
|
|
43
|
-
return (<DynamicChartComponent />);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
export default EchartsComponent;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactEcharts from '../lib/echarts-for-react';
|
|
3
|
-
import echarts from 'echarts';
|
|
4
|
-
|
|
5
|
-
const GCalendarComponent = React.createClass({
|
|
6
|
-
getVirtulData: function(year) {
|
|
7
|
-
year = year || '2017';
|
|
8
|
-
var date = +echarts.number.parseDate(year + '-01-01');
|
|
9
|
-
var end = +echarts.number.parseDate((+year + 1) + '-01-01');
|
|
10
|
-
var dayTime = 3600 * 24 * 1000;
|
|
11
|
-
var data = [];
|
|
12
|
-
for (var time = date; time < end; time += dayTime) {
|
|
13
|
-
data.push([
|
|
14
|
-
echarts.format.formatTime('yyyy-MM-dd', time),
|
|
15
|
-
Math.floor(Math.random() * 1000)
|
|
16
|
-
]);
|
|
17
|
-
}
|
|
18
|
-
return data;
|
|
19
|
-
},
|
|
20
|
-
getOtion: function() {
|
|
21
|
-
const option = {
|
|
22
|
-
tooltip: {
|
|
23
|
-
position: 'top'
|
|
24
|
-
},
|
|
25
|
-
visualMap: {
|
|
26
|
-
min: 0,
|
|
27
|
-
max: 1000,
|
|
28
|
-
calculable: true,
|
|
29
|
-
orient: 'horizontal',
|
|
30
|
-
left: 'center',
|
|
31
|
-
top: 'top'
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
calendar: [{
|
|
35
|
-
range: '2017',
|
|
36
|
-
cellSize: ['auto', 20]
|
|
37
|
-
}, {
|
|
38
|
-
top: 260,
|
|
39
|
-
range: '2016',
|
|
40
|
-
cellSize: ['auto', 20]
|
|
41
|
-
}],
|
|
42
|
-
|
|
43
|
-
series: [{
|
|
44
|
-
type: 'heatmap',
|
|
45
|
-
coordinateSystem: 'calendar',
|
|
46
|
-
calendarIndex: 0,
|
|
47
|
-
data: this.getVirtulData(2017)
|
|
48
|
-
}, {
|
|
49
|
-
type: 'heatmap',
|
|
50
|
-
coordinateSystem: 'calendar',
|
|
51
|
-
calendarIndex: 1,
|
|
52
|
-
data: this.getVirtulData(2016)
|
|
53
|
-
}]
|
|
54
|
-
};
|
|
55
|
-
return option;
|
|
56
|
-
},
|
|
57
|
-
render: function() {
|
|
58
|
-
return (
|
|
59
|
-
<div className='examples'>
|
|
60
|
-
<div className='parent'>
|
|
61
|
-
<label> render a calendar like github commit history. </label>
|
|
62
|
-
<ReactEcharts
|
|
63
|
-
option={this.getOtion()}
|
|
64
|
-
style={{height: '500px', width: '100%'}}
|
|
65
|
-
className='react_for_echarts' />
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
export default GCalendarComponent;
|