123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- (function($) {
- /**
- * @author
- * @constructor createChart
- * @param json
- * @returns HightChart
- * @since 1.0.1
- */
-
- $.fn.createChart = function(paramsData) {
- var chart=$(this).highcharts({
- chart: {
- polar: true,
- marginBottom:'150',
- margintop:'20',
- opposite: true,
- inverted:false,
- borderRadius:"5",
- style:{
- background:'#192735'
- },
- backgroundColor: "" ,
- /***********************************************************************/
- events: {
- load: function () {
- if(1==rendState){
- var series = this.series;
- setInterval(function () {
- $.post("/nwyj/ws/ChartDaoServiceImpl/ChartDaoServiceImpl/getChartInfo",{comId:comId,childId:childId,typeId:"5",date:getNowDateTime()},function(result){
- data=result;
- var count=0;
- for(var item in categorie){
- for(var i in state){
- if(state[i].column=="TQ_TD_COUNT"){
- console.log("===count"+count);
- series[count].addPoint(
- [getNowTime(), changeQ(result[item]["TQ_TD_COUNT"])
- -changeQ(result[item]["TQ_UNRECOVERED"])], true, true);
- count++;
- }else{
- console.log("===count"+count);
- series[count].addPoint(
- [getNowTime(), changeQ(result[item]["TQ_UNRECOVERED"])], true, true);
- count++;
- }
- }
- }
- console.log("serieslength===="+series.length+";count="+count);
- },"json");
- }, interval*1000);
- }
- }
- }
- /***********************************************************************/
-
-
- },
- /* title:{
- align:'center',
- text:paramsData["title.text"],
- style: {
- color:"#ffc000",
- fontSize:26,
- fontWeight: 'bold'
- }},*/
- title:{
- text: '',
- floating: true
- },
- subtitle:{
- align:'right',
- floating:true,
- verticalAlign:'top',
- text:paramsData["subtitle.text"],
- style: {
- color:"#a73800",
- fontSize:18,
- }
- },
- xAxis: {
- lineColor:'#3E4A55',
- labels:{
- style: {color: '#ffffff',},
- lineColor:'#0f0'
- },
- tickColor: '#3E4A55',
- categories:paramsData["xAxis.categories"]},
- yAxis: [{
- lineWidth: 1,
- lineColor:'#3E4A55',
- title: {text:paramsData["yAxis.title.text"], opposite: true},
- gridLineWidth: "1",
- gridLineColor:"#3E4A55",
-
- tickPositions:paramsData["yAxis.tickPositions"],
- labels:{
- style: {color: '#ffffff'}
- }
- }],
- // yAxis:{categories:paramsData["yAxis.categories"]},
- legend: {
- layout: 'horizontal',
- backgroundColor: 'rgba(255,255,255,0)',
- floating: 'true',
- align: 'center',
- verticalAlign: 'bottom',
- /* x:-10,*/
- y:-40,
- itemStyle: {
- color: '#ffffff',
- fontSize:18
- },
- itemHoverStyle: {
- color: '#B6BABF'
- }
- },
- credits:{enabled:false},
- plotOptions: {
- column: {
- pointPadding: 1,
- borderWidth: 1,
- borderColor:null,
- pointWidth: 25,
- stacking: 'normal'
- }
- },
- series: paramsData["series"],
- exporting: {
- enabled: true
- }
- });
- } ;
- })(jQuery) ;
-
|