| 2 |
jQuery('th',statify_data_table).each(function(){labels.push(jQuery(this).text())});jQuery('td',statify_data_table).each(function(){data.push(jQuery(this).text())});var maxValue=Math.max.apply(Math,data);var chart=new Chartist.Line('#statify_chart',{labels:labels,series:[data]},{low:0,showArea:!0,fullWidth:!0,axisX:{showGrid:!1,showLabel:!1,offset:0},axisY:{showGrid:!1,showLabel:!0,type:Chartist.FixedScaleAxis,low:0,high:maxValue+1,ticks:[maxValue],offset:15},plugins:[Chartist.plugins.tooltip({appendToBody:!0,class:'statify-chartist-tooltip'})]});var pointRadius=4;if(data.length>365)pointRadius=0;else if(data.length>180)pointRadius=1;else if(data.length>90)pointRadius=2;chart.on('draw',function(data){if('point'===data.type){var circle=new Chartist.Svg('circle',{cx:[data.x],cy:[data.y],r:[pointRadius],'ct:value':data.value.y+' '+(data.value.y>1?statify_translations.pageviews:statify_translations.pageview),'ct:meta':labels[data.index]},'ct-point');data.element.replace(circle)}})})() |