$(function () { var prodAnual = [[1041379200000,423], [1073001600000,488], [1104537600000,490], [1136160000000,401], [1167609600000,436], [1199232000000,249], [1230854400000,74], [1262476800000,10]]; var prodMensal = [[1041379200000,45], [1044057600000,40], [1046476800000,32], [1049151600000,33], [1051743600000,27], [1054508400000,33], [1057014000000,48], [1059692400000,23], [1062370800000,31], [1065049200000,36], [1067644800000,34], [1070236800000,41], [1073001600000,31], [1075593600000,44], [1078099200000,32], [1080774000000,26], [1083366000000,33], [1086044400000,35], [1088636400000,34], [1091314800000,39], [1093993200000,54], [1096585200000,57], [1099267200000,50], [1101859200000,53], [1104537600000,56], [1107216000000,54], [1109635200000,56], [1112310000000,45], [1114902000000,48], [1117580400000,34], [1120172400000,32], [1122850800000,23], [1125529200000,35], [1128121200000,37], [1130803200000,30], [1133395200000,40], [1136160000000,38], [1138752000000,39], [1141171200000,32], [1143846000000,33], [1146438000000,35], [1149116400000,33], [1151794800000,28], [1154386800000,27], [1157065200000,33], [1159830000000,38], [1162339200000,36], [1165017600000,29], [1167609600000,47], [1170288000000,48], [1172880000000,37], [1175382000000,32], [1177974000000,32], [1180652400000,40], [1183244400000,33], [1185922800000,28], [1188601200000,36], [1191193200000,32], [1193961600000,36], [1196467200000,35], [1199232000000,18], [1201910400000,28], [1204329600000,33], [1207004400000,26], [1209596400000,27], [1212361200000,18], [1214866800000,19], [1217631600000,12], [1220396400000,13], [1222902000000,31], [1225756800000,9], [1228089600000,15], [1230854400000,16], [1233446400000,15], [1236211200000,5], [1240095600000,6], [1241305200000,11], [1243810800000,3], [1246748400000,5], [1250031600000,2], [1252796400000,2], [1254351600000,2], [1257206400000,5], [1260230400000,2], [1262476800000,5], [1265241600000,3], [1267574400000,2]]; var numSubscritores = [[1041379200000,2208], [1044057600000,2245], [1046476800000,2262], [1049151600000,2290], [1051743600000,2326], [1054508400000,2364], [1057014000000,2402], [1059692400000,2407], [1062370800000,2433], [1065049200000,2455], [1067644800000,2525], [1070236800000,2561], [1073001600000,2613], [1075593600000,2637], [1078099200000,2650], [1080774000000,2677], [1083366000000,2715], [1086044400000,2763], [1088636400000,2849], [1091314800000,2875], [1093993200000,2924], [1096585200000,2950], [1099267200000,2970], [1101859200000,3020], [1104537600000,3031], [1107216000000,3050], [1109635200000,3120], [1112310000000,3130], [1114902000000,3130], [1117580400000,3130], [1120172400000,3180], [1122850800000,3180], [1125529200000,3184], [1128121200000,3190], [1130803200000,3184], [1133395200000,3164], [1136160000000,3219], [1138752000000,3243], [1141171200000,3264], [1143846000000,3337], [1146438000000,3359], [1149116400000,3360], [1151794800000,3360], [1154386800000,3388], [1157065200000,3479], [1159830000000,3500], [1162339200000,3541], [1165017600000,3532], [1167609600000,3579], [1170288000000,3599], [1172880000000,3594], [1175382000000,3815], [1177974000000,3845], [1180652400000,3857], [1183244400000,3871], [1185922800000,3877], [1188601200000,3886], [1191193200000,3885], [1193961600000,3916], [1196467200000,3929], [1199232000000,3951], [1201910400000,3979], [1204329600000,4000], [1207004400000,4000], [1209596400000,4000], [1212361200000,4000], [1214866800000,4000], [1217631600000,4000], [1220396400000,4000], [1222902000000,4000], [1225756800000,4000], [1228089600000,4000], [1230854400000,4000], [1233446400000,4000], [1236211200000,4000], [1240095600000,4184], [1241305200000,4162], [1243810800000,4187], [1246748400000,4000], [1250031600000,4000], [1252796400000,4000], [1254351600000,4201], [1257206400000,4230], [1260230400000,4234], [1262476800000,4323], [1265241600000,4341], [1267574400000,4347]]; function showTooltip(x, y, contents) { $('
' + contents + '<\/div>').css( { position: 'absolute', display: 'none', top: y + 12, left: x + 12, opacity: 0.80 }).appendTo("body").fadeIn(400); } $.plot($("#graph_prod_ml"), [ { data: prodMensal, label: "Produção mensal", color: '#297bb5' }, { data: prodAnual, label: "Produção anual", yaxis: 2, color: "#7aa612" } ], { xaxis: { mode: 'time', timeformat: '%y' }, lines: { show: true, lineWidth: 3 }, points: { show: true }, grid: { hoverable: true, color: '#222', backgroundColor: '#fff', labelMargin: 6, borderWidth: 0.5 }, yaxis: { min: 1, tickDecimals: 0 }, y2axis: { min: 1, tickDecimals: 0, tickFormatter: function (v, axis) { return v.toFixed(axis.tickDecimals) +" edições" } }, legend: { position: 'sw', labelBoxBorderColor: '#999' } }); var previousPoint = null; $("#graph_prod_ml").bind("plothover", function (event, pos, item) { if (item) { if (previousPoint != item.datapoint) { previousPoint = item.datapoint; $(".stats-tooltip").remove(); var x = item.datapoint[0], y = item.datapoint[1]; showTooltip(item.pageX, item.pageY, item.series.label + ": " + y); } } else { $(".stats-tooltip").remove(); previousPoint = null; } }); $.plot($("#graph_subs_ml"), [ { data: numSubscritores, label: "Número de subscritores", yaxis: 2, color: '#f90' } ], { xaxis: { mode: 'time', timeformat: '%y' }, lines: { show: true, fill: 0.2 }, points: { show: true }, grid: { hoverable: true, color: '#222', backgroundColor: '#fff', labelMargin: 6, borderWidth: 0.5 }, y2axis: { min: 2001, tickDecimals: 0, tickFormatter: function (v, axis) { return v.toFixed(axis.tickDecimals) +" subscritores" } }, legend: { position: 'nw', labelBoxBorderColor: '#999' } }); var previousPoint = null; $("#graph_subs_ml").bind("plothover", function (event, pos, item) { if (item) { if (previousPoint != item.datapoint) { previousPoint = item.datapoint; $(".stats-tooltip").remove(); var x = item.datapoint[0], y = item.datapoint[1]; showTooltip(item.pageX, item.pageY, item.series.label + ": " + y); } } else { $(".stats-tooltip").remove(); previousPoint = null; } }); });