123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- $(function() {
- function createBar2() {
-
- var chartDom = document.getElementById('main2');
- var myChart = echarts.init(chartDom);
- var option;
-
- option = {
- legend: {
- top:300,
- left:20,
- textStyle:{
- fontSize: 16,
- color: '#fff',
- },
-
- data: ['入场人数', '浏览人数', '投递人数']
- },
- color: [
- '#4e6eac',
- '#6895f7',
- '#8aadf9',
-
- ],
- xAxis: { show: false },
- yAxis: { show: false, type: 'category', inverse: true, min: 0, max: 6 },
- series: [
- {
- type: 'funnel',
- minSize: 50,
- maxSize: '100%',
- left: '4%',
- top: 0,
- bottom: 50,
- gap: 2,
- label: {
- position: 'inside',
- fontFamily: 'Microsoft YaHei',
- fontSize: 16,
- color: '#fff',
- formatter: '{c}%',
- rich: { xx: { padding: [6, 0] } }
- },
- data: [
- { value: 100, name: '入场人数' },
- { value: 80, name: '浏览人数' },
- { value: 20, name: '投递人数' },
- ]
- },
-
-
- ]
- };
-
- option && myChart.setOption(option);
-
- }
- function createBar3() {
-
- var chartDom = document.getElementById('main3');
- var myChart = echarts.init(chartDom);
- var option;
-
- option = {
- tooltip: {
- trigger: 'axis'
- },
- grid:{
- x:50,y:30,x2:40,y2:30,
- },
- textStyle: {
- color: '#cccccc',
- fontSize: 20
- },
- xAxis: {
- type: 'category',
- boundaryGap: false,
-
- data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun', 'Sun2',]
- },
- yAxis: {
- type: 'value',
- },
- series: [
- {
- data: [null,120, 932, 901, 934, 1290, 1330, 1320],
- type: 'line',
- areaStyle: {}
- }
- ]
- };
-
- option && myChart.setOption(option);
- }
- function createBar4() {
-
- var chartDom = document.getElementById('main4');
- var myChart = echarts.init(chartDom);
- var option;
-
- option = {
- textStyle: {
- color: '#cccccc',
- fontSize: 20
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: {
- type: 'category',
- data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
- },
- yAxis: {
- type: 'value'
- },
- series: [
- {
- data: [120, 200, 150, 80, 70, 110, 130],
- type: 'bar'
- }
- ]
- };
-
- option && myChart.setOption(option);
- }
-
- function createBar1(title, data, clickEvent) {
-
-
- var chartDom = document.getElementById('main1');
- var myChart = echarts.init(chartDom);
- var option;
-
- option = {
- title:[
- {
- text: '求职者性别分布',
- left:'8%',//居中显示
- top:'80%',//底部显示
- textStyle: {
- color: '#cccccc',
- fontSize: 20
- }
- },
- {
- text: '求职者年龄分布',
- left:'43%',//居中显示
- top:'80%',//底部显示
- textStyle: {
- color: '#cccccc',
- fontSize: 20
- }
- },
- {
- text: '求职者学历分布',
- left:'73%',//居中显示
- top:'80%',//底部显示
- textStyle: {
- color: '#cccccc',
- fontSize: 20
- }
- }],
- dataset: [
- {
- source: [
- ['Product', 'Sales', 'Price', 'Year'],
- ['啊大', 123, 32, 2011],
- ['中砂', 231, 14, 2011],
- ['豆腐', 235, 5, 2011],
- ['米有', 341, 25, 2011],
- ['碧霞', 122, 29, 2011],
-
- ['啊大', 143, 30, 2012],
- ['中砂', 201, 19, 2012],
- ['豆腐', 255, 7, 2012],
- ['米有', 241, 27, 2012],
- ['碧霞', 102, 34, 2012],
-
- ['啊大', 153, 28, 2013],
- ['中砂', 181, 21, 2013],
- ['豆腐', 395, 4, 2013],
- ['米有', 281, 31, 2013],
- ['碧霞', 92, 39, 2013],
-
- ['啊大', 223, 29, 2014],
- ['中砂', 211, 17, 2014],
- ['豆腐', 345, 3, 2014],
- ['米有', 211, 35, 2014],
- ['碧霞', 72, 24, 2014]
- ]
- },
- {
- transform: {
- type: 'filter',
- config: { dimension: 'Year', value: 2011 }
- }
- },
- {
- transform: {
- type: 'filter',
- config: { dimension: 'Year', value: 2012 }
- }
- },
- {
- transform: {
- type: 'filter',
- config: { dimension: 'Year', value: 2013 }
- }
- }
- ],
- series: [
- {
- type: 'pie',
- label: {
- normal: {
-
- textStyle : {
-
- color: '#cccccc',
-
- fontSize : '12px'
-
- },
- },
-
- },
- radius:[40, 60],
-
- datasetIndex: 1
- },
- {
- label: {
- normal: {
-
- textStyle : {
-
- color: '#cccccc',
-
- fontSize : '12px'
-
- },
- },
-
- },
- type: 'pie',
- radius:[40, 60],
- datasetIndex: 2
- },
- {
- label: {
- normal: {
-
- textStyle : {
-
- color: '#cccccc',
-
- fontSize : '12px'
-
- },
- },
-
- },
- type: 'pie',
- radius:[40, 60],
- datasetIndex: 3
- }
- ],
- // Optional. Only for responsive layout:
- media: [
- {
- query: { minAspectRatio: 1 },
- option: {
- series: [
- { center: ['18%', '50%'] },
- { center: ['50%', '50%'] },
- { center: ['82%', '50%'] }
- ]
- }
- },
- {
- option: {
- series: [
- { center: ['50%', '25%'] },
- { center: ['50%', '50%'] },
- { center: ['50%', '75%'] }
- ]
- }
- }
- ]
- };
-
- option && myChart.setOption(option);
-
- }
-
- createBar1();
- createBar2();
- createBar3();
- createBar4();
- })
|