How can i get access to a Highcharts chart through a DOM-Container

转载 2015年11月19日 22:44:43

Highcharts 3.0.1

Users can use the highcharts plugin

var chart=$("#container").highcharts();

Highcharts 2.3.4

Read from the Highcharts.charts array, for version 2.3.4 and later, the index of the chart can be found from the data on the div

 var index=$("#container").data('highchartsChart');
 var chart=Highcharts.charts[index];

All versions

Track charts in a global objec/map by container id

var window.charts={}; 
function foo(){
  new Highcharts.Chart({...},function(chart){  
      window.charts[chart.options.chart.renderTo] = chart;
  });
}

function bar(){
  var chart=window.charts["containerId"];
}

Read Mode @ http://ahumbleopinion.com/highcharts-tips-accessing-chart-object-from-container-id/


创建chart:

var chart = new Highcharts.Chart(options);
// Using an element reference
var otherOptions = {
chart: {
renderTo: document.getElementById('container');
},
// ...
}
var otherChart = new Highcharts.Chart(options);

举报

相关文章推荐

How to get a solution?

How to get a solution?我们所做的topic,一般有几个阶段: Analysis: 分析问题,找到问题的关键 Modeling / Formulation:  对问题进行数...

How to Create a First Shell Script

How to Create a First Shell Script   Shell scripts are short programs that are written i...

精选:深入理解 Docker 内部原理及网络配置

网络绝对是任何系统的核心,对于容器而言也是如此。Docker 作为目前最火的轻量级容器技术,有很多令人称道的功能,如 Docker 的镜像管理。然而,Docker的网络一直以来都比较薄弱,所以我们有必要深入了解Docker的网络知识,以满足更高的网络需求。

How to: Access a Duplex Service

How to: Access a Duplex Service Silverlight This topic describes how to create a Silver...

How do I get a preference value?

ps:这篇博文的完成过程异常痛苦,对我来说, 这 块的知识是基本弄明白了。但估计写在这里,能明了的人不是很多,应该是还没有理解得更透彻的原因。不过,如果你真正懂插件,或许能看懂的。 1.针对有UI的...

How to get a job as a programmer

It seems that for the better part of my life, America’s economy has been in murky water. I was born ...

How to SSH to a VirtualBox guest externally through a host?

这个题目翻译过来就是: 如

How to create a Gantt chart in SharePoint

How to create a Gantt chart in SharePoint Misleading title, as there isn’t a way to create a...
  • pclzr
  • pclzr
  • 2011-11-18 09:44
  • 632

how to create a stacked chart use jasper

How to make a stacked chart 1, prepare data Source 2, import/configuring a data source (1)    openec...

How can I get a String from HID device in Python with evdev?

http://stackoverflow.com/questions/19732978/how-can-i-get-a-string-from-hid-device-in-python-with-ev...

GP学习(八)—How to access a raster dataset and to create a raster dataset

How to access a raster dataset Summary A raster dataset can be stored as file based or in a ...
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)