You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
3.6 KiB
156 lines
3.6 KiB
|
|
/**
|
|
* 显示好评, 中评, 差评--饼状图
|
|
*/
|
|
function queryCriticismRatio(data){
|
|
var dom = document.getElementById("criticism_ratio");
|
|
var criticism_ratio_chart = echarts.init(dom);
|
|
var option = {
|
|
tooltip : {
|
|
trigger : 'item',
|
|
formatter : "{a} <br/>{b} : {c} ({d}%)",
|
|
},
|
|
color : [ '#62c29a', '#ff772d', '#0f75b1' ],
|
|
series : [
|
|
{
|
|
name : '评论占比',
|
|
type : 'pie',
|
|
radius : [ '45%', '60%' ],
|
|
label: {
|
|
normal: {
|
|
formatter : "{b} : {c}\n {d}%"
|
|
},
|
|
},
|
|
data : data,
|
|
}
|
|
]
|
|
};
|
|
if (option && typeof option === "object") {
|
|
criticism_ratio_chart.setOption(option, true);
|
|
// echarts点击事件
|
|
criticism_ratio_chart.on('click', function(params) {
|
|
var ctype = params.data.text;
|
|
$("#ctype").val(ctype);
|
|
onSearch('', 'all');
|
|
});
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 查询游客关注维度
|
|
*/
|
|
function queryPeopleDimension(){
|
|
$.ajax({
|
|
type : 'POST',
|
|
url : _CTX + "/indexscenicgood/queryScenicDimension.do?",
|
|
dataType : 'json',
|
|
success : function(data) {
|
|
var positiveArr = [];//正面
|
|
var positiveSpotArr = [];//正面百分比
|
|
var negativeArr = [];//负面
|
|
var negativeSpotArr = [];//负面百分比
|
|
var my_indicator = [];//显示名称
|
|
if (data) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
positiveArr.push(data[i].znum);
|
|
positiveSpotArr.push(data[i].zRate);
|
|
negativeArr.push(data[i].fnum);
|
|
negativeSpotArr.push(data[i].fRate);
|
|
my_indicator.push({text : data[i].dname, max : 100});
|
|
}
|
|
}
|
|
showPeopleDimension(positiveArr, positiveSpotArr, negativeArr, negativeSpotArr, my_indicator);
|
|
}
|
|
});
|
|
}
|
|
|
|
//显示游客关注维度 雷达图
|
|
function showPeopleDimension(positiveArr, positiveSpotArr, negativeArr, negativeSpotArr, my_indicator) {
|
|
var dom = document.getElementById("people_dimension");
|
|
var people_dimension_chart = echarts.init(dom);
|
|
|
|
var option = {
|
|
tooltip : {
|
|
formatter: function (params) {
|
|
var name = params.name;
|
|
var show_data_array = [];
|
|
var show_data_spot_array = []
|
|
if(name == "正面"){
|
|
show_data_array = positiveArr;
|
|
show_data_spot_array = positiveSpotArr;
|
|
}else{
|
|
show_data_array = negativeArr;
|
|
show_data_spot_array = negativeSpotArr;
|
|
}
|
|
var data_name = '';
|
|
for(var i=0;i<show_data_array.length;i++){
|
|
data_name += my_indicator[i].text+':'+show_data_array[i]+'('+show_data_spot_array[i]+'%)<br/>';
|
|
}
|
|
return name + '<br/>' + data_name
|
|
}
|
|
},
|
|
legend : {
|
|
type: 'scroll',
|
|
orient: 'vertical',
|
|
data : ['正面', '负面'],
|
|
left: '0.5%',
|
|
textStyle : {
|
|
color : '#fff'
|
|
},
|
|
},
|
|
color : [ '#ec9e05', '#46dff3' ], // 调色盘颜色列表。
|
|
radar : [ {
|
|
indicator : my_indicator,
|
|
center : [ '50%', '50%' ],
|
|
radius: '40%',
|
|
shape : 'polygon',
|
|
name : {
|
|
formatter : '{value}',
|
|
textStyle : {
|
|
color : '#fff'
|
|
}
|
|
},
|
|
splitArea : {
|
|
areaStyle : {
|
|
color : [ '#0E2A43',
|
|
'#0E2A43', '#0E2A43',
|
|
'#0E2A43', '#0E2A43'
|
|
],
|
|
shadowColor : 'rgba(0, 0, 0, 0.3)',
|
|
shadowBlur : 10
|
|
}
|
|
},
|
|
axisLine : {
|
|
lineStyle : {
|
|
color : 'rgba(255, 255, 255, 0.5)'
|
|
}
|
|
},
|
|
splitLine : {
|
|
lineStyle : {
|
|
color : 'rgba(255, 255, 255, 0.5)'
|
|
}
|
|
}
|
|
} ],
|
|
series : [ {
|
|
name : '雷达图',
|
|
type : 'radar',
|
|
data : [ {
|
|
name : '正面',
|
|
value : positiveSpotArr,
|
|
}, {
|
|
name : '负面',
|
|
value : negativeSpotArr,
|
|
symbol : 'rect',
|
|
symbolSize : 0,
|
|
areaStyle : {
|
|
normal : {
|
|
color : 'rgba(255, 255, 255, 0.5)'
|
|
}
|
|
},
|
|
} ]
|
|
} ]
|
|
};
|
|
if (option && typeof option === "object") {
|
|
people_dimension_chart.setOption(option, true);
|
|
}
|
|
}
|
|
|