ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Add a link/button in the htmlExpand

Add a link/button in the htmlExpand

原创 Linux操作系统 作者:hky87 时间:2010-07-07 17:11:31 0 删除 编辑
在highslide应用中,对高亮显示框中的文字添加超链接或按钮的方法。
该例子是基于highcharts应用上的
 
http://www.w3.org/TR/html4/strict.dtd">

 
  
  Highcharts Example
  
  
  
<!-- 1. Add these JavaScript. inclusions in the head of your page -->
  

  

  
<!--[if IE]>
   
    
  
  
  

<!-- 2. Add the JavaScript. to initialize the chart on document ready -->
  

  
            var chart;
  //globally available
            $(document).ready(function() {
   
       chart = new Highcharts.Chart({
    chart: {
     renderTo: 'container',
     defaultSeriesType: 'spline'
    },
    title: {
     text: 'Monthly Average Temperature in Tokyo'
    },
    subtitle: {
     text: 'Source: WorldClimate.com'
    },
    xAxis: {
     categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
      'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
     title: {
      text: 'Month'
     }
    },
    yAxis: {
     title: {
      text: 'Temperature (°C)'
     }
    },
    legend: {
     enabled: false
    },
    tooltip: {
     formatter: function() {
                   return ''+ this.series.name +'
'+
       this.x +': '+ this.y +'°C';
     }
    },
    plotOptions: {
     spline: {
      cursor: 'pointer',
      point: {
       events: {
        click: function() {
        //alert("Hello Word!");
         //window.open("line-basic.htm");
         //window.navigate("line-basic.htm");
        //window.location.href="line-basic.htm";

  /*hs.expand(null, {
      src: 'skies.jpg'
   });
hs.Expander.prototype.onImageClick = function (sender) {
   return window.open("line-basic.htm");
}*/
         hs.htmlExpand(null, {
          pageOrigin: {
           x: this.pageX,
           y: this.pageY
          },
          headingText: "\n \n"+this.series.name+"",
          maincontentText: 'this.category: '+ this.category +
           '
this.y: '+ this.y,

          width: 200
         }); 
        }
       }
      }
     }
    },
    
    series: [{
     name: 'Tokyo',
     dataURL: 'tokyo.json'
    }]
   });
   
   
  });
  
  
 
   
   



 
  
  <!-- 3. Add the container -->
  

  
    
 

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10314474/viewspace-667505/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: Database Link的创建
请登录后发表评论 登录
全部评论

注册时间:2009-10-09

  • 博文量
    87
  • 访问量
    345410