1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
show_group_report: function(data){ var wrap = this; var d1 = data.data; var labels = data.labels; $.plot($("#group_report"), [ { label: 'Clicks', data:d1, bars: {show:true} } ], { series: { //lines:{show:true}, //points: {show:true} }, xaxis: { ticks: labels, tickDecimals: 0, tickFormatter: function(val, axis){ return val + 'test'; } }, grid: { hoverable: true, clickable: true }, tooltip: true, tooltipOpts: { //%s: label | X: %x | Y: %y | 3rd value of data array: %ct(Custom tooltip) content: '%ct: %y clicks', shifts: { x: -60, y: 25 } } }); $("#group_report").bind("plotclick", function (event, pos, item) { if (item) { var index = item.dataIndex; var data = item.series.data[index]; //data[index] example: [1, "174", "成田機場@blog", "3537"] //console.log(data); $('#md_group h3').html(data[2]); wrap.get_group_daily_data(data[3], $("#from_date").val(), $("#to_date").val()); } }); } |