Changeset 17775
- Timestamp:
- 05/04/14 16:43:22 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/viewer/index.js
r17772 r17775 311 311 312 312 setupAccordion('#accordion2', '#cameracontainer'); 313 setupAccordion('#accordion7', '#histcontainer' );313 setupAccordion('#accordion7', '#histcontainer', true); 314 314 setupAccordion('#accordion3', '#waveformcontainer'); 315 315 setupAccordion('#accordion4', '#helpcontainer', true); … … 400 400 plot.draw(); 401 401 plot.clearSelection(); 402 } 403 404 function onPlotHover(event, pos, item) 405 { 406 if (!item) 407 { 408 $("#tooltip").fadeOut(100); 409 return; 410 } 411 412 var x = item.datapoint[0].toFixed(2); 413 var y = item.datapoint[1].toFixed(2); 414 415 var tooltip = $("#tooltip"); 416 tooltip.html(parseInt(x) + " / " + y); 417 tooltip.css({top: item.pageY-20, left: item.pageX+5}); 418 tooltip.fadeIn(200); 402 419 } 403 420 … … 438 455 439 456 var hist = $.plot("#hist"+n, [ { data:bins, bars: {show:true} } ], opts); 440 $('#hist'+n).bind("plothover", function (event, pos, item) 441 { 442 if (!item) 443 { 444 $("#tooltip").fadeOut(100); 445 return; 446 } 447 448 var x = item.datapoint[0].toFixed(2); 449 var y = item.datapoint[1].toFixed(2); 450 451 var tooltip = $("#tooltip"); 452 tooltip.html(parseInt(x) + " / " + y); 453 tooltip.css({top: item.pageY-20, left: item.pageX+5}); 454 tooltip.fadeIn(200); 455 }); 456 457 457 $('#hist'+n).bind("plothover", onPlotHover); 458 458 } 459 459 … … 702 702 setZoom(waveform.xmin-1, waveform.xmax+1, waveform.ymin-5, waveform.ymax+5); 703 703 }); 704 waveform.bind("plothover", function (event, pos, item) 705 { 706 if (!item) 707 { 708 $("#tooltip").fadeOut(100); 709 return; 710 } 711 712 var x = item.datapoint[0].toFixed(2); 713 var y = item.datapoint[1].toFixed(2); 714 715 var tooltip = $("#tooltip"); 716 tooltip.html(parseInt(x) + " / " + y+" "+item.series.label); 717 tooltip.css({top: item.pageY-20, left: item.pageX+5}); 718 tooltip.fadeIn(200); 719 }); 720 } 721 704 waveform.bind("plothover", onPlotHover); 705 } 722 706 } 723 707
Note:
See TracChangeset
for help on using the changeset viewer.