merge sanjiangyuan branch r4410 - r4534 to sanjiangyuan-sub
This commit is contained in:
parent
46e82a7b2d
commit
1d71ee178c
|
@ -2209,6 +2209,7 @@ class Admin_DataController extends Zend_Controller_Action
|
|||
|
||||
$ac = $this->_request->getParam('ac');
|
||||
$uuid = $this->_request->getParam('uuid');
|
||||
set_time_limit(0);
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if($auth->hasIdentity())
|
||||
|
@ -2566,7 +2567,7 @@ class Admin_DataController extends Zend_Controller_Action
|
|||
unset($mailtp);
|
||||
//email to author
|
||||
$mail=new WestdcMailer($this->view->config->smtp);
|
||||
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
||||
$mail->setFrom($this->view->config->service->email,'数据服务组');
|
||||
$mailtp=new EmailText($this->db,"version-commit-author",array(
|
||||
'user' => $user->username,
|
||||
'uuid' => $row['uuid'],
|
||||
|
@ -2620,7 +2621,7 @@ class Admin_DataController extends Zend_Controller_Action
|
|||
unset($mailtp);
|
||||
//email to author
|
||||
$mail=new WestdcMailer($this->view->config->smtp);
|
||||
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
||||
$mail->setFrom($this->view->config->service->email,'数据服务组');
|
||||
$mailtp=new EmailText($this->db,"version-commit-author",array(
|
||||
'user' => $user->username,
|
||||
'uuid' => $row['uuid'],
|
||||
|
@ -2686,7 +2687,7 @@ class Admin_DataController extends Zend_Controller_Action
|
|||
|
||||
//email to admin & author
|
||||
$mail=new WestdcMailer($this->view->config->smtp);
|
||||
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
||||
$mail->setFrom($this->view->config->service->email,'数据服务组');
|
||||
$mailtp=new EmailText($this->db,"metadata-release",array(
|
||||
'user' => $user->username,
|
||||
'uuid' => $row['uuid'],
|
||||
|
@ -3837,6 +3838,22 @@ class Admin_DataController extends Zend_Controller_Action
|
|||
|
||||
}//fund
|
||||
|
||||
public function visualAction()
|
||||
{
|
||||
$uuid = $this->_getParam('uuid');
|
||||
$submit = $this->_getParam('submit');
|
||||
|
||||
if(!empty($uuid))
|
||||
{
|
||||
$this->_helper->viewRenderer('visual-add');
|
||||
$this->view->data = ['uuid' => $uuid];
|
||||
if(empty($submit))
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function doiAction()
|
||||
{
|
||||
$ac = $this->_getParam('ac');
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<?php
|
||||
use Helpers\View as view;
|
||||
|
||||
class Admin_SysController extends Zend_Controller_Action
|
||||
{
|
||||
function preDispatch()
|
||||
|
@ -86,6 +88,15 @@ class Admin_SysController extends Zend_Controller_Action
|
|||
|
||||
}//模板编辑
|
||||
|
||||
else if($ac=='del'&& !empty($id))
|
||||
{
|
||||
$sql="delete from emailtext where id='$id' ";
|
||||
$rs = $this->db->query($sql);
|
||||
view::Post($this,'模板已删除',-1);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
else if($ac=='test'&& !empty($id))
|
||||
{
|
||||
if(!empty($submit))
|
||||
|
@ -424,10 +435,10 @@ class Admin_SysController extends Zend_Controller_Action
|
|||
if ($ac=='' || $ac=='online')
|
||||
{
|
||||
$sql = "SELECT m.title,m.uuid,ds.host,ds.path,
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
t.filecount from metadata m
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
t.filecount from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
|
||||
where s.status>4 and m.datatype=0 and ds.host='ftp1.westgis.ac.cn'
|
||||
ORDER BY m.id DESC";
|
||||
|
@ -440,15 +451,15 @@ class Admin_SysController extends Zend_Controller_Action
|
|||
$paginator->setItemCountPerPage($pages);
|
||||
$paginator->setView($this->view);
|
||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
|
||||
$this->view->paginator=$paginator;
|
||||
$this->view->paginator=$paginator;
|
||||
$ac='online';
|
||||
} else if ($ac=='heihe')
|
||||
{
|
||||
$sql = "SELECT m.title,m.uuid,ds.host,ds.path,
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
t.filecount from metadata m
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
t.filecount from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
|
||||
left join datasource on datasource.uuid=m.uuid
|
||||
left join source on datasource.sourceid=source.id
|
||||
|
@ -466,15 +477,15 @@ class Admin_SysController extends Zend_Controller_Action
|
|||
$this->view->paginator=$paginator;
|
||||
} else if ($ac=='water')
|
||||
{
|
||||
$sql = "SELECT m.title,m.uuid,ds.host,ds.path,
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
t.filecount from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
|
||||
left join datasource on datasource.uuid=m.uuid
|
||||
left join source on datasource.sourceid=source.id
|
||||
where s.status>4 and m.datatype=1 and ds.host='ftp1.westgis.ac.cn' and source.code='water'
|
||||
$sql = "SELECT m.title,m.uuid,ds.host,ds.path,
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
t.filecount from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
|
||||
left join datasource on datasource.uuid=m.uuid
|
||||
left join source on datasource.sourceid=source.id
|
||||
where s.status>4 and m.datatype=1 and ds.host='ftp1.westgis.ac.cn' and source.code='water'
|
||||
ORDER BY m.title DESC";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth->execute();
|
||||
|
@ -489,7 +500,7 @@ class Admin_SysController extends Zend_Controller_Action
|
|||
} else if ($ac=='heihe1')
|
||||
{
|
||||
$sql = "SELECT m.title,m.uuid,ds.host,ds.path,
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
t.filecount from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
|
@ -511,11 +522,11 @@ class Admin_SysController extends Zend_Controller_Action
|
|||
} else if ($ac=='hiwater')
|
||||
{
|
||||
$sql = "SELECT m.title,m.uuid,ds.host,ds.path,
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
t.filecount from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
|
||||
left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
|
||||
left join datasource on datasource.uuid=m.uuid
|
||||
left join source on datasource.sourceid=source.id
|
||||
where ds.host='ftp1.westgis.ac.cn' and source.code='hiwater'
|
||||
|
@ -533,10 +544,10 @@ class Admin_SysController extends Zend_Controller_Action
|
|||
}else if ($ac=='westee')
|
||||
{
|
||||
$sql = "SELECT m.title,m.uuid,ds.host,ds.path,
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
t.filecount from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
|
||||
where ds.host='ftp1.westgis.ac.cn' and m.uuid in (select uuid from westeemd)
|
||||
ORDER BY m.title DESC";
|
||||
|
@ -553,10 +564,10 @@ class Admin_SysController extends Zend_Controller_Action
|
|||
}else if ($ac=='other')
|
||||
{
|
||||
$sql = "SELECT m.title,m.uuid,ds.host,ds.path,
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
floor(t.filesize/1024/1024*100)/100 as filesize,
|
||||
t.filecount from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
|
||||
where ds.host='ftp1.westgis.ac.cn' and m.uuid not in (select uuid from datasource) and m.uuid not in (select uuid from westeemd)
|
||||
ORDER BY m.title DESC";
|
||||
|
@ -573,7 +584,7 @@ class Admin_SysController extends Zend_Controller_Action
|
|||
}
|
||||
$this->view->activeID="btn-".$ac;
|
||||
}
|
||||
|
||||
|
||||
function problemAction()
|
||||
{
|
||||
$pages=20;
|
||||
|
@ -581,7 +592,7 @@ class Admin_SysController extends Zend_Controller_Action
|
|||
if ($ac=='' || $ac=='ref')
|
||||
{
|
||||
$sql = "SELECT m.title,m.uuid,m.citation,g.id as gid from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
left join geonetworkmetadata g on g.uuid=m.uuid
|
||||
where s.status>4 and m.citation like '%??%'
|
||||
ORDER BY m.id DESC";
|
||||
|
@ -594,16 +605,16 @@ class Admin_SysController extends Zend_Controller_Action
|
|||
$paginator->setItemCountPerPage($pages);
|
||||
$paginator->setView($this->view);
|
||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
|
||||
$this->view->paginator=$paginator;
|
||||
$this->_helper->viewRenderer('problem-ref');
|
||||
$this->view->paginator=$paginator;
|
||||
$this->_helper->viewRenderer('problem-ref');
|
||||
$ac='ref';
|
||||
} else if ($ac=='file')
|
||||
{
|
||||
$sql = "SELECT m.title,m.uuid,m.filesize,ds.host,ds.path from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
where s.status>4 and ds.id not in (select distinct dsid from datafile)
|
||||
group by m.title,m.uuid,ds.host,ds.path,m.filesize
|
||||
$sql = "SELECT m.title,m.uuid,m.filesize,ds.host,ds.path from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
where s.status>4 and ds.id not in (select distinct dsid from datafile)
|
||||
group by m.title,m.uuid,ds.host,ds.path,m.filesize
|
||||
ORDER BY m.title DESC;";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth->execute();
|
||||
|
@ -617,18 +628,18 @@ class Admin_SysController extends Zend_Controller_Action
|
|||
$this->view->paginator=$paginator;
|
||||
} else if ($ac=='tiny')
|
||||
{
|
||||
$sql = "SELECT m.title,m.uuid,ds.host,ds.path,
|
||||
floor(sum(datafile.filesize)/1024/1024*100)/100 as filesize,
|
||||
count(datafile.id) as filecount
|
||||
from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
left join datasource on datasource.uuid=m.uuid
|
||||
left join datafile on ds.id=datafile.dsid
|
||||
left join source on datasource.sourceid=source.id
|
||||
where s.status>4 and ds.id in (select t.dsid from (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t
|
||||
where t.filesize<1024*5)
|
||||
group by m.title,m.uuid,ds.host,ds.path
|
||||
$sql = "SELECT m.title,m.uuid,ds.host,ds.path,
|
||||
floor(sum(datafile.filesize)/1024/1024*100)/100 as filesize,
|
||||
count(datafile.id) as filecount
|
||||
from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
LEFT JOIN dataset ds ON m.uuid=ds.uuid
|
||||
left join datasource on datasource.uuid=m.uuid
|
||||
left join datafile on ds.id=datafile.dsid
|
||||
left join source on datasource.sourceid=source.id
|
||||
where s.status>4 and ds.id in (select t.dsid from (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t
|
||||
where t.filesize<1024*5)
|
||||
group by m.title,m.uuid,ds.host,ds.path
|
||||
ORDER BY m.title DESC;";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth->execute();
|
||||
|
@ -642,14 +653,14 @@ where t.filesize<1024*5)
|
|||
$this->view->paginator=$paginator;
|
||||
} else if ($ac=='heihefund')
|
||||
{
|
||||
$sql = "SELECT m.title,m.uuid,g.id as gid
|
||||
from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
left join datasource on datasource.uuid=m.uuid
|
||||
left join source on datasource.sourceid=source.id
|
||||
left join mdfund mf on mf.uuid=m.uuid
|
||||
left join geonetworkmetadata g on m.uuid=g.uuid
|
||||
where s.status>4 and source.code='heihe' and mf.fid is null
|
||||
$sql = "SELECT m.title,m.uuid,g.id as gid
|
||||
from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
left join datasource on datasource.uuid=m.uuid
|
||||
left join source on datasource.sourceid=source.id
|
||||
left join mdfund mf on mf.uuid=m.uuid
|
||||
left join geonetworkmetadata g on m.uuid=g.uuid
|
||||
where s.status>4 and source.code='heihe' and mf.fid is null
|
||||
ORDER BY m.title DESC;";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth->execute();
|
||||
|
@ -660,19 +671,19 @@ left join geonetworkmetadata g on m.uuid=g.uuid
|
|||
$paginator->setItemCountPerPage($pages);
|
||||
$paginator->setView($this->view);
|
||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
|
||||
$this->view->paginator=$paginator;
|
||||
$this->view->paginator=$paginator;
|
||||
$this->_helper->viewRenderer('problem-md');
|
||||
} else if ($ac=='noemail')
|
||||
{
|
||||
$sql = "SELECT distinct m.title,m.uuid,g.id as gid
|
||||
from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
left join role on role.uuid=m.uuid
|
||||
left join geonetworkmetadata g on m.uuid=g.uuid
|
||||
where m.datatype=1 and s.status>4 and m.uuid not in (
|
||||
select role.uuid from role left join responsible res on role.resid=res.id
|
||||
where res.email is not null and role.role in ('resourceProvider','owner','pointOfContact','custodian')
|
||||
)
|
||||
$sql = "SELECT distinct m.title,m.uuid,g.id as gid
|
||||
from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
left join role on role.uuid=m.uuid
|
||||
left join geonetworkmetadata g on m.uuid=g.uuid
|
||||
where m.datatype=1 and s.status>4 and m.uuid not in (
|
||||
select role.uuid from role left join responsible res on role.resid=res.id
|
||||
where res.email is not null and role.role in ('resourceProvider','owner','pointOfContact','custodian')
|
||||
)
|
||||
ORDER BY m.title DESC;";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth->execute();
|
||||
|
@ -683,16 +694,16 @@ where res.email is not null and role.role in ('resourceProvider','owner','pointO
|
|||
$paginator->setItemCountPerPage($pages);
|
||||
$paginator->setView($this->view);
|
||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
|
||||
$this->view->paginator=$paginator;
|
||||
$this->view->paginator=$paginator;
|
||||
$this->_helper->viewRenderer('problem-md');
|
||||
} else if ($ac=='unmoved')
|
||||
{
|
||||
$sql = "SELECT distinct m.title,m.uuid,g.id as gid
|
||||
from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
left join geonetworkmetadata g on m.uuid=g.uuid
|
||||
left join dataset ds on ds.uuid=m.uuid
|
||||
where s.status>4 and ds.path like '%upload%'
|
||||
$sql = "SELECT distinct m.title,m.uuid,g.id as gid
|
||||
from metadata m
|
||||
LEFT JOIN mdstatus s ON m.uuid=s.uuid
|
||||
left join geonetworkmetadata g on m.uuid=g.uuid
|
||||
left join dataset ds on ds.uuid=m.uuid
|
||||
where s.status>4 and ds.path like '%upload%'
|
||||
ORDER BY m.title DESC;";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth->execute();
|
||||
|
@ -703,7 +714,7 @@ left join dataset ds on ds.uuid=m.uuid
|
|||
$paginator->setItemCountPerPage($pages);
|
||||
$paginator->setView($this->view);
|
||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
|
||||
$this->view->paginator=$paginator;
|
||||
$this->view->paginator=$paginator;
|
||||
$this->_helper->viewRenderer('problem-md');
|
||||
}
|
||||
$this->view->activeID="btn-".$ac;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
<?php
|
||||
use Helpers\View as view;
|
||||
use \Users\Local;
|
||||
use Helpers\dbh;
|
||||
|
||||
use Helpers\PDO;
|
||||
class Admin_UserController extends Zend_Controller_Action
|
||||
{
|
||||
function preDispatch()
|
||||
|
@ -157,12 +155,46 @@ class Admin_UserController extends Zend_Controller_Action
|
|||
$select->from('users')
|
||||
->where('usertype = ?', 'administrator')
|
||||
->order('users.id desc');
|
||||
|
||||
|
||||
$paginator = Zend_Paginator::factory($select);
|
||||
$paginator->setCurrentPageNumber($this->_getParam('page'));
|
||||
$paginator->setItemCountPerPage(30);
|
||||
$paginator->setView($this->view);
|
||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
|
||||
$this->view->paginator=$paginator;
|
||||
|
||||
$ac = $this->_getParam('ac');
|
||||
|
||||
if($ac == 'sync')
|
||||
{
|
||||
$sql = "SELECT id FROM users WHERE usertype='administrator'";
|
||||
$rs = $this->db->query($sql);
|
||||
$ids = $rs->fetchAll();
|
||||
|
||||
$data = array();
|
||||
foreach($ids as $v)
|
||||
{
|
||||
$data[] = $v['id'];
|
||||
}
|
||||
unset($ids);
|
||||
|
||||
$ids = join(",",$data);
|
||||
|
||||
$gn_sql = "update users set profile='Administrator' where id in ($ids)";
|
||||
$gn_db = new PDO(array(
|
||||
'host'=> $this->view->config->geonetwork->params->host,
|
||||
'port' => 5432,
|
||||
'user' => $this->view->config->geonetwork->params->username,
|
||||
'pwd' => $this->view->config->geonetwork->params->password ,
|
||||
'db' => $this->view->config->geonetwork->params->dbname
|
||||
));
|
||||
|
||||
$gn_db->exec("update users set profile='Editor' where id>1 and profile='Administrator'");
|
||||
$gn_db->exec($gn_sql);
|
||||
|
||||
view::Post($this,"同步成功!",-1);
|
||||
}
|
||||
}
|
||||
|
||||
function showAction()
|
||||
|
|
|
@ -19,5 +19,9 @@
|
|||
<li><a href="/admin/data/source">专题管理</a></li>
|
||||
<li><a href="/admin/data/project">汇交计划</a></li>
|
||||
<li><a href="/admin/data/fund">支持项目</a></li>
|
||||
<<<<<<< .working
|
||||
<li><a href="/admin/data/doi">DOI</a></li>
|
||||
=======
|
||||
<li><a href="/admin/data/visual">可视化数据</a></li>
|
||||
>>>>>>> .merge-right.r4534
|
||||
</ul>
|
|
@ -66,7 +66,8 @@
|
|||
<?php endif;?>
|
||||
<a href="/admin/down/sendmail/uuid/<?php echo $item['uuid'];?>" title="向数据下载者发送通知邮件">邮件通知</a> |
|
||||
<a href="/admin/data/fund/uuid/<?php echo $item['uuid'];?>">支持项目</a> |
|
||||
<a href="/admin/data/doi/uuid/<?php echo $item['uuid'];?>">DOI</a>
|
||||
<a href="/admin/data/doi/uuid/<?php echo $item['uuid'];?>">DOI</a> |
|
||||
<a href="/admin/data/visual/uuid/<?php echo $item['uuid'];?>">数据可视化</a>
|
||||
</p>
|
||||
<?php if($item['author']) :?>
|
||||
<p>数据贡献者:<?= $item['author']; ?></p>
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
$this->headTitle($this->config->title->site);
|
||||
$this->headTitle('后台管理');
|
||||
$this->headTitle()->setSeparator(' - ');
|
||||
$this->breadcrumb('<a href="/">首页</a>');
|
||||
$this->breadcrumb('<a href="/admin">后台首页</a>');
|
||||
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
|
||||
$this->breadcrumb('同步GEONETWORK元数据</a>');
|
||||
$this->breadcrumb()->setSeparator(' > ');
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="span3">
|
||||
<?= $this->partial('data/left.phtml'); ?>
|
||||
</div>
|
||||
|
||||
<div class="span9">
|
||||
<h3>添加可视化要素</h3>
|
||||
<hr />
|
||||
<form class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputUUID">UUID</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="inputUUID" placeholder="UUID" value="<?= $this->data['uuid'] ?>" class="input-block-level">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputVariable">可视化要素</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="inputVariable" placeholder="Variable" class="input-block-level">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="last-control-group">
|
||||
<div class="controls">
|
||||
<button type="button" class="btn btn-defualt" id="addVariable">添加要素</button>
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('#addVariable').click(function(e) {
|
||||
html = '<div class="control-group">
|
||||
<label class="control-label" for="inputVariable">可视化要素</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="inputVariable" placeholder="Variable" class="input-block-level">
|
||||
</div>
|
||||
</div>';
|
||||
$('#last-control-group').prepend();
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
$this->headTitle($this->config->title->site);
|
||||
$this->headTitle('后台管理');
|
||||
$this->headTitle()->setSeparator(' - ');
|
||||
$this->headLink()->appendStylesheet('/css/admin.css');
|
||||
$this->breadcrumb('<a href="/">首页</a>');
|
||||
$this->breadcrumb('<a href="/admin">后台首页</a>');
|
||||
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
|
||||
$this->breadcrumb('同步GEONETWORK元数据</a>');
|
||||
$this->breadcrumb()->setSeparator(' > ');
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="span3">
|
||||
<?= $this->partial('data/left.phtml'); ?>
|
||||
</div>
|
||||
|
||||
<div class="span9">
|
||||
|
||||
</div>
|
||||
</div>
|
|
@ -2,51 +2,46 @@
|
|||
$this->headTitle($this->config->title->site);
|
||||
$this->headTitle('后台管理');
|
||||
$this->headTitle()->setSeparator(' - ');
|
||||
# $this->headLink()->appendStylesheet('/css/admin.css');
|
||||
$this->headLink()->appendStylesheet('/css/admin.css');
|
||||
$this->breadcrumb('<a href="/">首页</a>');
|
||||
$this->breadcrumb('<a href="/admin/">后台首页</a>');
|
||||
$this->breadcrumb('<a href="/admin/user">用户管理</a>');
|
||||
$this->breadcrumb()->setSeparator(' > ');
|
||||
?>
|
||||
|
||||
<style>
|
||||
table thead tr th {background:#EBF2F6;color:#444;}
|
||||
.high{background:#444;color:#FFF;}
|
||||
</style>
|
||||
<div class="row-fluid">
|
||||
<div class="span3"><?= $this->partial('user/left.phtml'); ?></div>
|
||||
|
||||
<div class="span9">
|
||||
<h3>管理员列表</h3>
|
||||
<hr />
|
||||
<table class="table table-bordered table-hover table-condensed"><thead>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>用户名</th>
|
||||
<th>电子邮箱</th>
|
||||
<th>用户类型</th>
|
||||
<th>真实姓名</th>
|
||||
<th>电话</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php if (count($this->paginator)): ?>
|
||||
<?php $autoindex=0;?>
|
||||
<?php foreach ($this->paginator as $item): ?>
|
||||
<?php $autoindex++;?>
|
||||
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
|
||||
<td><?= $item['username']?></td>
|
||||
<td><?= $item['email']; ?></td>
|
||||
<td><?= $item['usertype']; ?></td>
|
||||
<td><?= $item['realname']; ?></td>
|
||||
<td><?= $item['phone']; ?></td>
|
||||
<td>
|
||||
<a href='/admin/user/show/id/<?= $item['id'];?>'>查看详细</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<div class="pagenavi"><?= $this->paginator; ?></div>
|
||||
</div>
|
||||
<div id="leftPanel">
|
||||
<?= $this->partial('user/left.phtml'); ?>
|
||||
</div>
|
||||
|
||||
<div id="rightPanel">
|
||||
<div class="title">管理员列表</div>
|
||||
<div class=""><a href="/admin/user/adminlist/ac/sync">同步管理员到geonetwork</a></div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td width='150'>用户名</td>
|
||||
<td width='250'>电子邮箱</td>
|
||||
<td width='100'>用户类型</td>
|
||||
<td width='150'>真实姓名</td>
|
||||
<td width='150'>电话</td>
|
||||
<td width='150'>操作</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php if (count($this->paginator)): ?>
|
||||
<?php $autoindex=0;?>
|
||||
<?php foreach ($this->paginator as $item): ?>
|
||||
<?php $autoindex++;?>
|
||||
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
|
||||
<td><?= $item['username']?></td>
|
||||
<td><?= $item['email']; ?></td>
|
||||
<td><?= $item['usertype']; ?></td>
|
||||
<td><?= $item['realname']; ?></td>
|
||||
<td><?= $item['phone']; ?></td>
|
||||
<td>
|
||||
<a href='/admin/user/show/id/<?= $item['id'];?>'>查看详细</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<div class="pagenavi"><?= $this->paginator; ?></div>
|
||||
</div>
|
|
@ -1,161 +1,158 @@
|
|||
[general]
|
||||
db.adapter = PDO_PGSQL
|
||||
db.params.host = localhost
|
||||
db.params.username = gis
|
||||
db.params.password = gispassword
|
||||
db.params.dbname = sanjiangyuan
|
||||
|
||||
geonetwork.url=http://sanjiangyuan.westgis.ac.cn/geonetwork/
|
||||
geonetwork.adapter = PDO_PGSQL
|
||||
geonetwork.params.host = localhost
|
||||
geonetwork.params.username = gis
|
||||
geonetwork.params.password = gispassword
|
||||
geonetwork.params.dbname = geonetwork
|
||||
|
||||
google.maps.api=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg
|
||||
bing.api=4BC90E1E9ED351ECE0D9FB71509BC3CC1264340C
|
||||
bigthumb.path=../geonetwork/data/
|
||||
temp.path=/tmp/
|
||||
upload=../data/upload/
|
||||
|
||||
paths.newsletter=images/newsletter/
|
||||
logging.file = /var/www/test.westgis.ac.cn/data/logs/debug.log
|
||||
page.limit=10
|
||||
import.dir=../data/import
|
||||
title.site=三江源自然保护区数据管理中心
|
||||
title.data=数据产品与服务
|
||||
title.heihe=黑河计划数据管理中心
|
||||
title.yrnmr=黄河上游宁蒙河段综合数据平台
|
||||
title.glacier=中国冰川资源及其变化调查
|
||||
title.review=数据评审
|
||||
title.author=数据作者
|
||||
title.knowledge=知识积累
|
||||
supportemail=westdc@lzb.ac.cn
|
||||
reportemail=westdc-report-subscribe@lists.westgis.ac.cn
|
||||
|
||||
smtp.username=westdc@lzb.ac.cn
|
||||
smtp.password=ilovewestdc
|
||||
smtp.host=smtp.cstnet.cn
|
||||
smtp.ssl=TLS
|
||||
smtp.auth=login
|
||||
smtp.name=数据中心服务组
|
||||
|
||||
ftp.user=newwestdc
|
||||
ftp.password=westdcforsmall
|
||||
download.max=5 //最多同时申请下载个数
|
||||
page.max=10 //每页显示条目数
|
||||
offline.template=../data/offline.pdf
|
||||
offline.heihetemplate=../data/heihe.pdf
|
||||
offline.security=../data/security.pdf
|
||||
offline.water_template=../data/water_offline.pdf
|
||||
offline.font=../data/simhei.ttf
|
||||
offline.savepath=../data/offlineapp
|
||||
service.email=westdc@lzb.ac.cn
|
||||
offline.email.template=../data/offline-email.txt
|
||||
offline.email.start_template=../data/offline-start-email.txt
|
||||
offline.email.finish_template=../data/offline-finish-email.txt
|
||||
offline.email.deny_template=../data/offline-deny-email.txt
|
||||
register.email.template=../data/register-email.txt
|
||||
westdc.xsl=../data/ISO19115.xsl
|
||||
|
||||
routes.accout.route = "account/fetchpwd/:login/:key"
|
||||
routes.accout.defaults.controller = "account"
|
||||
routes.accout.defaults.action = "fetchpwd"
|
||||
|
||||
routes.tag.route = "data/tag/:key"
|
||||
routes.tag.defaults.controller = "data"
|
||||
routes.tag.defaults.action = "tag"
|
||||
|
||||
routes.netkites1.type = "Zend_Controller_Router_Route_Static"
|
||||
routes.netkites1.route = "knowledge/netkites"
|
||||
routes.netkites1.defaults.controller = netkites
|
||||
routes.netkites1.defaults.action = index
|
||||
|
||||
routes.netkites.route = "knowledge/netkites/:action/*"
|
||||
routes.netkites.defaults.controller = netkites
|
||||
|
||||
routes.dataid.route = "data/:id"
|
||||
routes.dataid.defaults.controller = "data"
|
||||
routes.dataid.defaults.action = "view"
|
||||
routes.dataid.reqs.id = "\d+"
|
||||
|
||||
routes.dataxmluuid.route = "data/xml/:uuid"
|
||||
routes.dataxmluuid.defaults.controller = "data"
|
||||
routes.dataxmluuid.defaults.action = "xml"
|
||||
routes.dataxmluuid.reqs.uuid = "[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}"
|
||||
|
||||
routes.datauuid.route = "data/:uuid"
|
||||
routes.datauuid.defaults.controller = "data"
|
||||
routes.datauuid.defaults.action = "view"
|
||||
routes.datauuid.reqs.uuid = "[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}"
|
||||
|
||||
routes.datacat.route = "data/category/:code"
|
||||
routes.datacat.defaults.controller = "data"
|
||||
routes.datacat.defaults.action = "category"
|
||||
routes.datacat.reqs.code = "\d+"
|
||||
|
||||
routes.dataseriesplace.route = "data/series/:id/:keyword"
|
||||
routes.dataseriesplace.defaults.controller = "data"
|
||||
routes.dataseriesplace.defaults.action = "series"
|
||||
//routes.dataseries.reqs.code = "\d+"
|
||||
|
||||
routes.dataseries.route = "data/series/:id"
|
||||
routes.dataseries.defaults.controller = "data"
|
||||
routes.dataseries.defaults.action = "series"
|
||||
|
||||
routes.wateruuid.route = "water/:uuid"
|
||||
routes.wateruuid.defaults.controller = "water"
|
||||
routes.wateruuid.defaults.action = "view"
|
||||
routes.wateruuid.reqs.uuid = "[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}"
|
||||
|
||||
routes.watertag.route = "water/tag/:key"
|
||||
routes.watertag.defaults.controller = "water"
|
||||
routes.watertag.defaults.action = "tag"
|
||||
|
||||
routes.mddoc.route = "data/wiki/:title"
|
||||
routes.mddoc.defaults.controller = "metainfo"
|
||||
routes.mddoc.defaults.action = "index"
|
||||
|
||||
routes.mdfile.route = "filelist/uuid/:uuid"
|
||||
routes.mdfile.defaults.controller = "filelist"
|
||||
routes.mdfile.defaults.action = "index"
|
||||
|
||||
routes.adminofflineapp.route = admin/down/offlineapp/:page
|
||||
routes.adminofflineapp.defaults.module = admin
|
||||
routes.adminofflineapp.defaults.controller = down
|
||||
routes.adminofflineapp.defaults.action = offlineapp
|
||||
routes.adminofflineapp.defaults.page = 1
|
||||
routes.adminofflineapp.reqs.page = \d+
|
||||
|
||||
routes.admindatasetcd.route = admin/data/datasetcd/:page
|
||||
routes.admindatasetcd.defaults.module = admin
|
||||
routes.admindatasetcd.defaults.controller = data
|
||||
routes.admindatasetcd.defaults.action = datasetcd
|
||||
routes.admindatasetcd.defaults.page = 1
|
||||
routes.admindatasetcd.reqs.page = \d+
|
||||
|
||||
routes.adminmd.route = admin/data/md/:page
|
||||
routes.adminmd.defaults.module = admin
|
||||
routes.adminmd.defaults.controller = data
|
||||
routes.adminmd.defaults.action = md
|
||||
routes.adminmd.defaults.page = 1
|
||||
routes.adminmd.reqs.page = \d+
|
||||
|
||||
routes.admincomment.route = admin/data/comment/:page
|
||||
routes.admincomment.defaults.module = admin
|
||||
routes.admincomment.defaults.controller = data
|
||||
routes.admincomment.defaults.action = comment
|
||||
routes.admincomment.defaults.page = 1
|
||||
routes.admincomment.reqs.page = \d+
|
||||
|
||||
routes.adminoffline.route = admin/data/offline/:page
|
||||
routes.adminoffline.defaults.module = admin
|
||||
routes.adminoffline.defaults.controller = data
|
||||
routes.adminoffline.defaults.action = offline
|
||||
routes.adminoffline.defaults.page = 1
|
||||
routes.adminoffline.reqs.page = \d+
|
||||
|
||||
routes.news.route = archives/:ptype/:type/:page
|
||||
routes.news.defaults.controller = archives
|
||||
routes.news.defaults.action = list
|
||||
routes.news.defaults.page = 1
|
||||
[general]
|
||||
db.adapter = PDO_PGSQL
|
||||
db.params.host = localhost
|
||||
db.params.username = gis
|
||||
db.params.password = gispassword
|
||||
db.params.dbname = metadata
|
||||
|
||||
geonetwork.url=http://www.sanjiangyuan.org.cn/geonetwork/
|
||||
geonetwork.adapter = PDO_PGSQL
|
||||
geonetwork.params.host = localhost
|
||||
geonetwork.params.username = gis
|
||||
geonetwork.params.password = gispassword
|
||||
geonetwork.params.dbname = geonetwork
|
||||
|
||||
google.maps.api=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg
|
||||
bing.api=4BC90E1E9ED351ECE0D9FB71509BC3CC1264340C
|
||||
bigthumb.path=../geonetwork/data/
|
||||
temp.path=/tmp/
|
||||
upload=../data/upload/
|
||||
|
||||
paths.newsletter=images/newsletter/
|
||||
logging.file = /var/www/test.westgis.ac.cn/data/logs/debug.log
|
||||
page.limit=10
|
||||
import.dir=../data/import
|
||||
title.site=三江源生态监测综合数据服务平台
|
||||
title.data=数据产品与服务
|
||||
title.review=数据评审
|
||||
title.author=数据作者
|
||||
title.knowledge=知识积累
|
||||
supportemail=sjy@mygis.org
|
||||
reportemail=westdc-report-subscribe@lists.westgis.ac.cn
|
||||
|
||||
smtp.username=sjy@mygis.org
|
||||
smtp.password=qherc@123
|
||||
smtp.host=smtp.gmail.com
|
||||
smtp.ssl=SSL
|
||||
smtp.auth=login
|
||||
smtp.name=三江源生态监测综合数据服务平台
|
||||
|
||||
ftp.user=newwestdc
|
||||
ftp.password=westdcforsmall
|
||||
download.max=5 //最多同时申请下载个数
|
||||
page.max=10 //每页显示条目数
|
||||
offline.template=../data/offline.pdf
|
||||
offline.heihetemplate=../data/heihe.pdf
|
||||
offline.security=../data/security.pdf
|
||||
offline.water_template=../data/water_offline.pdf
|
||||
offline.font=../data/simhei.ttf
|
||||
offline.savepath=../data/offlineapp
|
||||
service.email=sjy@mygis.org
|
||||
offline.email.template=../data/offline-email.txt
|
||||
offline.email.start_template=../data/offline-start-email.txt
|
||||
offline.email.finish_template=../data/offline-finish-email.txt
|
||||
offline.email.deny_template=../data/offline-deny-email.txt
|
||||
register.email.template=../data/register-email.txt
|
||||
westdc.xsl=../data/ISO19115.xsl
|
||||
|
||||
routes.accout.route = "account/fetchpwd/:login/:key"
|
||||
routes.accout.defaults.controller = "account"
|
||||
routes.accout.defaults.action = "fetchpwd"
|
||||
|
||||
routes.tag.route = "data/tag/:key"
|
||||
routes.tag.defaults.controller = "data"
|
||||
routes.tag.defaults.action = "tag"
|
||||
|
||||
routes.netkites1.type = "Zend_Controller_Router_Route_Static"
|
||||
routes.netkites1.route = "knowledge/netkites"
|
||||
routes.netkites1.defaults.controller = netkites
|
||||
routes.netkites1.defaults.action = index
|
||||
|
||||
routes.netkites.route = "knowledge/netkites/:action/*"
|
||||
routes.netkites.defaults.controller = netkites
|
||||
|
||||
routes.dataid.route = "data/:id"
|
||||
routes.dataid.defaults.controller = "data"
|
||||
routes.dataid.defaults.action = "view"
|
||||
routes.dataid.reqs.id = "\d+"
|
||||
|
||||
routes.dataxmluuid.route = "data/xml/:uuid"
|
||||
routes.dataxmluuid.defaults.controller = "data"
|
||||
routes.dataxmluuid.defaults.action = "xml"
|
||||
routes.dataxmluuid.reqs.uuid = "[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}"
|
||||
|
||||
routes.datauuid.route = "data/:uuid"
|
||||
routes.datauuid.defaults.controller = "data"
|
||||
routes.datauuid.defaults.action = "view"
|
||||
routes.datauuid.reqs.uuid = "[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}"
|
||||
|
||||
routes.datacat.route = "data/category/:code"
|
||||
routes.datacat.defaults.controller = "data"
|
||||
routes.datacat.defaults.action = "category"
|
||||
routes.datacat.reqs.code = "\d+"
|
||||
|
||||
routes.dataseriesplace.route = "data/series/:id/:keyword"
|
||||
routes.dataseriesplace.defaults.controller = "data"
|
||||
routes.dataseriesplace.defaults.action = "series"
|
||||
//routes.dataseries.reqs.code = "\d+"
|
||||
|
||||
routes.dataseries.route = "data/series/:id"
|
||||
routes.dataseries.defaults.controller = "data"
|
||||
routes.dataseries.defaults.action = "series"
|
||||
|
||||
routes.wateruuid.route = "water/:uuid"
|
||||
routes.wateruuid.defaults.controller = "water"
|
||||
routes.wateruuid.defaults.action = "view"
|
||||
routes.wateruuid.reqs.uuid = "[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}"
|
||||
|
||||
routes.watertag.route = "water/tag/:key"
|
||||
routes.watertag.defaults.controller = "water"
|
||||
routes.watertag.defaults.action = "tag"
|
||||
|
||||
routes.mddoc.route = "data/wiki/:title"
|
||||
routes.mddoc.defaults.controller = "metainfo"
|
||||
routes.mddoc.defaults.action = "index"
|
||||
|
||||
routes.mdfile.route = "filelist/uuid/:uuid"
|
||||
routes.mdfile.defaults.controller = "filelist"
|
||||
routes.mdfile.defaults.action = "index"
|
||||
|
||||
routes.adminofflineapp.route = admin/down/offlineapp/:page
|
||||
routes.adminofflineapp.defaults.module = admin
|
||||
routes.adminofflineapp.defaults.controller = down
|
||||
routes.adminofflineapp.defaults.action = offlineapp
|
||||
routes.adminofflineapp.defaults.page = 1
|
||||
routes.adminofflineapp.reqs.page = \d+
|
||||
|
||||
routes.admindatasetcd.route = admin/data/datasetcd/:page
|
||||
routes.admindatasetcd.defaults.module = admin
|
||||
routes.admindatasetcd.defaults.controller = data
|
||||
routes.admindatasetcd.defaults.action = datasetcd
|
||||
routes.admindatasetcd.defaults.page = 1
|
||||
routes.admindatasetcd.reqs.page = \d+
|
||||
|
||||
routes.adminmd.route = admin/data/md/:page
|
||||
routes.adminmd.defaults.module = admin
|
||||
routes.adminmd.defaults.controller = data
|
||||
routes.adminmd.defaults.action = md
|
||||
routes.adminmd.defaults.page = 1
|
||||
routes.adminmd.reqs.page = \d+
|
||||
|
||||
routes.admincomment.route = admin/data/comment/:page
|
||||
routes.admincomment.defaults.module = admin
|
||||
routes.admincomment.defaults.controller = data
|
||||
routes.admincomment.defaults.action = comment
|
||||
routes.admincomment.defaults.page = 1
|
||||
routes.admincomment.reqs.page = \d+
|
||||
|
||||
routes.adminoffline.route = admin/data/offline/:page
|
||||
routes.adminoffline.defaults.module = admin
|
||||
routes.adminoffline.defaults.controller = data
|
||||
routes.adminoffline.defaults.action = offline
|
||||
routes.adminoffline.defaults.page = 1
|
||||
routes.adminoffline.reqs.page = \d+
|
||||
|
||||
routes.news.route = archives/:ptype/:type/:page
|
||||
routes.news.defaults.controller = archives
|
||||
routes.news.defaults.action = list
|
||||
routes.news.defaults.page = 1
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
use Westdc\Visual\Factory;
|
||||
|
||||
class VisualController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
function preDispatch()
|
||||
{
|
||||
$this->view->config = Zend_Registry::get('config');
|
||||
$this->db=Zend_Registry::get('db');
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if($auth->hasIdentity())
|
||||
{
|
||||
$user = $auth->getIdentity();
|
||||
$this->uid = $user->id;
|
||||
}else{
|
||||
$this->_redirect('/account/login?href=/visual');
|
||||
}
|
||||
}
|
||||
|
||||
function indexAction()
|
||||
{
|
||||
$record_type = $this->_getParam("dataset");
|
||||
|
||||
if(empty($record_type))
|
||||
return true;
|
||||
|
||||
$sc = Factory::Bootstrap($record_type);
|
||||
}
|
||||
|
||||
|
||||
//********************************************************
|
||||
|
||||
/*
|
||||
* dataAction() ajax获取数据
|
||||
*
|
||||
* param string $ac //请求的数据类型
|
||||
* param string $dt //请求的数据来源(气象,水文)
|
||||
*
|
||||
* return view
|
||||
*/
|
||||
function dataAction()
|
||||
{
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
$this->_helper->layout->disableLayout();
|
||||
|
||||
$record_type = $this->_getParam("dataset");
|
||||
$record_subset = $this->_getParam("subdataset");
|
||||
|
||||
if(empty($record_type))
|
||||
return true;
|
||||
|
||||
$record = Factory::Bootstrap($record_type);
|
||||
|
||||
if(!empty($record_subset))
|
||||
{
|
||||
$record->subset = $record_subset;
|
||||
}
|
||||
$data = $record->outPut();
|
||||
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
|
||||
}//dataAction() Ajax获取数据
|
||||
|
||||
|
||||
/*
|
||||
* jsonexit() 退出并返回json数据
|
||||
*
|
||||
* param array $data 要返回的JSON数据,可以是任意数组
|
||||
*
|
||||
* return application/JSON
|
||||
*/
|
||||
public function jsonexit($data){
|
||||
$this->getResponse()->setHeader('Content-Type', 'application/json')->appendBody(json_encode($data,JSON_NUMERIC_CHECK));
|
||||
return true;
|
||||
}//jsonexit() 退出并返回json数据
|
||||
|
||||
}
|
|
@ -8,81 +8,81 @@ $this->headTitle()->setSeparator(' - ');
|
|||
.fieldlist ul li:hover{color:#FFF;background:#0088CC;border-radius: 6px 6px 6px 6px;}
|
||||
.fieldlist ul li:hover a{color:#FFF; text-decoration:none;}
|
||||
.news_list ul li{line-height:24px;}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<h4><i class="icon-flag"></i>特色导航</h4>
|
||||
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<h4><i class="icon-flag"></i>特色导航</h4>
|
||||
|
||||
<form method="get" action="/search" id="search" class="form-search">
|
||||
<div class="input-append">
|
||||
<input type="text" value="" id="q" name="q" class="span2 search-query" placeholder="全文搜索">
|
||||
<button type="submit" class="btn"><i class="icon-search"></i>搜索</button>
|
||||
</div>
|
||||
<a class="btn" href="/search/advance"><i class="icon-search"></i>高级搜索</a>
|
||||
<a class="btn" href="/search/advance"><i class="icon-search"></i>高级搜索</a>
|
||||
<a class="btn" href="/data/browse"><i class="icon-reorder"></i>数据列表浏览</a>
|
||||
<a class="btn" href="/data/onlinelist"><i class="icon-th"></i>在线数据清单</a>
|
||||
<a class="btn" href="/data/offlinelist"><i class="icon-th"></i>离线数据清单</a>
|
||||
|
||||
<a class="btn" href="/data/offlinelist"><i class="icon-th"></i>离线数据清单</a>
|
||||
|
||||
</form>
|
||||
<ul class="unstyled inline">
|
||||
<ul class="unstyled inline">
|
||||
<li><a class="btn" href="/data/thumb"><i class="icon-picture"></i>缩略图浏览</a></li>
|
||||
<li><a class="btn" href="/data/timeline"><i class="icon-calendar"></i>时间轴浏览</a></li>
|
||||
<li><a class="btn" href="/data/map"><i class="icon-globe"></i>空间浏览</a></li>
|
||||
<li><a class="btn" href="/data/timemap"><i class="icon-film"></i>时空浏览</a></li>
|
||||
<li><a class="btn" href="/data/organization"><i class="icon-filter"></i>单位浏览</a></li>
|
||||
<li><a class="btn" href="/data/fund"><i class="icon-money"></i>项目浏览</a></li>
|
||||
<li><a class="btn" href="/data/author"><i class="icon-user-md"></i>作者浏览</a></li>
|
||||
<li><a class="btn" href="/knowledge"><i class="icon-exchange"></i>文献浏览</a></li>
|
||||
<li><a class="btn" href="/data/doi"><i class="icon-paper-clip"></i>DOI浏览</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<li><a class="btn" href="/data/organization"><i class="icon-filter"></i>单位浏览</a></li>
|
||||
<li><a class="btn" href="/data/fund"><i class="icon-money"></i>项目浏览</a></li>
|
||||
<li><a class="btn" href="/data/author"><i class="icon-user-md"></i>作者浏览</a></li>
|
||||
<li><a class="btn" href="/knowledge"><i class="icon-exchange"></i>文献浏览</a></li>
|
||||
<li><a class="btn" href="/data/doi"><i class="icon-paper-clip"></i>DOI浏览</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
$keytypezh=array('place'=>'地点关键词','theme'=>'主题关键词','discipline'=>'学科关键词','stratum'=>'地层关键词','temporal'=>'时间关键词');
|
||||
$keytypezh=array('place'=>'地点关键词','theme'=>'主题关键词','discipline'=>'学科关键词','stratum'=>'地层关键词','temporal'=>'时间关键词');
|
||||
$type='theme';
|
||||
?>
|
||||
<div class="span6">
|
||||
<h4><a href="/data/tag/keytype/theme"><i class="icon-tags"></i><?php echo $keytypezh[$type]; ?></a></h4>
|
||||
?>
|
||||
<div class="span6">
|
||||
<h4><a href="/data/tag/keytype/theme"><i class="icon-tags"></i><?php echo $keytypezh[$type]; ?></a></h4>
|
||||
<ul class="unstyled inline">
|
||||
<?php foreach($this->keywords[$type] as $cg) : ?>
|
||||
<li><a href='/data/tag/<?php echo $cg['keyword']; ?>'><i class="icon-tag"></i><?php echo $cg['keyword']; ?></a><span class="note">(<?php echo $cg['count']; ?>)</span></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$type='discipline';
|
||||
?>
|
||||
<div class="span6">
|
||||
<h4><a href="/data/tag/keytype/discipline"><i class="icon-tags"></i><?php echo $keytypezh[$type]; ?></a></h4>
|
||||
<div class="span6">
|
||||
<h4><a href="/data/tag/keytype/discipline"><i class="icon-tags"></i><?php echo $keytypezh[$type]; ?></a></h4>
|
||||
<ul class="unstyled inline">
|
||||
<?php foreach($this->keywords[$type] as $cg) : ?>
|
||||
<li><a href='/data/tag/<?php echo $cg['keyword']; ?>'><i class="icon-tag"></i><?php echo $cg['keyword']; ?></a><span class="note">(<?php echo $cg['count']; ?>)</span></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<?php
|
||||
$type='place';
|
||||
?>
|
||||
<div class="span6">
|
||||
<h4><a href="/data/tag/keytype/place"><i class="icon-tags"></i><?php echo $keytypezh[$type]; ?></a></h4>
|
||||
?>
|
||||
<div class="span6">
|
||||
<h4><a href="/data/tag/keytype/place"><i class="icon-tags"></i><?php echo $keytypezh[$type]; ?></a></h4>
|
||||
<ul class="unstyled inline">
|
||||
<?php foreach($this->keywords[$type] as $cg) : ?>
|
||||
<li><a href='/data/tag/<?php echo $cg['keyword']; ?>'><i class="icon-tag"></i><?php echo $cg['keyword']; ?></a><span class="note">(<?php echo $cg['count']; ?>)</span></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$type='temporal';
|
||||
?>
|
||||
<div class="span6">
|
||||
<h4><a href="/data/tag/keytype/temporal"><i class="icon-tags"></i><?php echo $keytypezh[$type]; ?></a></h4>
|
||||
<div class="span6">
|
||||
<h4><a href="/data/tag/keytype/temporal"><i class="icon-tags"></i><?php echo $keytypezh[$type]; ?></a></h4>
|
||||
<ul class="unstyled inline">
|
||||
<?php foreach($this->keywords[$type] as $cg) : ?>
|
||||
<li><a href='/data/tag/<?php echo $cg['keyword']; ?>'><i class="icon-tag"></i><?php echo $cg['keyword']; ?></a><span class="note">(<?php echo $cg['count']; ?>)</span></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="span6">
|
||||
|
@ -94,7 +94,7 @@ $this->headTitle()->setSeparator(' - ');
|
|||
<li><a href='/data/category/code/<?php echo $cg['code']; ?>'><i class="icon-th-large"></i><?php (empty($cg['name_zh']))?print($cg['name']):print($cg['name_zh']); ?></a><span class="note">(<?php echo $cg['count']; ?>)</span></li>
|
||||
<?php endforeach; ?>
|
||||
</ul></fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<h4><img src="/images/Project24x24_24-bit.png" align="absmiddle" /> 数据服务</h4>
|
||||
<div class="items">
|
||||
<div class="item">
|
||||
|
@ -102,6 +102,7 @@ $this->headTitle()->setSeparator(' - ');
|
|||
<li>- <a href="/data/offlineapp">离线数据服务记录(最近20个)</a></li>
|
||||
<li>- <a href="/data/request">如何从数据中心申请数据</a></li>
|
||||
<li>- <a href="/data/submit">如何在数据中心发布数据</a></li>
|
||||
<li>- <a href="/visual">数据可视化</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
<div class="row">
|
||||
<div class="span4 data-unit">
|
||||
<div class="well well-small">
|
||||
<h4><a href="http://qhims.cn/">青海省气象科学研究所</a></h4>
|
||||
<h4><a href="/data/organization/name/青海省气候中心、青海省气象科学研究所">青海省气象科学研究所</a></h4>
|
||||
<div class="data-block" style=" background-position:0px -200px;">
|
||||
|
||||
</div>
|
||||
|
@ -91,7 +91,7 @@
|
|||
</div>
|
||||
<div class="span4 data-unit">
|
||||
<div class="well well-small">
|
||||
<h4><a href="http://www.qhemc.com/">青海省环境监测中心站</a></h4>
|
||||
<h4><a href="/data/organization/name/青海省环境监测中心站">青海省环境监测中心站</a></h4>
|
||||
<div class="data-block" style=" background-position:top left;">
|
||||
|
||||
</div>
|
||||
|
@ -99,7 +99,7 @@
|
|||
</div>
|
||||
<div class="span4 data-unit">
|
||||
<div class="well well-small">
|
||||
<h4>青海省草原总站</h4>
|
||||
<h4><a href="/data/organization/name/青海省草原总站">青海省草原总站</a></h4>
|
||||
<div class="data-block" style=" background-position:0px -102px;">
|
||||
|
||||
</div>
|
||||
|
@ -110,7 +110,7 @@
|
|||
<div class="row">
|
||||
<div class="span4 data-unit">
|
||||
<div class="well well-small">
|
||||
<h4><a href="http://www.qhsb.gov.cn/">青海省水土保持局</a></h4>
|
||||
<h4><a href="/data/organization/name/青海省水土保持局">青海省水土保持局</a></h4>
|
||||
<div class="data-block" style="background-position:0px -400px;">
|
||||
|
||||
</div>
|
||||
|
@ -118,7 +118,7 @@
|
|||
</div>
|
||||
<div class="span4 data-unit">
|
||||
<div class="well well-small">
|
||||
<h4>青海省林业调查规划院</h4>
|
||||
<h4><a href="/data/organization/name/青海省林业调查规划院">青海省林业调查规划院</a></h4>
|
||||
<div class="data-block" style="background-position:0px -500px;">
|
||||
|
||||
</div>
|
||||
|
@ -126,7 +126,7 @@
|
|||
</div>
|
||||
<div class="span4 data-unit">
|
||||
<div class="well well-small">
|
||||
<h4>青海省水文水资源局</h4>
|
||||
<h4><a href="/data/organization/name/青海省水文水资源局">青海省水文水资源局</a></h4>
|
||||
<div class="data-block" style="background-position:0px -300px;">
|
||||
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,174 @@
|
|||
<?php
|
||||
$this->headTitle($this->config->title->site);
|
||||
$this->headTitle($this->config->title->author);
|
||||
$this->headTitle()->setSeparator(' - ');
|
||||
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
|
||||
$this->headLink()->appendStylesheet('/css/colorbox.css');
|
||||
$this->headScript()->appendFile('/static/js/highcharts/highcharts.js');
|
||||
$this->headScript()->appendFile('/static/js/highcharts/modules/exporting.js');
|
||||
$this->breadcrumb('<a href="/">首页</a>');
|
||||
$this->breadcrumb('<a href="visual">数据可视化</a>');
|
||||
$this->breadcrumb()->setSeparator(' > ');
|
||||
?>
|
||||
<!-- 左侧导航 -->
|
||||
<div id='sidebar' style="width:240px;float:left;overflow:hidden;">
|
||||
<div class="tbox">
|
||||
<div class="title">观测变量</div>
|
||||
<div class="content">
|
||||
<ul>
|
||||
<li><button value="1" class="fetchSeries btn">气温</button></li>
|
||||
<li><button value="2" class="fetchSeries btn">风速</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- //左侧导航 -->
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<div id="wapper" style="width:700px;overflow:hidden;float:right;">
|
||||
<div id="tableTitle"></div>
|
||||
<div id="datachart" style="width:100%;height:500px;"></div>
|
||||
|
||||
</div>
|
||||
<!-- //页面内容 -->
|
||||
<script>
|
||||
drawchart();
|
||||
|
||||
function drawchart() {
|
||||
|
||||
chart = new Highcharts.Chart({
|
||||
|
||||
chart: {
|
||||
|
||||
renderTo: 'datachart',
|
||||
|
||||
type: 'spline'
|
||||
|
||||
},
|
||||
|
||||
title: {
|
||||
|
||||
text: 'Snow depth in the Vikjafjellet mountain, Norway'
|
||||
|
||||
},
|
||||
|
||||
subtitle: {
|
||||
|
||||
text: 'An example of irregular time data in Highcharts JS'
|
||||
|
||||
},
|
||||
|
||||
|
||||
xAxis: {
|
||||
|
||||
type: 'datetime',
|
||||
|
||||
dateTimeLabelFormats: { // don't display the dummy year
|
||||
|
||||
month: '%e. %b',
|
||||
|
||||
year: '%y'
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
yAxis: {
|
||||
|
||||
title: {
|
||||
|
||||
text: '温度(摄氏度)'
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
tooltip: {
|
||||
|
||||
formatter: function() {
|
||||
|
||||
return '<b>'+ this.series.name +'</b><br/>'+
|
||||
|
||||
Highcharts.dateFormat('%e. %b', this.x) +': '+ this.y +' m';
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
series: [{
|
||||
|
||||
name: 'Winter 2007-2008',
|
||||
|
||||
data: [
|
||||
|
||||
<?php
|
||||
foreach ($this->data1 as $v)
|
||||
{
|
||||
echo "[".$v[0].",".$v[1]."],\r\n";
|
||||
}
|
||||
|
||||
?>]
|
||||
|
||||
|
||||
}, {
|
||||
|
||||
name: 'Winter 2008-2009',
|
||||
|
||||
data: [<?php
|
||||
foreach ($this->data2 as $v)
|
||||
{
|
||||
echo "[".$v[0].",".$v[1]."],\r\n";
|
||||
}
|
||||
|
||||
?>]
|
||||
|
||||
|
||||
}]
|
||||
});
|
||||
|
||||
/*
|
||||
// Create the chart
|
||||
window.chart = new Highcharts.Chart({
|
||||
'chart' : {
|
||||
'renderTo' : 'datachart'
|
||||
},
|
||||
|
||||
'exporting': {
|
||||
'enabled': false
|
||||
},
|
||||
|
||||
'title' : {
|
||||
'text' : title
|
||||
},
|
||||
|
||||
xAxis: {
|
||||
|
||||
type: 'datetime',
|
||||
|
||||
dateTimeLabelFormats: { // don't display the dummy year
|
||||
|
||||
month: '%e. %b',
|
||||
|
||||
year: '%b'
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
'yAxis': {
|
||||
labels: {
|
||||
formatter: function() {
|
||||
return (this.value > 0 ? '+' : '-') + this.value + '℃';
|
||||
}
|
||||
},
|
||||
min: -20,
|
||||
max:50
|
||||
},
|
||||
|
||||
'series' : data
|
||||
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
</script>
|
|
@ -0,0 +1,140 @@
|
|||
<?php
|
||||
$this->headTitle($this->config->title->site);
|
||||
$this->headTitle($this->config->title->data);
|
||||
$this->headTitle()->setSeparator(' - ');
|
||||
$theme = new Theme;
|
||||
$theme->appendPlus($this,'highstock');
|
||||
$this->breadcrumb('<a href="/">首页</a>');
|
||||
$this->breadcrumb('<a href="/data">数据与服务</a>');
|
||||
$this->breadcrumb('数据可视化');
|
||||
$this->breadcrumb()->setSeparator(' > ');
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<h3>选择数据集</h3>
|
||||
<hr />
|
||||
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#tab1" data-toggle="tab">青海三江源自然保护区水资源监测含沙量数据</a></li>
|
||||
<li><a href="#tab2" data-toggle="tab">青海三江源区珍秦草地生态综合站2011年土壤水分监测数据</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab1">
|
||||
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="sc" data-subdataset="avg" data-seriename="2012逐月含沙量平均值">
|
||||
2012年逐月平均值
|
||||
</a>
|
||||
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="sc" data-subdataset="max" data-seriename="2012逐月含沙量最大值">
|
||||
2012年逐月最大值
|
||||
</a>
|
||||
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="sc" data-subdataset="min" data-seriename="2012逐月含沙量最小值">
|
||||
2012年逐月最小值
|
||||
</a>
|
||||
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="sc2009" data-subdataset="avg" data-seriename="2009逐月含沙量平均值">
|
||||
2009年逐月平均值
|
||||
</a>
|
||||
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="sc2009" data-subdataset="max" data-seriename="2009逐月含沙量最大值">
|
||||
2009年逐月最大值
|
||||
</a>
|
||||
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="sc2009" data-subdataset="min" data-seriename="2009逐月含沙量最小值">
|
||||
2009年逐月最小值
|
||||
</a>
|
||||
</div>
|
||||
<div class="tab-pane" id="tab2">
|
||||
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="SoilMoisture" data-subdataset="20cm" data-seriename="珍秦草地生态综合站2011土壤水分20CM">
|
||||
20CM
|
||||
</a>
|
||||
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="SoilMoisture" data-subdataset="30cm" data-seriename="珍秦草地生态综合站2011土壤水分30CM">
|
||||
30CM
|
||||
</a>
|
||||
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="SoilMoisture" data-subdataset="40cm" data-seriename="珍秦草地生态综合站2011土壤水分40CM">
|
||||
40CM
|
||||
</a>
|
||||
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="SoilMoisture" data-subdataset="50cm" data-seriename="珍秦草地生态综合站2011土壤水分50CM">
|
||||
50CM
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- Tabbable -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<div class="span12">
|
||||
<div id="datachart" style="width:100%;height:500px;"></div>
|
||||
<a class="btn btn-primary control-btn-cls" href="javascript:void(0);">
|
||||
清除图像
|
||||
</a>
|
||||
</div>
|
||||
<!-- //页面内容 -->
|
||||
</div>
|
||||
<script>
|
||||
_this = {};
|
||||
$(function() {
|
||||
|
||||
$('#datachart').highcharts('StockChart', {
|
||||
|
||||
rangeSelector : {
|
||||
selected : 1,
|
||||
inputEnabled: $('#container').width() > 480
|
||||
},
|
||||
|
||||
credits : {
|
||||
enabled : false
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var chart = $('#datachart').highcharts();
|
||||
|
||||
$(".control-btn").click(function(){
|
||||
|
||||
dataset = $(this).data('dataset');
|
||||
subdataset = $(this).data('subdataset');
|
||||
seriename = $(this).data('seriename');
|
||||
|
||||
for(i in chart.series)
|
||||
{
|
||||
if(chart.series[i].name == seriename)
|
||||
{
|
||||
chart.series[i].remove();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
'url': '/visual/data',
|
||||
'data': 'dataset=' + dataset + '&subdataset=' + subdataset,
|
||||
'method': 'GET',
|
||||
'dataType': 'json',
|
||||
'success': function(data){
|
||||
chart.addSeries({
|
||||
name: seriename,
|
||||
data: data,
|
||||
type : 'column'
|
||||
});
|
||||
},
|
||||
'timeout': 30000,
|
||||
'global' : true
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".control-btn-cls").click(function(e) {
|
||||
for(i in chart.series)
|
||||
{
|
||||
chart.series[i].remove();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
$( document ).ajaxSend(function() {
|
||||
$('#loading').css('display','none');
|
||||
});
|
||||
$( document ).ajaxSend(function() {
|
||||
$('#loading').css('display','block');
|
||||
});
|
||||
$( document ).ajaxSend(function() {
|
||||
$('#loading').css('display','none');
|
||||
});
|
||||
</script>
|
|
@ -28,16 +28,20 @@
|
|||
</div>
|
||||
<?= $this->render('footer.phtml') ?>
|
||||
</body>
|
||||
<!-- Piwik -->
|
||||
<script type="text/javascript">
|
||||
var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.westgis.ac.cn/" : "http://piwik.westgis.ac.cn/");
|
||||
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
</script><script type="text/javascript">
|
||||
try {
|
||||
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 5);
|
||||
piwikTracker.trackPageView();
|
||||
piwikTracker.enableLinkTracking();
|
||||
} catch( err ) {}
|
||||
</script><noscript><p><img src="http://piwik.westgis.ac.cn/piwik.php?idsite=5" style="border:0" alt="" /></p></noscript>
|
||||
<!-- Piwik -->
|
||||
<script type="text/javascript">
|
||||
var _paq = _paq || [];
|
||||
_paq.push(["trackPageView"]);
|
||||
_paq.push(["enableLinkTracking"]);
|
||||
|
||||
(function() {
|
||||
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://piwik.westgis.ac.cn/";
|
||||
_paq.push(["setTrackerUrl", u+"piwik.php"]);
|
||||
_paq.push(["setSiteId", "11"]);
|
||||
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
|
||||
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<!-- End Piwik Code -->
|
||||
<script>setPage();</script>
|
||||
</html>
|
|
@ -175,6 +175,7 @@ class ISO19115
|
|||
//删除所有未用到的responsible数据
|
||||
$sql="delete from responsible where id not in (select distinct(resid) from role)";
|
||||
$db->query($sql);
|
||||
$this->view=new \stdClass;
|
||||
$this->view->config = Zend_Registry::get('config');
|
||||
|
||||
//if (!empty($this->doi)) $row->doi=$this->doi;
|
||||
|
@ -209,8 +210,14 @@ class ISO19115
|
|||
//处理在线资源
|
||||
if ($this->onlineresource) foreach($this->onlineresource as $resource)
|
||||
{
|
||||
$sql="insert into onlineresource (uuid,linkage,protocol,name,description) values(?,?,?,?,?)";
|
||||
$db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['name'],$resource['description']));
|
||||
if (isset($resource['name']) && $resource['name'])
|
||||
{
|
||||
$sql="insert into onlineresource (uuid,linkage,protocol,name,description) values(?,?,?,?,?)";
|
||||
$db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['name'],$resource['description']));
|
||||
} else {
|
||||
$sql="insert into onlineresource (uuid,linkage,protocol,description) values(?,?,?,?)";
|
||||
$db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['description']));
|
||||
}
|
||||
}
|
||||
//处理缩略图
|
||||
if (!empty($this->thumbnail)) {
|
||||
|
@ -225,7 +232,7 @@ class ISO19115
|
|||
if ($this->view->config)
|
||||
$geonetwork=$this->view->config->geonetwork->url;
|
||||
else
|
||||
$geonetwork='http://westdc.westgis.ac.cn/geonetwork/';
|
||||
$geonetwork='http://www.sanjiangyuan.org.cn/geonetwork/';
|
||||
$thumb=base64_encode(file_get_contents($geonetwork.'srv/cn/resources.get?access=public&id='.$r->gid.'&fname='.urlencode($this->graph['filename'])));
|
||||
$sql="insert into thumbnail (id,data,filetype,filedesc,filename) values(?,?,?,?,?)";
|
||||
$db->query($sql,array($id,$thumb,$this->graph['filetype'],$this->graph['filedesc'],$this->graph['filename']));
|
||||
|
@ -371,7 +378,7 @@ class ISO19115
|
|||
function parse()
|
||||
{
|
||||
$this->resTitle=$this->dom->getElementsByTagName('resTitle')->item(0)->nodeValue;
|
||||
$this->resAltTitle=$this->dom->getElementsByTagName('resAltTitle')->item(0)->nodeValue;
|
||||
@$this->resAltTitle=$this->dom->getElementsByTagName('resAltTitle')->item(0)->nodeValue;
|
||||
$this->idAbs=$this->dom->getElementsByTagName('idAbs')->item(0)->nodeValue;
|
||||
$this->mdFileID=$this->dom->getElementsByTagName('mdFileID')->item(0)->nodeValue;
|
||||
$this->mdDateSt=$this->dom->getElementsByTagName('mdDateSt')->item(0)->nodeValue;
|
||||
|
@ -381,7 +388,7 @@ class ISO19115
|
|||
//项目支持信息
|
||||
@$this->suppinfo=$this->dom->getElementsByTagName('suppInfo')->item(0)->nodeValue;
|
||||
//DOI,自定义项
|
||||
$cittype=$this->dom->getElementsByTagName('citIdType')->item(0)->nodeValue;
|
||||
@$cittype=$this->dom->getElementsByTagName('citIdType')->item(0)->nodeValue;
|
||||
if ($cittype=='DOI')
|
||||
$this->doi=$this->dom->getElementsByTagName('citId')->item(0)->nodeValue;
|
||||
//数据大小,以MB为单位
|
||||
|
@ -402,7 +409,7 @@ class ISO19115
|
|||
{
|
||||
$this->author[$k]['individual']=$author->getElementsByTagName('rpIndName')->item(0)->nodeValue;
|
||||
$this->author[$k]['organisation']=$author->getElementsByTagName('rpOrgName')->item(0)->nodeValue;
|
||||
$this->author[$k]['position']=$author->getElementsByTagName('rpPosName')->item(0)->nodeValue;
|
||||
@$this->author[$k]['position']=$author->getElementsByTagName('rpPosName')->item(0)->nodeValue;
|
||||
$this->author[$k]['delivery']=$author->getElementsByTagName('delPoint')->item(0)->nodeValue;
|
||||
$this->author[$k]['phone']=$author->getElementsByTagName('voiceNum')->item(0)->nodeValue;
|
||||
$this->author[$k]['email']=$author->getElementsByTagName('eMailAdd')->item(0)->nodeValue;
|
||||
|
@ -418,7 +425,7 @@ class ISO19115
|
|||
{
|
||||
$this->author[$cnt+$j]['individual']=$author->getElementsByTagName('rpIndName')->item(0)->nodeValue;
|
||||
$this->author[$cnt+$j]['organisation']=$author->getElementsByTagName('rpOrgName')->item(0)->nodeValue;
|
||||
$this->author[$cnt+$j]['position']=$author->getElementsByTagName('rpPosName')->item(0)->nodeValue;
|
||||
@$this->author[$cnt+$j]['position']=$author->getElementsByTagName('rpPosName')->item(0)->nodeValue;
|
||||
$this->author[$cnt+$j]['delivery']=$author->getElementsByTagName('delPoint')->item(0)->nodeValue;
|
||||
$this->author[$cnt+$j]['phone']=$author->getElementsByTagName('voiceNum')->item(0)->nodeValue;
|
||||
$this->author[$cnt+$j]['email']=$author->getElementsByTagName('eMailAdd')->item(0)->nodeValue;
|
||||
|
@ -434,7 +441,7 @@ class ISO19115
|
|||
{
|
||||
$this->author[$cnt+$m]['individual']=$author->getElementsByTagName('rpIndName')->item(0)->nodeValue;
|
||||
$this->author[$cnt+$m]['organisation']=$author->getElementsByTagName('rpOrgName')->item(0)->nodeValue;
|
||||
$this->author[$cnt+$m]['position']=$author->getElementsByTagName('rpPosName')->item(0)->nodeValue;
|
||||
@$this->author[$cnt+$m]['position']=$author->getElementsByTagName('rpPosName')->item(0)->nodeValue;
|
||||
$this->author[$cnt+$m]['delivery']=$author->getElementsByTagName('delPoint')->item(0)->nodeValue;
|
||||
$this->author[$cnt+$m]['phone']=$author->getElementsByTagName('voiceNum')->item(0)->nodeValue;
|
||||
$this->author[$cnt+$m]['email']=$author->getElementsByTagName('eMailAdd')->item(0)->nodeValue;
|
||||
|
@ -572,8 +579,8 @@ class ISO19115
|
|||
foreach($ds as $k=>$dataset)
|
||||
{
|
||||
$this->datasetSeries[$k]['seriesName']=$dataset->getElementsByTagName('seriesName')->item(0)->nodeValue;
|
||||
$this->datasetSeries[$k]['issId']=$dataset->getElementsByTagName('issId')->item(0)->nodeValue;
|
||||
$this->datasetSeries[$k]['artPage']=$dataset->getElementsByTagName('artPage')->item(0)->nodeValue;
|
||||
@$this->datasetSeries[$k]['issId']=$dataset->getElementsByTagName('issId')->item(0)->nodeValue;
|
||||
@$this->datasetSeries[$k]['artPage']=$dataset->getElementsByTagName('artPage')->item(0)->nodeValue;
|
||||
}
|
||||
//unsure which one.
|
||||
$ds=$this->dom->getElementsByTagName('Series');
|
||||
|
|
|
@ -66,7 +66,7 @@ class Search
|
|||
function __construct($text='')
|
||||
{
|
||||
require_once '/home/wlx/xunsearch/sdk/php/lib/XS.php';
|
||||
$this->xs=new XS('heihe');
|
||||
$this->xs=new XS('westdc');
|
||||
$this->search=$this->xs->search;
|
||||
$this->terms = array();
|
||||
$this->text=$text;
|
||||
|
|
|
@ -1,188 +1,194 @@
|
|||
<?php
|
||||
/**
|
||||
* Theme 主题
|
||||
*/
|
||||
|
||||
class Theme
|
||||
{
|
||||
private $render; //传入Zend Render对象
|
||||
public $plus; //插件
|
||||
public $ScriptKey = "js"; //js 文件键名
|
||||
public $CSSKey = "css"; //css 文件键名
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->_init_plus();
|
||||
}
|
||||
|
||||
//初始化插件
|
||||
function _init_plus()
|
||||
{
|
||||
$this->plus = array(
|
||||
|
||||
/**********Jquery公共库******/
|
||||
|
||||
//Jquery
|
||||
'jquery'=>array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jquery.lasted.js'
|
||||
)
|
||||
),
|
||||
|
||||
//Jquery UI
|
||||
'jquery_ui'=>array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jquery.lasted.js',
|
||||
'/js/lib/jquery.ui/jquery-ui.lasted.js'
|
||||
),
|
||||
$this->CSSKey =>array(
|
||||
'/js/lib/jquery.ui/jquery-ui.lasted.css'
|
||||
)
|
||||
),
|
||||
|
||||
/********* Bootstrap ******/
|
||||
'bootstrap'=>array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/bootstrap/js/bootstrap.min.js',
|
||||
),
|
||||
$this->CSSKey =>array(
|
||||
'/js/lib/bootstrap/css/bootstrap.min.css',
|
||||
'/js/lib/bootstrap/css/bootstrap-responsive.min.css'
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
/********Jquery 插件********/
|
||||
|
||||
//colorbox
|
||||
'colorbox' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jquery.colorbox/jquery.colorbox-min.js'
|
||||
),
|
||||
$this->CSSKey => array(
|
||||
'/js/lib/jquery.colorbox/style2/colorbox.css'
|
||||
)
|
||||
),
|
||||
|
||||
//inputbg
|
||||
'inputbg' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/custom/jquery.inputbg.js'
|
||||
)
|
||||
),
|
||||
|
||||
//loadinglayer
|
||||
'loadinglayer' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/custom/jquery.loadinglayer.js'
|
||||
)
|
||||
),
|
||||
|
||||
//admin_plugin
|
||||
'admin_plugin' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/custom/admin_plugin.js'
|
||||
)
|
||||
),
|
||||
|
||||
'jplayer' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jplayer/jquery.jplayer.min.js'
|
||||
)
|
||||
),
|
||||
|
||||
//slides
|
||||
'slides' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jquery.slides.min.js'
|
||||
)
|
||||
),
|
||||
|
||||
'datatable' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jquery.datatable/jquery.dataTables.min.js'
|
||||
),
|
||||
$this->CSSKey => array(
|
||||
'/js/lib/jquery.datatable/datatable.css'
|
||||
)
|
||||
),
|
||||
|
||||
'masonry' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jquery.masonry.min.js'
|
||||
),
|
||||
),
|
||||
|
||||
'uploadify' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/uploadify/jquery.uploadify.min.js'
|
||||
),
|
||||
$this->CSSKey => array(
|
||||
'/js/lib/uploadify/uploadify.css'
|
||||
),
|
||||
),
|
||||
|
||||
'datepicker' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/datepicker/jquery-ui-1.10.3.custom.min.js'
|
||||
),
|
||||
$this->CSSKey => array(
|
||||
'/js/lib/datepicker/jquery-ui-1.10.3.custom.min.css'
|
||||
)
|
||||
),
|
||||
|
||||
/*********谷歌地图*********/
|
||||
|
||||
//Google Map API v3
|
||||
'google_map_v3'=>array(
|
||||
$this->ScriptKey => array(
|
||||
'http://maps.google.com/maps/api/js?sensor=false&language=zh-cn'
|
||||
)
|
||||
),
|
||||
|
||||
//Google Map API v3 - KeyDragZone
|
||||
'google_map_keydragzone' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/google-map/keydragzoom.js'
|
||||
)
|
||||
),
|
||||
|
||||
);//插件列表
|
||||
|
||||
}// _init_plus()
|
||||
|
||||
//前台添加插件
|
||||
function AppendPlus($render,$plus_name){
|
||||
|
||||
$plus_name = strtolower($plus_name);
|
||||
|
||||
$plusing = $this->plus;
|
||||
|
||||
if(!empty($plusing[$plus_name][$this->ScriptKey]))
|
||||
{
|
||||
foreach($plusing[$plus_name][$this->ScriptKey] as $k=>$v)
|
||||
{
|
||||
$render->headScript()->appendFile($v);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($plusing[$plus_name][$this->CSSKey]))
|
||||
{
|
||||
foreach($plusing[$plus_name][$this->CSSKey] as $k=>$v)
|
||||
{
|
||||
$render->headLink()->appendStylesheet($v);
|
||||
}
|
||||
}
|
||||
|
||||
}// AppendPlus
|
||||
|
||||
//加载页面中的JS
|
||||
function AppendModel($render,$model)
|
||||
{
|
||||
|
||||
$model = trim($model);
|
||||
|
||||
$render->headScript()->appendFile("/js/lib/custom/models/".$model.".js");
|
||||
|
||||
}//
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* Theme 主题
|
||||
*/
|
||||
|
||||
class Theme
|
||||
{
|
||||
private $render; //传入Zend Render对象
|
||||
public $plus; //插件
|
||||
public $ScriptKey = "js"; //js 文件键名
|
||||
public $CSSKey = "css"; //css 文件键名
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->_init_plus();
|
||||
}
|
||||
|
||||
//初始化插件
|
||||
function _init_plus()
|
||||
{
|
||||
$this->plus = array(
|
||||
|
||||
/**********Jquery公共库******/
|
||||
|
||||
//Jquery
|
||||
'jquery'=>array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jquery.lasted.js'
|
||||
)
|
||||
),
|
||||
|
||||
//Jquery UI
|
||||
'jquery_ui'=>array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jquery.lasted.js',
|
||||
'/js/lib/jquery.ui/jquery-ui.lasted.js'
|
||||
),
|
||||
$this->CSSKey =>array(
|
||||
'/js/lib/jquery.ui/jquery-ui.lasted.css'
|
||||
)
|
||||
),
|
||||
|
||||
/********* Bootstrap ******/
|
||||
'bootstrap'=>array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/bootstrap/js/bootstrap.min.js',
|
||||
),
|
||||
$this->CSSKey =>array(
|
||||
'/js/lib/bootstrap/css/bootstrap.min.css',
|
||||
'/js/lib/bootstrap/css/bootstrap-responsive.min.css'
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
/********Jquery 插件********/
|
||||
|
||||
//colorbox
|
||||
'colorbox' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jquery.colorbox/jquery.colorbox-min.js'
|
||||
),
|
||||
$this->CSSKey => array(
|
||||
'/js/lib/jquery.colorbox/style2/colorbox.css'
|
||||
)
|
||||
),
|
||||
|
||||
//inputbg
|
||||
'inputbg' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/custom/jquery.inputbg.js'
|
||||
)
|
||||
),
|
||||
|
||||
//loadinglayer
|
||||
'loadinglayer' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/custom/jquery.loadinglayer.js'
|
||||
)
|
||||
),
|
||||
|
||||
//admin_plugin
|
||||
'admin_plugin' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/custom/admin_plugin.js'
|
||||
)
|
||||
),
|
||||
|
||||
'jplayer' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jplayer/jquery.jplayer.min.js'
|
||||
)
|
||||
),
|
||||
|
||||
//slides
|
||||
'slides' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jquery.slides.min.js'
|
||||
)
|
||||
),
|
||||
|
||||
'datatable' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jquery.datatable/jquery.dataTables.min.js'
|
||||
),
|
||||
$this->CSSKey => array(
|
||||
'/js/lib/jquery.datatable/datatable.css'
|
||||
)
|
||||
),
|
||||
|
||||
'masonry' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/jquery.masonry.min.js'
|
||||
),
|
||||
),
|
||||
|
||||
'uploadify' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/uploadify/jquery.uploadify.min.js'
|
||||
),
|
||||
$this->CSSKey => array(
|
||||
'/js/lib/uploadify/uploadify.css'
|
||||
),
|
||||
),
|
||||
|
||||
'datepicker' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/datepicker/jquery-ui-1.10.3.custom.min.js'
|
||||
),
|
||||
$this->CSSKey => array(
|
||||
'/js/lib/datepicker/jquery-ui-1.10.3.custom.min.css'
|
||||
)
|
||||
),
|
||||
|
||||
'highstock' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/highstock/highstock.js'
|
||||
)
|
||||
),
|
||||
|
||||
/*********谷歌地图*********/
|
||||
|
||||
//Google Map API v3
|
||||
'google_map_v3'=>array(
|
||||
$this->ScriptKey => array(
|
||||
'http://maps.google.com/maps/api/js?sensor=false&language=zh-cn'
|
||||
)
|
||||
),
|
||||
|
||||
//Google Map API v3 - KeyDragZone
|
||||
'google_map_keydragzone' => array(
|
||||
$this->ScriptKey => array(
|
||||
'/js/lib/google-map/keydragzoom.js'
|
||||
)
|
||||
),
|
||||
|
||||
);//插件列表
|
||||
|
||||
}// _init_plus()
|
||||
|
||||
//前台添加插件
|
||||
function AppendPlus($render,$plus_name){
|
||||
|
||||
$plus_name = strtolower($plus_name);
|
||||
|
||||
$plusing = $this->plus;
|
||||
|
||||
if(!empty($plusing[$plus_name][$this->ScriptKey]))
|
||||
{
|
||||
foreach($plusing[$plus_name][$this->ScriptKey] as $k=>$v)
|
||||
{
|
||||
$render->headScript()->appendFile($v);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($plusing[$plus_name][$this->CSSKey]))
|
||||
{
|
||||
foreach($plusing[$plus_name][$this->CSSKey] as $k=>$v)
|
||||
{
|
||||
$render->headLink()->appendStylesheet($v);
|
||||
}
|
||||
}
|
||||
|
||||
}// AppendPlus
|
||||
|
||||
//加载页面中的JS
|
||||
function AppendModel($render,$model)
|
||||
{
|
||||
|
||||
$model = trim($model);
|
||||
|
||||
$render->headScript()->appendFile("/js/lib/custom/models/".$model.".js");
|
||||
|
||||
}//
|
||||
}
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
namespace Helpers;
|
||||
|
||||
class PDO extends \PDO
|
||||
{
|
||||
private $debug = 0; //调试模式
|
||||
|
||||
private $config_local_path = "config/autoload/local.php";
|
||||
|
||||
public $db_cfg;
|
||||
|
||||
function __construct($DSN = NULL)
|
||||
{
|
||||
|
||||
if(empty($DSN))
|
||||
{
|
||||
$config_local = new Zend_Config(include $this->config_local_path);
|
||||
$dsn = "pgsql:host={$config_local->db->hostname};"
|
||||
."port=5432;"
|
||||
."dbname={$config_local->db->database};"
|
||||
."user={$config_local->db->username};"
|
||||
."password={$config_local->db->password}";
|
||||
parent::__construct($dsn);
|
||||
}
|
||||
|
||||
else{
|
||||
|
||||
if(is_string($DSN))
|
||||
{
|
||||
parent::__construct($DSN);
|
||||
}
|
||||
|
||||
else{
|
||||
$dsn = "pgsql:host={$DSN['host']};"
|
||||
."port={$DSN['port']};"
|
||||
."dbname={$DSN['db']};"
|
||||
."user={$DSN['user']};"
|
||||
."password={$DSN['pwd']}";
|
||||
parent::__construct($dsn);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
namespace Westdc\Visual\Event;
|
||||
|
||||
use Zend\EventManager\EventInterface;
|
||||
|
||||
interface RecordEvent
|
||||
{
|
||||
public function checkParam(EventInterface $e);
|
||||
public function processData(EventInterface $e);
|
||||
|
||||
public function recordPosted(EventInterface $e);
|
||||
public function recordChanged(EventInterface $e);
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
namespace Westdc\Visual;
|
||||
|
||||
class Factory
|
||||
{
|
||||
private $namespace_root = "\\Westdc\\Visual\\Reader\\";
|
||||
|
||||
function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static function Bootstrap($recordType)
|
||||
{
|
||||
$namespace_root = "\\Westdc\\Visual\\Reader\\";
|
||||
|
||||
$recordType = ucfirst($recordType);
|
||||
|
||||
$_class = $namespace_root . $recordType;
|
||||
|
||||
return new $_class;
|
||||
}
|
||||
|
||||
static function Handle($recordType)
|
||||
{
|
||||
$namespace_root = "\\Westdc\\Visual\\Handle\\";
|
||||
|
||||
$recordType = ucfirst($recordType);
|
||||
|
||||
$_class = $namespace_root . $recordType . "Handle";
|
||||
|
||||
return new $_class;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
namespace Westdc\Visual\Handle;
|
||||
|
||||
use \Helpers\View as view;
|
||||
use \Helpers\dbh;
|
||||
use \Helpers\Table;
|
||||
|
||||
//事件中存在的操作
|
||||
class VisualHandler
|
||||
{
|
||||
private $db; //传入PDO对象误
|
||||
private $config; //全局配置
|
||||
|
||||
public $table;
|
||||
public $tbl_maillog = ""; //邮件日志表
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->db = \Zend_Registry::get('db');
|
||||
|
||||
|
||||
$this->config = \Zend_Registry::get('config');
|
||||
$this->table = new Table();
|
||||
}
|
||||
|
||||
public function deleteAuthor(\Zend_EventManager_Event $e)
|
||||
{
|
||||
$id = $e->getParam('id');
|
||||
|
||||
$ref = new Reference();
|
||||
|
||||
return $ref->deleteReferenceAuthor($id);
|
||||
}
|
||||
|
||||
public function deleteTag(\Zend_EventManager_Event $e)
|
||||
{
|
||||
$id = $e->getParam('id');
|
||||
|
||||
$ref = new Reference();
|
||||
|
||||
return $ref->deleteReferenceTag($id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
namespace Westdc\Visual\Listener;
|
||||
|
||||
use Zend\EventManager\ListenerAggregateInterface;
|
||||
use Zend\EventManager\EventManagerInterface;
|
||||
use Westdc\Visual\Factory;
|
||||
|
||||
class RecordListener implements ListenerAggregateInterface
|
||||
{
|
||||
protected $listeners = array();
|
||||
protected $_Events;
|
||||
|
||||
function __construct($recordType)
|
||||
{
|
||||
$this->_Events = Factory::Handle($recordType);
|
||||
}
|
||||
|
||||
public function attach(EventManagerInterface $events)
|
||||
{
|
||||
$this->listeners[] = $events->attach('submit.checkParam', array($this->_Events, 'checkParam'), 100);
|
||||
$this->listeners[] = $events->attach('submit.processData', array($this->_Events, 'processData'), 100);
|
||||
$this->listeners[] = $events->attach('submit.recordPosted', array($this->_Events, 'recordPosted'), 100);
|
||||
$this->listeners[] = $events->attach('submit.recordChanged', array($this->_Events, 'recordChanged'), 100);
|
||||
}
|
||||
|
||||
public function detach(EventManagerInterface $events)
|
||||
{
|
||||
foreach ($this->listeners as $index => $listener) {
|
||||
if ($events->detach($listener)) {
|
||||
unset($this->listeners[$index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
namespace Westdc\Visual\Listener;
|
||||
|
||||
class VisualListener implements \Zend_EventManager_ListenerAggregate
|
||||
{
|
||||
private $event;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->event = new \Zend_EventManager_EventManager();
|
||||
}
|
||||
|
||||
public function attach(\Zend_EventManager_EventCollection $events)
|
||||
{
|
||||
$Handler = new ReferenceHandler();
|
||||
$events->attach('submit.checkParam', array($Handler, 'checkReferenceParam'), 100);
|
||||
$events->attach('submit.processData', array($Handler, 'processReferenceData'), 100);
|
||||
$events->attach('submit.recordPosted', array($Handler, 'recordPosted'), 100);
|
||||
$events->attach('submit.recordChanged', array($Handler, 'recordChanged'), 100);
|
||||
}
|
||||
|
||||
public function detach(\Zend_EventManager_EventCollection $events)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
//含沙量
|
||||
//Sediment Concentration
|
||||
namespace Westdc\Visual\Reader;
|
||||
|
||||
use Westdc\Visual\Record;
|
||||
use Westdc\Visual\RecordInterface;
|
||||
|
||||
class Sc extends Record implements RecordInterface
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct(__CLASS__);
|
||||
}
|
||||
|
||||
public $subset;
|
||||
|
||||
public function switchDataset()
|
||||
{
|
||||
if(empty($this->subset))
|
||||
{
|
||||
$this->subset = "avg_sand";
|
||||
return;
|
||||
}
|
||||
|
||||
switch($this->subset){
|
||||
case "avg":
|
||||
$this->subset = "avg_sand";
|
||||
break;
|
||||
case "max" :
|
||||
$this->subset = "max_sand";
|
||||
break;
|
||||
case "min" :
|
||||
$this->subset = "min_sand";
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public function getData()
|
||||
{
|
||||
$sql = "SELECT * FROM data_sands
|
||||
ORDER BY
|
||||
year ASC,
|
||||
month ASC
|
||||
";
|
||||
|
||||
$rs = $this->db->query($sql);
|
||||
return $rs;
|
||||
|
||||
}
|
||||
|
||||
public function outPut()
|
||||
{
|
||||
$this->switchDataset();
|
||||
|
||||
$rs = $this->getData();
|
||||
|
||||
$data = array();
|
||||
|
||||
while($row = $rs->fetch())
|
||||
{
|
||||
$row['utctime'] = $this->utcMsTime(mktime(0,0,0,$row['month'],0,$row['year']));
|
||||
$data[] = array($row['utctime'],$row[$this->subset]);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
//含沙量
|
||||
//Sediment Concentration
|
||||
namespace Westdc\Visual\Reader;
|
||||
|
||||
use Westdc\Visual\Record;
|
||||
use Westdc\Visual\RecordInterface;
|
||||
|
||||
class Sc2009 extends Record implements RecordInterface
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct(__CLASS__);
|
||||
}
|
||||
|
||||
public $subset;
|
||||
|
||||
public function switchDataset()
|
||||
{
|
||||
if(empty($this->subset))
|
||||
{
|
||||
$this->subset = "avg_sand";
|
||||
return;
|
||||
}
|
||||
|
||||
switch($this->subset){
|
||||
case "avg":
|
||||
$this->subset = "avg_sand";
|
||||
break;
|
||||
case "max" :
|
||||
$this->subset = "max_sand";
|
||||
break;
|
||||
case "min" :
|
||||
$this->subset = "min_sand";
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public function getData()
|
||||
{
|
||||
$sql = "SELECT * FROM data_sands2009
|
||||
ORDER BY
|
||||
year ASC,
|
||||
month ASC
|
||||
";
|
||||
|
||||
$rs = $this->db->query($sql);
|
||||
return $rs;
|
||||
|
||||
}
|
||||
|
||||
public function outPut()
|
||||
{
|
||||
$this->switchDataset();
|
||||
|
||||
$rs = $this->getData();
|
||||
|
||||
$data = array();
|
||||
|
||||
while($row = $rs->fetch())
|
||||
{
|
||||
$row['utctime'] = $this->utcMsTime(mktime(0,0,0,$row['month'],0,$row['year']));
|
||||
$data[] = array($row['utctime'],$row[$this->subset]);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
//土壤水分
|
||||
namespace Westdc\Visual\Reader;
|
||||
|
||||
use Westdc\Visual\Record;
|
||||
use Westdc\Visual\RecordInterface;
|
||||
|
||||
class SoilMoisture extends Record implements RecordInterface
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct(__CLASS__);
|
||||
}
|
||||
|
||||
public $subset;
|
||||
|
||||
public function switchDataset()
|
||||
{
|
||||
if(empty($this->subset))
|
||||
{
|
||||
$this->subset = "20cm";
|
||||
return;
|
||||
}
|
||||
|
||||
switch($this->subset){
|
||||
case "10cm":
|
||||
$this->subset = "vwc_avg10";
|
||||
break;
|
||||
case "20cm" :
|
||||
$this->subset = "vwc_avg20";
|
||||
break;
|
||||
case "30cm" :
|
||||
$this->subset = "vwc_avg30";
|
||||
break;
|
||||
case "40cm" :
|
||||
$this->subset = "vwc_avg40";
|
||||
break;
|
||||
case "50cm" :
|
||||
$this->subset = "vwc_avg50";
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public function getData()
|
||||
{
|
||||
$this->switchDataset();
|
||||
|
||||
$sql = "SELECT * FROM data_watercontent
|
||||
WHERE
|
||||
$this->subset > 0
|
||||
ORDER BY
|
||||
extract(year from \"timestamp\") ASC,
|
||||
extract(month from \"timestamp\") ASC,
|
||||
extract(day from \"timestamp\") ASC,
|
||||
extract(hour from \"timestamp\") ASC
|
||||
";
|
||||
//exit($sql);
|
||||
$rs = $this->db->query($sql);
|
||||
return $rs;
|
||||
|
||||
}
|
||||
|
||||
public function outPut()
|
||||
{
|
||||
|
||||
$rs = $this->getData();
|
||||
|
||||
$data = array();
|
||||
|
||||
while($row = $rs->fetch())
|
||||
{
|
||||
$row['utctime'] = $this->utcMsTime(strtotime($row['timestamp']));
|
||||
$data[] = array($row['utctime'],$row[$this->subset]);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
namespace Westdc\Visual;
|
||||
|
||||
class Record
|
||||
{
|
||||
|
||||
public $db;
|
||||
|
||||
function __construct($recordType)
|
||||
{
|
||||
$this->initDatabase();
|
||||
}
|
||||
|
||||
public function initDatabase()
|
||||
{
|
||||
$config = \Zend_Registry::get('config');
|
||||
|
||||
$dsn = "pgsql:host={$config->visual_db->hostname};"
|
||||
."port={$config->visual_db->port};"
|
||||
."dbname={$config->visual_db->database};"
|
||||
."user={$config->visual_db->username};"
|
||||
."password={$config->visual_db->password}";
|
||||
|
||||
$this->db = new \PDO($dsn);
|
||||
}
|
||||
|
||||
public function makeSql($table,$index,$fieldValue,$fieldTime)
|
||||
{
|
||||
$sql = "SELECT
|
||||
\"$index\" as \"index\", \"$fieldValue\" as \"value\", \"$fieldTime\" as \"time\"
|
||||
FROM \"$table\"
|
||||
ORDER BY
|
||||
extract(year from \"$fieldTime\") ASC,
|
||||
extract(month from \"$fieldTime\") ASC,
|
||||
extract(day from \"$fieldTime\") ASC,
|
||||
";
|
||||
|
||||
$rs = $this->db->query($sql);
|
||||
return $rs;
|
||||
}
|
||||
|
||||
public function utcMsTime($time=''){
|
||||
if(empty($time))
|
||||
return (time()+8*3600)*1000;
|
||||
else
|
||||
return $time*1000;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
namespace Westdc\Visual;
|
||||
|
||||
interface RecordInterface
|
||||
{
|
||||
public function outPut();
|
||||
public function getData();
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
namespace Westdc\Visual;
|
||||
|
||||
use Westdc\Visual\VisualListener;
|
||||
|
||||
class Visual
|
||||
{
|
||||
public $db;
|
||||
|
||||
function __construct($recordType)
|
||||
{
|
||||
$this->db = \Zend_Registry::get('db');
|
||||
$Listener = new Listener();
|
||||
@$this->getEventManager()->attachAggregate($Listener);
|
||||
|
||||
}
|
||||
|
||||
public function getEventManager(\Zend_EventManager_EventCollection $events = NULL)
|
||||
{
|
||||
if ($events !== NULL) {
|
||||
$this->events = $events;
|
||||
} elseif ($this->events === NULL) {
|
||||
$this->events = new \Zend_EventManager_EventManager(__CLASS__);
|
||||
}
|
||||
return $this->events;
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add($data,$id = 0)
|
||||
{
|
||||
$params = compact('data');
|
||||
$results = $this->getEventManager()->trigger('submit.checkParam', $this, $params);
|
||||
$cache_data = $results->last();
|
||||
|
||||
if($cache_data !== true)
|
||||
{
|
||||
return $cache_data;
|
||||
}
|
||||
|
||||
$results = $this->getEventManager()->trigger('submit.processData', $this, $params);
|
||||
$data = $results->last();
|
||||
|
||||
$dbh = new dbh();
|
||||
|
||||
if(empty($id))
|
||||
{
|
||||
$id = $dbh->insert($this->mainTable,$data,true);
|
||||
|
||||
if(!empty($id) && is_numeric($id))
|
||||
{
|
||||
$this->getEventManager()->trigger('submit.recordPosted', $this, $params);
|
||||
return true;
|
||||
}else{
|
||||
if($id === false)
|
||||
{
|
||||
return '服务器开小差了,请稍后再试';
|
||||
}else{
|
||||
return '服务器处理中遇到错误,请联系管理员';
|
||||
}
|
||||
}
|
||||
}//add
|
||||
|
||||
else{
|
||||
if(!$dbh->update($this->mainTable,$data," id=$id ",true))
|
||||
{
|
||||
$this->getEventManager()->trigger('submit.recordChanged', $this, $params);
|
||||
return "修改失败!请重试";
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}//edit
|
||||
|
||||
}// add()
|
||||
|
||||
//删除
|
||||
public function del($id)
|
||||
{
|
||||
if(!is_numeric($id) || empty($id) || $id< 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM {$this->mainTable} WHERE id=$id";
|
||||
return $this->db->exec($sql);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
Highstock JS v2.0.1 (2014-04-24)
|
||||
|
||||
Standalone Highcharts Framework
|
||||
|
||||
License: MIT License
|
||||
*/
|
||||
var HighchartsAdapter=function(){function o(c){function b(b,a,d){b.removeEventListener(a,d,!1)}function d(b,a,d){d=b.HCProxiedMethods[d.toString()];b.detachEvent("on"+a,d)}function a(a,c){var f=a.HCEvents,i,g,k,j;if(a.removeEventListener)i=b;else if(a.attachEvent)i=d;else return;c?(g={},g[c]=!0):g=f;for(j in g)if(f[j])for(k=f[j].length;k--;)i(a,j,f[j][k])}c.HCExtended||Highcharts.extend(c,{HCExtended:!0,HCEvents:{},bind:function(b,a){var d=this,c=this.HCEvents,g;if(d.addEventListener)d.addEventListener(b,
|
||||
a,!1);else if(d.attachEvent){g=function(b){b.target=b.srcElement||window;a.call(d,b)};if(!d.HCProxiedMethods)d.HCProxiedMethods={};d.HCProxiedMethods[a.toString()]=g;d.attachEvent("on"+b,g)}c[b]===r&&(c[b]=[]);c[b].push(a)},unbind:function(c,h){var f,i;c?(f=this.HCEvents[c]||[],h?(i=HighchartsAdapter.inArray(h,f),i>-1&&(f.splice(i,1),this.HCEvents[c]=f),this.removeEventListener?b(this,c,h):this.attachEvent&&d(this,c,h)):(a(this,c),this.HCEvents[c]=[])):(a(this),this.HCEvents={})},trigger:function(b,
|
||||
a){var d=this.HCEvents[b]||[],c=d.length,g,k,j;k=function(){a.defaultPrevented=!0};for(g=0;g<c;g++){j=d[g];if(a.stopped)break;a.preventDefault=k;a.target=this;if(!a.type)a.type=b;j.call(this,a)===!1&&a.preventDefault()}}});return c}var r,l=document,p=[],m=[],q,n;Math.easeInOutSine=function(c,b,d,a){return-d/2*(Math.cos(Math.PI*c/a)-1)+b};return{init:function(c){if(!l.defaultView)this._getStyle=function(b,d){var a;return b.style[d]?b.style[d]:(d==="opacity"&&(d="filter"),a=b.currentStyle[d.replace(/\-(\w)/g,
|
||||
function(a,b){return b.toUpperCase()})],d==="filter"&&(a=a.replace(/alpha\(opacity=([0-9]+)\)/,function(b,a){return a/100})),a===""?1:a)},this.adapterRun=function(b,d){var a={width:"clientWidth",height:"clientHeight"}[d];if(a)return b.style.zoom=1,b[a]-2*parseInt(HighchartsAdapter._getStyle(b,"padding"),10)};if(!Array.prototype.forEach)this.each=function(b,d){for(var a=0,c=b.length;a<c;a++)if(d.call(b[a],b[a],a,b)===!1)return a};if(!Array.prototype.indexOf)this.inArray=function(b,d){var a,c=0;if(d)for(a=
|
||||
d.length;c<a;c++)if(d[c]===b)return c;return-1};if(!Array.prototype.filter)this.grep=function(b,d){for(var a=[],c=0,h=b.length;c<h;c++)d(b[c],c)&&a.push(b[c]);return a};n=function(b,c,a){this.options=c;this.elem=b;this.prop=a};n.prototype={update:function(){var b;b=this.paths;var d=this.elem,a=d.element;b&&a?d.attr("d",c.step(b[0],b[1],this.now,this.toD)):d.attr?a&&d.attr(this.prop,this.now):(b={},b[this.prop]=this.now+this.unit,Highcharts.css(d,b));this.options.step&&this.options.step.call(this.elem,
|
||||
this.now,this)},custom:function(b,c,a){var e=this,h=function(a){return e.step(a)},f;this.startTime=+new Date;this.start=b;this.end=c;this.unit=a;this.now=this.start;this.pos=this.state=0;h.elem=this.elem;h()&&m.push(h)===1&&(q=setInterval(function(){for(f=0;f<m.length;f++)m[f]()||m.splice(f--,1);m.length||clearInterval(q)},13))},step:function(b){var c=+new Date,a;a=this.options;var e=this.elem,h;if(e.stopAnimation||e.attr&&!e.element)a=!1;else if(b||c>=a.duration+this.startTime){this.now=this.end;
|
||||
this.pos=this.state=1;this.update();b=this.options.curAnim[this.prop]=!0;for(h in a.curAnim)a.curAnim[h]!==!0&&(b=!1);b&&a.complete&&a.complete.call(e);a=!1}else e=c-this.startTime,this.state=e/a.duration,this.pos=a.easing(e,0,1,a.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update(),a=!0;return a}};this.animate=function(b,d,a){var e,h="",f,i,g;b.stopAnimation=!1;if(typeof a!=="object"||a===null)e=arguments,a={duration:e[2],easing:e[3],complete:e[4]};if(typeof a.duration!=="number")a.duration=
|
||||
400;a.easing=Math[a.easing]||Math.easeInOutSine;a.curAnim=Highcharts.extend({},d);for(g in d)i=new n(b,a,g),f=null,g==="d"?(i.paths=c.init(b,b.d,d.d),i.toD=d.d,e=0,f=1):b.attr?e=b.attr(g):(e=parseFloat(HighchartsAdapter._getStyle(b,g))||0,g!=="opacity"&&(h="px")),f||(f=parseFloat(d[g])),i.custom(e,f,h)}},_getStyle:function(c,b){return window.getComputedStyle(c,void 0).getPropertyValue(b)},getScript:function(c,b){var d=l.getElementsByTagName("head")[0],a=l.createElement("script");a.type="text/javascript";
|
||||
a.src=c;a.onload=b;d.appendChild(a)},inArray:function(c,b){return b.indexOf?b.indexOf(c):p.indexOf.call(b,c)},adapterRun:function(c,b){return parseInt(HighchartsAdapter._getStyle(c,b),10)},grep:function(c,b){return p.filter.call(c,b)},map:function(c,b){for(var d=[],a=0,e=c.length;a<e;a++)d[a]=b.call(c[a],c[a],a,c);return d},offset:function(c){var b=document.documentElement,c=c.getBoundingClientRect();return{top:c.top+(window.pageYOffset||b.scrollTop)-(b.clientTop||0),left:c.left+(window.pageXOffset||
|
||||
b.scrollLeft)-(b.clientLeft||0)}},addEvent:function(c,b,d){o(c).bind(b,d)},removeEvent:function(c,b,d){o(c).unbind(b,d)},fireEvent:function(c,b,d,a){var e;l.createEvent&&(c.dispatchEvent||c.fireEvent)?(e=l.createEvent("Events"),e.initEvent(b,!0,!0),e.target=c,Highcharts.extend(e,d),c.dispatchEvent?c.dispatchEvent(e):c.fireEvent(b,e)):c.HCExtended===!0&&(d=d||{},c.trigger(b,d));d&&d.defaultPrevented&&(a=null);a&&a(d)},washMouseEvent:function(c){return c},stop:function(c){c.stopAnimation=!0},each:function(c,
|
||||
b){return Array.prototype.forEach.call(c,b)}}}();
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
Highcharts JS v4.0.1 (2014-04-24)
|
||||
|
||||
(c) 2009-2013 Torstein Hønsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(c){function x(e,a,b,d){var f,g,h;b*=n;a*=n;var i=[],j,o,t;b*=-1;j=d.x;o=d.y;t=(d.z===0?1.0E-4:d.z)*(d.vd||25);var y=k(b),v=l(b),m=k(a),q=l(a),r,u,s;c.each(e,function(a){r=a.x-j;u=a.y-o;s=a.z||0;f=v*r-y*s;g=-y*m*r-v*m*s+q*u;h=y*q*r+v*q*s+m*u;f=f*((t-h)/t)+j;g=g*((t-h)/t)+o;i.push({x:C(f),y:C(g),z:C(h)})});return i}function z(e,a,b,d,f,c,h,i){var j=[];return c>f&&c-f>m/2+1.0E-4?(j=j.concat(z(e,a,b,d,f,f+m/2,h,i)),j=j.concat(z(e,a,b,d,f+m/2,c,h,i))):c<f&&f-c>m/2+1.0E-4?(j=j.concat(z(e,a,b,
|
||||
d,f,f-m/2,h,i)),j=j.concat(z(e,a,b,d,f-m/2,c,h,i))):(j=c-f,["C",e+b*l(f)-b*D*j*k(f)+h,a+d*k(f)+d*D*j*l(f)+i,e+b*l(c)+b*D*j*k(c)+h,a+d*k(c)-d*D*j*l(c)+i,e+b*l(c)+h,a+d*k(c)+i])}function F(e){if(this.chart.is3d()){var a=this.chart.options.plotOptions.column.grouping;a!==void 0&&!a&&this.group.zIndex!==void 0&&this.group.attr({zIndex:this.group.zIndex*10});if(this.userOptions.borderColor===void 0)this.options.borderColor=this.color;c.each(this.data,function(a){var d=a.options.borderColor||a.color||a.series.userOptions.borderColor;
|
||||
a.options.borderColor=d;a.borderColor=d;a.pointAttr[""].stroke=d;a.pointAttr.hover.stroke=d;a.pointAttr.select.stroke=d})}e.apply(this,[].slice.call(arguments,1))}var m=Math.PI,n=m/180,k=Math.sin,l=Math.cos,C=Math.round,D=4*(Math.sqrt(2)-1)/3/(m/2);c.SVGRenderer.prototype.toLinePath=function(e,a){var b=[];c.each(e,function(a){b.push("L",a.x,a.y)});b[0]="M";a&&b.push("Z");return b};c.SVGRenderer.prototype.cuboid=function(e){var a=this.g(),e=this.cuboidPath(e);a.front=this.path(e[0]).attr({zIndex:e[3],
|
||||
"stroke-linejoin":"round"}).add(a);a.top=this.path(e[1]).attr({zIndex:e[4],"stroke-linejoin":"round"}).add(a);a.side=this.path(e[2]).attr({zIndex:e[5],"stroke-linejoin":"round"}).add(a);a.fillSetter=function(a){var d=c.Color(a).brighten(0.1).get(),e=c.Color(a).brighten(-0.1).get();this.front.attr({fill:a});this.top.attr({fill:d});this.side.attr({fill:e});this.color=a;return this};a.opacitySetter=function(a){this.front.attr({opacity:a});this.top.attr({opacity:a});this.side.attr({opacity:a});return this};
|
||||
a.attr=function(a){a.shapeArgs||a.x?(a=this.renderer.cuboidPath(a.shapeArgs||a),this.front.attr({d:a[0],zIndex:a[3]}),this.top.attr({d:a[1],zIndex:a[4]}),this.side.attr({d:a[2],zIndex:a[5]})):c.SVGElement.prototype.attr.call(this,a);return this};a.animate=function(a,d,e){a.x&&a.y?(a=this.renderer.cuboidPath(a),this.front.attr({zIndex:a[3]}).animate({d:a[0]},d,e),this.top.attr({zIndex:a[4]}).animate({d:a[1]},d,e),this.side.attr({zIndex:a[5]}).animate({d:a[2]},d,e)):a.opacity?(this.front.animate(a,
|
||||
d,e),this.top.animate(a,d,e),this.side.animate(a,d,e)):c.SVGElement.prototype.animate.call(this,a,d,e);return this};a.destroy=function(){this.front.destroy();this.top.destroy();this.side.destroy();return null};a.attr({zIndex:-e[3]});return a};c.SVGRenderer.prototype.cuboidPath=function(e){var a=e.x,b=e.y,d=e.z,c=e.height,g=e.width,h=e.depth,i=e.alpha,j=e.beta,a=[{x:a,y:b,z:d},{x:a+g,y:b,z:d},{x:a+g,y:b+c,z:d},{x:a,y:b+c,z:d},{x:a,y:b+c,z:d+h},{x:a+g,y:b+c,z:d+h},{x:a+g,y:b,z:d+h},{x:a,y:b,z:d+h}],
|
||||
a=x(a,i,j,e.origin),e=["M",a[0].x,a[0].y,"L",a[7].x,a[7].y,"L",a[6].x,a[6].y,"L",a[1].x,a[1].y,"Z"],b=["M",a[3].x,a[3].y,"L",a[2].x,a[2].y,"L",a[5].x,a[5].y,"L",a[4].x,a[4].y,"Z"],d=["M",a[1].x,a[1].y,"L",a[2].x,a[2].y,"L",a[5].x,a[5].y,"L",a[6].x,a[6].y,"Z"],c=["M",a[0].x,a[0].y,"L",a[7].x,a[7].y,"L",a[4].x,a[4].y,"L",a[3].x,a[3].y,"Z"];return[["M",a[0].x,a[0].y,"L",a[1].x,a[1].y,"L",a[2].x,a[2].y,"L",a[3].x,a[3].y,"Z"],a[7].y<a[1].y?e:a[4].y>a[2].y?b:[],a[6].x>a[1].x?d:a[7].x<a[0].x?c:[],(a[0].z+
|
||||
a[1].z+a[2].z+a[3].z)/4,j>0?(a[0].z+a[7].z+a[6].z+a[1].z)/4:(a[3].z+a[2].z+a[5].z+a[4].z)/4,i>0?(a[1].z+a[2].z+a[5].z+a[6].z)/4:(a[0].z+a[7].z+a[4].z+a[3].z)/4]};c.SVGRenderer.prototype.arc3d=function(e){e.alpha*=n;e.beta*=n;var a=this.g(),b=this.arc3dPath(e),d=a.renderer,f=b.zAll*100;a.shapeArgs=e;a.side1=d.path(b.side2).attr({zIndex:b.zSide2}).add(a);a.side2=d.path(b.side1).attr({zIndex:b.zSide1}).add(a);a.inn=d.path(b.inn).attr({zIndex:b.zInn}).add(a);a.out=d.path(b.out).attr({zIndex:b.zOut}).add(a);
|
||||
a.top=d.path(b.top).attr({zIndex:b.zTop}).add(a);a.fillSetter=function(a){this.color=a;var b=c.Color(a).brighten(-0.1).get();this.side1.attr({fill:b});this.side2.attr({fill:b});this.inn.attr({fill:b});this.out.attr({fill:b});this.top.attr({fill:a});return this};a.animate=function(a,b,d){c.SVGElement.prototype.animate.call(this,a,b,d);if(a.x&&a.y)b=this.renderer,a=c.splat(a)[0],a.alpha*=n,a.beta*=n,b=b.arc3dPath(a),this.shapeArgs=a,this.inn.attr({d:b.inn,zIndex:b.zInn}),this.out.attr({d:b.out,zIndex:b.zOut}),
|
||||
this.side1.attr({d:b.side1,zIndex:b.zSide2}),this.side2.attr({d:b.side2,zIndex:b.zSide1}),this.top.attr({d:b.top,zIndex:b.zTop}),this.attr({fill:this.color}),this.attr({zIndex:b.zAll*100});return this};a.zIndex=f;a.attr({zIndex:f});return a};c.SVGRenderer.prototype.arc3dPath=function(e){var a=e.x,b=e.y,d=e.start,c=e.end-1.0E-5,g=e.r,h=e.innerR,i=e.depth,j=e.alpha,o=e.beta,t=l(d),y=k(d),v=l(c),n=k(c),q=g*l(o),r=g*l(j),u=h*l(o),s=h*l(j),A=i*k(o),B=i*k(j),i=["M",a+q*t,b+r*y],i=i.concat(z(a,b,q,r,d,c,
|
||||
0,0)),i=i.concat(["L",a+u*v,b+s*n]),i=i.concat(z(a,b,u,s,c,d,0,0)),i=i.concat(["Z"]),e=(e.start+e.end)/2,e=k(o)*l(e)+k(-j)*k(-e),p=o>0?m/2:0,w=j>0?0:m/2,p=d>-p?d:c>-p?-p:d,x=c<m-w?c:d<m-w?m-w:c,w=["M",a+q*l(p),b+r*k(p)],w=w.concat(z(a,b,q,r,p,x,0,0)),w=w.concat(["L",a+q*l(x)+A,b+r*k(x)+B]),w=w.concat(z(a,b,q,r,x,p,A,B)),w=w.concat(["Z"]),p=["M",a+u*t,b+s*y],p=p.concat(z(a,b,u,s,d,c,0,0)),p=p.concat(["L",a+u*l(c)+A,b+s*k(c)+B]),p=p.concat(z(a,b,u,s,c,d,A,B)),p=p.concat(["Z"]),t=["M",a+q*t,b+r*y,"L",
|
||||
a+q*t+A,b+r*y+B,"L",a+u*t+A,b+s*y+B,"L",a+u*t,b+s*y,"Z"],a=["M",a+q*v,b+r*n,"L",a+q*v+A,b+r*n+B,"L",a+u*v+A,b+s*n+B,"L",a+u*v,b+s*n,"Z"],v=h+(g-h)/2,b=Math.abs(e*2*v);g*=e;h*=e;d=(k(o)*l(d)+k(-j)*k(-d))*v;c=(k(o)*l(c)+k(-j)*k(-c))*v;return{top:i,zTop:b*100,out:w,zOut:g*100,inn:p,zInn:h*100,side1:t,zSide1:d*100,side2:a,zSide2:c*100,zAll:e}};c.Chart.prototype.is3d=function(){return this.options.chart.options3d&&this.options.chart.options3d.enabled};c.wrap(c.Chart.prototype,"isInsidePlot",function(c){return this.is3d()?
|
||||
!0:c.apply(this,[].slice.call(arguments,1))});c.wrap(c.Chart.prototype,"init",function(e){var a=arguments;a[1]=c.merge({chart:{options3d:{enabled:!1,alpha:0,beta:0,depth:100,viewDistance:25,frame:{bottom:{size:1,color:"rgba(255,255,255,0)"},side:{size:1,color:"rgba(255,255,255,0)"},back:{size:1,color:"rgba(255,255,255,0)"}}}}},a[1]);e.apply(this,[].slice.call(a,1))});c.wrap(c.Chart.prototype,"setChartSize",function(c){c.apply(this,[].slice.call(arguments,1));if(this.is3d()){var a=this.inverted,b=
|
||||
this.clipBox,d=this.margin;b[a?"y":"x"]=-(d[3]||0);b[a?"x":"y"]=-(d[0]||0);b[a?"height":"width"]=this.chartWidth+(d[3]||0)+(d[1]||0);b[a?"width":"height"]=this.chartHeight+(d[0]||0)+(d[2]||0)}});c.wrap(c.Chart.prototype,"redraw",function(c){if(this.is3d())this.isDirtyBox=!0;c.apply(this,[].slice.call(arguments,1))});c.Chart.prototype.retrieveStacks=function(){var e={},a=this.options.plotOptions[this.options.chart.type],b=a.stacking,d=1;if(a.grouping||!b)return this.series;c.each(this.series,function(a){e[a.options.stack||
|
||||
0]?e[a.options.stack||0].series.push(a):(e[a.options.stack||0]={series:[a],position:d},d++)});e.totalStacks=d+1;return e};c.wrap(c.Axis.prototype,"init",function(e){var a=arguments;if(a[1].is3d())a[2].tickWidth=c.pick(a[2].tickWidth,0),a[2].gridLineWidth=c.pick(a[2].gridLineWidth,1);e.apply(this,[].slice.call(arguments,1))});c.wrap(c.Axis.prototype,"render",function(c){c.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var a=this.chart,b=a.renderer,d=a.options.chart.options3d,f=d.alpha,
|
||||
g=d.beta*(a.yAxis[0].opposite?-1:1),h=d.frame,i=h.bottom,j=h.back,h=h.side,o=d.depth,k=this.height,l=this.width,m=this.left,n=this.top,d={x:a.plotLeft+a.plotWidth/2,y:a.plotTop+a.plotHeight/2,z:o,vd:d.viewDistance};if(this.horiz)this.axisLine&&this.axisLine.hide(),g={x:m,y:n+(a.yAxis[0].reversed?-i.size:k),z:0,width:l,height:i.size,depth:o,alpha:f,beta:g,origin:d},this.bottomFrame?this.bottomFrame.animate(g):this.bottomFrame=b.cuboid(g).attr({fill:i.color,zIndex:a.yAxis[0].reversed&&f>0?4:-1}).css({stroke:i.color}).add();
|
||||
else{var q={x:m,y:n,z:o+1,width:l,height:k+i.size,depth:j.size,alpha:f,beta:g,origin:d};this.backFrame?this.backFrame.animate(q):this.backFrame=b.cuboid(q).attr({fill:j.color,zIndex:-3}).css({stroke:j.color}).add();this.axisLine&&this.axisLine.hide();a={x:(a.yAxis[0].opposite?l:0)+m-h.size,y:n,z:0,width:h.size,height:k+i.size,depth:o+j.size,alpha:f,beta:g,origin:d};this.sideFrame?this.sideFrame.animate(a):this.sideFrame=b.cuboid(a).attr({fill:h.color,zIndex:-2}).css({stroke:h.color}).add()}}});c.wrap(c.Axis.prototype,
|
||||
"getPlotLinePath",function(c){var a=c.apply(this,[].slice.call(arguments,1));if(!this.chart.is3d())return a;if(a===null)return a;var b=this.chart,d=b.options.chart.options3d,f=d.depth;d.origin={x:b.plotLeft+b.plotWidth/2,y:b.plotTop+b.plotHeight/2,z:f,vd:d.viewDistance};var a=[{x:a[1],y:a[2],z:this.horiz||this.opposite?f:0},{x:a[1],y:a[2],z:f},{x:a[4],y:a[5],z:f},{x:a[4],y:a[5],z:this.horiz||this.opposite?0:f}],f=b.options.inverted?d.beta:d.alpha,g=b.options.inverted?d.alpha:d.beta;g*=b.yAxis[0].opposite?
|
||||
-1:1;a=x(a,f,g,d.origin);return a=this.chart.renderer.toLinePath(a,!1)});c.wrap(c.Tick.prototype,"getMarkPath",function(c){var a=c.apply(this,[].slice.call(arguments,1));if(!this.axis.chart.is3d())return a;var b=this.axis.chart,d=b.options.chart.options3d,f={x:b.plotLeft+b.plotWidth/2,y:b.plotTop+b.plotHeight/2,z:d.depth,vd:d.viewDistance},a=[{x:a[1],y:a[2],z:0},{x:a[4],y:a[5],z:0}],g=b.inverted?d.beta:d.alpha,d=b.inverted?d.alpha:d.beta;d*=b.yAxis[0].opposite?-1:1;a=x(a,g,d,f);return a=["M",a[0].x,
|
||||
a[0].y,"L",a[1].x,a[1].y]});c.wrap(c.Tick.prototype,"getLabelPosition",function(c){var a=c.apply(this,[].slice.call(arguments,1));if(!this.axis.chart.is3d())return a;var b=this.axis.chart,d=b.options.chart.options3d,f={x:b.plotLeft+b.plotWidth/2,y:b.plotTop+b.plotHeight/2,z:d.depth,vd:d.viewDistance},g=b.inverted?d.beta:d.alpha,d=b.inverted?d.alpha:d.beta;d*=b.yAxis[0].opposite?-1:1;return a=x([{x:a.x,y:a.y,z:0}],g,d,f)[0]});c.wrap(c.Axis.prototype,"drawCrosshair",function(c){var a=arguments;this.chart.is3d()&&
|
||||
a[2]&&(a[2]={plotX:a[2].plotXold||a[2].plotX,plotY:a[2].plotYold||a[2].plotY});c.apply(this,[].slice.call(a,1))});c.wrap(c.seriesTypes.column.prototype,"translate",function(e){e.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var a=this.chart,b=a.options,d=b.plotOptions[this.chart.options.chart.type],b=b.chart.options3d,f=d.depth||25,g={x:a.plotWidth/2,y:a.plotHeight/2,z:b.depth,vd:b.viewDistance},h=b.alpha,i=b.beta*(a.yAxis[0].opposite?-1:1),j=(d.stacking?this.options.stack||0:this._i)*
|
||||
(f+(d.groupZPadding||1));d.grouping!==!1&&(j=0);j+=d.groupZPadding||1;c.each(this.data,function(a){var b=a.shapeArgs,c=a.tooltipPos;a.shapeType="cuboid";b.alpha=h;b.beta=i;b.z=j;b.origin=g;b.depth=f;c=x([{x:c[0],y:c[1],z:j}],h,i,g)[0];a.tooltipPos=[c.x,c.y]})}});c.wrap(c.seriesTypes.column.prototype,"animate",function(e){if(this.chart.is3d()){var a=arguments[1],b=this.yAxis,d=this,f=this.yAxis.reversed;if(c.svg)a?c.each(d.data,function(a){a.height=a.shapeArgs.height;a.shapeArgs.height=1;if(!f)a.shapeArgs.y=
|
||||
a.stackY?a.plotY+b.translate(a.stackY):a.plotY+(a.negative?-a.height:a.height)}):(c.each(d.data,function(a){a.shapeArgs.height=a.height;if(!f)a.shapeArgs.y=a.plotY-(a.negative?a.height:0);a.graphic&&a.graphic.animate(a.shapeArgs,d.options.animation)}),d.animate=null)}else e.apply(this,[].slice.call(arguments,1))});c.wrap(c.seriesTypes.column.prototype,"init",function(c){c.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var a=this.chart.options.plotOptions.column.grouping,b=this.chart.options.plotOptions.column.stacking,
|
||||
d=this.options.zIndex;if(!d&&(a===void 0||a)&&b){a=this.chart.retrieveStacks();b=this.options.stack||0;for(d=0;d<a[b].series.length;d++)if(a[b].series[d]===this)break;d=a.totalStacks*10-10*(a.totalStacks-a[b].position)-d;this.options.zIndex=d}}});c.seriesTypes.columnrange&&c.wrap(c.seriesTypes.columnrange.prototype,"drawPoints",F);c.wrap(c.seriesTypes.column.prototype,"drawPoints",F);var E=c.getOptions();E.plotOptions.cylinder=c.merge(E.plotOptions.column);E=c.extendClass(c.seriesTypes.column,{type:"cylinder"});
|
||||
c.seriesTypes.cylinder=E;c.wrap(c.seriesTypes.cylinder.prototype,"translate",function(e){e.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var a=this.chart,b=a.options,d=b.plotOptions.cylinder,b=b.chart.options3d,f=d.depth||0,g={x:a.inverted?a.plotHeight/2:a.plotWidth/2,y:a.inverted?a.plotWidth/2:a.plotHeight/2,z:b.depth,vd:b.viewDistance},h=b.alpha,i=d.stacking?(this.options.stack||0)*f:this._i*f;i+=f/2;d.grouping!==!1&&(i=0);c.each(this.data,function(a){var b=a.shapeArgs;a.shapeType=
|
||||
"arc3d";b.x+=f/2;b.z=i;b.start=0;b.end=2*m;b.r=f*0.95;b.innerR=0;b.depth=b.height*(1/k((90-h)*n))-i;b.alpha=90-h;b.beta=0;b.origin=g})}});c.wrap(c.seriesTypes.pie.prototype,"translate",function(e){e.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var a=this,b=a.chart,d=b.options,f=d.plotOptions.pie,g=f.depth||0,d=d.chart.options3d,h={x:b.plotWidth/2,y:b.plotHeight/2,z:d.depth},i=d.alpha,j=d.beta,o=f.stacking?(this.options.stack||0)*g:a._i*g;o+=g/2;f.grouping!==!1&&(o=0);c.each(a.data,
|
||||
function(b){b.shapeType="arc3d";var c=b.shapeArgs;c.z=o;c.depth=g*0.75;c.origin=h;c.alpha=i;c.beta=j;c=(c.end+c.start)/2;b.slicedTranslation={translateX:C(l(c)*a.options.slicedOffset*l(i*n)),translateY:C(k(c)*a.options.slicedOffset*l(i*n))}})}});c.wrap(c.seriesTypes.pie.prototype.pointClass.prototype,"haloPath",function(c){return this.series.chart.is3d()?[]:c.call(this)});c.wrap(c.seriesTypes.pie.prototype,"drawPoints",function(e){this.chart.is3d()&&c.each(this.data,function(a){var b=a.options.borderColor||
|
||||
a.color||a.series.userOptions.borderColor||a.series.color;a.options.borderColor=b;a.borderColor=b;a.pointAttr[""].stroke=b;a.pointAttr.hover.stroke=b;a.pointAttr.select.stroke=b});e.apply(this,[].slice.call(arguments,1))});c.wrap(c.seriesTypes.pie.prototype,"drawDataLabels",function(e){e.apply(this,[].slice.call(arguments,1));this.chart.is3d()&&c.each(this.data,function(a){var b=a.shapeArgs,c=b.r,e=b.depth,g=b.alpha*n,h=b.beta*n,b=(b.start+b.end)/2;a.connector&&a.connector.translate(-c*(1-l(h))*l(b)+
|
||||
(l(b)>0?k(h)*e:0),-c*(1-l(g))*k(b)+(k(b)>0?k(g)*e:0));a.dataLabel&&a.dataLabel.attr({x:a.dataLabel.connX+-c*(1-l(h))*l(b)+(l(b)>0?l(h)*e:0)-a.dataLabel.width/2,y:a.dataLabel.connY+-c*(1-l(g))*k(b)+(k(b)>0?k(g)*e:0)-a.dataLabel.height/2})})});c.wrap(c.seriesTypes.pie.prototype,"addPoint",function(c){c.apply(this,[].slice.call(arguments,1));this.chart.is3d()&&this.update()});c.wrap(c.seriesTypes.pie.prototype,"animate",function(e){if(this.chart.is3d()){var a=arguments[1],b=this.options.animation,d=
|
||||
this.center,f=this.group,g=this.markerGroup;if(c.svg)if(b===!0&&(b={}),a){if(this.oldtranslateX=f.translateX,this.oldtranslateY=f.translateY,a={translateX:d[0],translateY:d[1],scaleX:0.001,scaleY:0.001},f.attr(a),g)g.attrSetters=f.attrSetters,g.attr(a)}else a={translateX:this.oldtranslateX,translateY:this.oldtranslateY,scaleX:1,scaleY:1},f.animate(a,b),g&&g.animate(a,b),this.animate=null}else e.apply(this,[].slice.call(arguments,1))});c.wrap(c.seriesTypes.scatter.prototype,"translate",function(e){e.apply(this,
|
||||
[].slice.call(arguments,1));if(this.chart.is3d()){var a=this.chart,b=this.chart.options.chart.options3d,d=b.alpha,f=b.beta,g={x:a.inverted?a.plotHeight/2:a.plotWidth/2,y:a.inverted?a.plotWidth/2:a.plotHeight/2,z:b.depth,vd:b.viewDistance},b=b.depth,h=a.options.zAxis||{min:0,max:b},i=b/(h.max-h.min);c.each(this.data,function(a){var b={x:a.plotX,y:a.plotY,z:(a.z-h.min)*i},b=x([b],d,f,g)[0];a.plotXold=a.plotX;a.plotYold=a.plotY;a.plotX=b.x;a.plotY=b.y;a.plotZ=b.z})}});c.wrap(c.seriesTypes.scatter.prototype,
|
||||
"init",function(c){var a=c.apply(this,[].slice.call(arguments,1));if(this.chart.is3d())this.pointArrayMap=["x","y","z"],this.tooltipOptions.pointFormat=this.userOptions.tooltip?this.userOptions.tooltip.pointFormat||"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>z: <b>{point.z}</b><br/>":"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>z: <b>{point.z}</b><br/>";return a});if(c.VMLRenderer)c.setOptions({animate:!1}),c.VMLRenderer.prototype.cuboid=c.SVGRenderer.prototype.cuboid,c.VMLRenderer.prototype.cuboidPath=
|
||||
c.SVGRenderer.prototype.cuboidPath,c.VMLRenderer.prototype.toLinePath=c.SVGRenderer.prototype.toLinePath,c.VMLRenderer.prototype.createElement3D=c.SVGRenderer.prototype.createElement3D,c.VMLRenderer.prototype.arc3d=function(e){e=c.SVGRenderer.prototype.arc3d.call(this,e);e.css({zIndex:e.zIndex});return e},c.VMLRenderer.prototype.arc3dPath=c.SVGRenderer.prototype.arc3dPath,c.Chart.prototype.renderSeries=function(){for(var c,a=this.series.length;a--;)c=this.series[a],c.translate(),c.setTooltipPoints&&
|
||||
c.setTooltipPoints(),c.render()},c.wrap(c.Axis.prototype,"render",function(c){c.apply(this,[].slice.call(arguments,1));this.sideFrame&&(this.sideFrame.css({zIndex:0}),this.sideFrame.front.attr({fill:this.sideFrame.color}));this.bottomFrame&&(this.bottomFrame.css({zIndex:1}),this.bottomFrame.front.attr({fill:this.bottomFrame.color}));this.backFrame&&(this.backFrame.css({zIndex:0}),this.backFrame.front.attr({fill:this.backFrame.color}))})})(Highcharts);
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
Highcharts JS v4.0.1 (2014-04-24)
|
||||
|
||||
(c) 2009-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(m,C){function K(a,b,c){this.init.call(this,a,b,c)}var O=m.arrayMin,P=m.arrayMax,s=m.each,F=m.extend,o=m.merge,Q=m.map,q=m.pick,x=m.pInt,p=m.getOptions().plotOptions,h=m.seriesTypes,u=m.extendClass,L=m.splat,r=m.wrap,M=m.Axis,y=m.Tick,H=m.Point,R=m.Pointer,S=m.CenteredSeriesMixin,z=m.TrackerMixin,t=m.Series,v=Math,D=v.round,A=v.floor,T=v.max,U=m.Color,w=function(){};F(K.prototype,{init:function(a,b,c){var d=this,e=d.defaultOptions;d.chart=b;if(b.angular)e.background={};d.options=a=o(e,a);
|
||||
(a=a.background)&&s([].concat(L(a)).reverse(),function(a){var g=a.backgroundColor,a=o(d.defaultBackgroundOptions,a);if(g)a.backgroundColor=g;a.color=a.backgroundColor;c.options.plotBands.unshift(a)})},defaultOptions:{center:["50%","50%"],size:"85%",startAngle:0},defaultBackgroundOptions:{shape:"circle",borderWidth:1,borderColor:"silver",backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"#FFF"],[1,"#DDD"]]},from:Number.MIN_VALUE,innerRadius:0,to:Number.MAX_VALUE,outerRadius:"105%"}});
|
||||
var G=M.prototype,y=y.prototype,V={getOffset:w,redraw:function(){this.isDirty=!1},render:function(){this.isDirty=!1},setScale:w,setCategories:w,setTitle:w},N={isRadial:!0,defaultRadialGaugeOptions:{labels:{align:"center",x:0,y:null},minorGridLineWidth:0,minorTickInterval:"auto",minorTickLength:10,minorTickPosition:"inside",minorTickWidth:1,tickLength:10,tickPosition:"inside",tickWidth:2,title:{rotation:0},zIndex:2},defaultRadialXOptions:{gridLineWidth:1,labels:{align:null,distance:15,x:0,y:null},
|
||||
maxPadding:0,minPadding:0,showLastLabel:!1,tickLength:0},defaultRadialYOptions:{gridLineInterpolation:"circle",labels:{align:"right",x:-3,y:-2},showLastLabel:!1,title:{x:4,text:null,rotation:90}},setOptions:function(a){a=this.options=o(this.defaultOptions,this.defaultRadialOptions,a);if(!a.plotBands)a.plotBands=[]},getOffset:function(){G.getOffset.call(this);this.chart.axisOffset[this.side]=0;this.center=this.pane.center=S.getCenter.call(this.pane)},getLinePath:function(a,b){var c=this.center,b=q(b,
|
||||
c[2]/2-this.offset);return this.chart.renderer.symbols.arc(this.left+c[0],this.top+c[1],b,b,{start:this.startAngleRad,end:this.endAngleRad,open:!0,innerR:0})},setAxisTranslation:function(){G.setAxisTranslation.call(this);if(this.center)this.transA=this.isCircular?(this.endAngleRad-this.startAngleRad)/(this.max-this.min||1):this.center[2]/2/(this.max-this.min||1),this.minPixelPadding=this.isXAxis?this.transA*this.minPointOffset:0},beforeSetTickPositions:function(){this.autoConnect&&(this.max+=this.categories&&
|
||||
1||this.pointRange||this.closestPointRange||0)},setAxisSize:function(){G.setAxisSize.call(this);if(this.isRadial){this.center=this.pane.center=m.CenteredSeriesMixin.getCenter.call(this.pane);if(this.isCircular)this.sector=this.endAngleRad-this.startAngleRad;this.len=this.width=this.height=this.center[2]*q(this.sector,1)/2}},getPosition:function(a,b){return this.postTranslate(this.isCircular?this.translate(a):0,q(this.isCircular?b:this.translate(a),this.center[2]/2)-this.offset)},postTranslate:function(a,
|
||||
b){var c=this.chart,d=this.center,a=this.startAngleRad+a;return{x:c.plotLeft+d[0]+Math.cos(a)*b,y:c.plotTop+d[1]+Math.sin(a)*b}},getPlotBandPath:function(a,b,c){var d=this.center,e=this.startAngleRad,f=d[2]/2,g=[q(c.outerRadius,"100%"),c.innerRadius,q(c.thickness,10)],k=/%$/,l,n=this.isCircular;this.options.gridLineInterpolation==="polygon"?d=this.getPlotLinePath(a).concat(this.getPlotLinePath(b,!0)):(n||(g[0]=this.translate(a),g[1]=this.translate(b)),g=Q(g,function(a){k.test(a)&&(a=x(a,10)*f/100);
|
||||
return a}),c.shape==="circle"||!n?(a=-Math.PI/2,b=Math.PI*1.5,l=!0):(a=e+this.translate(a),b=e+this.translate(b)),d=this.chart.renderer.symbols.arc(this.left+d[0],this.top+d[1],g[0],g[0],{start:a,end:b,innerR:q(g[1],g[0]-g[2]),open:l}));return d},getPlotLinePath:function(a,b){var c=this,d=c.center,e=c.chart,f=c.getPosition(a),g,k,l;c.isCircular?l=["M",d[0]+e.plotLeft,d[1]+e.plotTop,"L",f.x,f.y]:c.options.gridLineInterpolation==="circle"?(a=c.translate(a))&&(l=c.getLinePath(0,a)):(s(e.xAxis,function(a){a.pane===
|
||||
c.pane&&(g=a)}),l=[],a=c.translate(a),d=g.tickPositions,g.autoConnect&&(d=d.concat([d[0]])),b&&(d=[].concat(d).reverse()),s(d,function(f,c){k=g.getPosition(f,a);l.push(c?"L":"M",k.x,k.y)}));return l},getTitlePosition:function(){var a=this.center,b=this.chart,c=this.options.title;return{x:b.plotLeft+a[0]+(c.x||0),y:b.plotTop+a[1]-{high:0.5,middle:0.25,low:0}[c.align]*a[2]+(c.y||0)}}};r(G,"init",function(a,b,c){var i;var d=b.angular,e=b.polar,f=c.isX,g=d&&f,k,l;l=b.options;var n=c.pane||0;if(d){if(F(this,
|
||||
g?V:N),k=!f)this.defaultRadialOptions=this.defaultRadialGaugeOptions}else if(e)F(this,N),this.defaultRadialOptions=(k=f)?this.defaultRadialXOptions:o(this.defaultYAxisOptions,this.defaultRadialYOptions);a.call(this,b,c);if(!g&&(d||e)){a=this.options;if(!b.panes)b.panes=[];this.pane=(i=b.panes[n]=b.panes[n]||new K(L(l.pane)[n],b,this),n=i);n=n.options;b.inverted=!1;l.chart.zoomType=null;this.startAngleRad=b=(n.startAngle-90)*Math.PI/180;this.endAngleRad=l=(q(n.endAngle,n.startAngle+360)-90)*Math.PI/
|
||||
180;this.offset=a.offset||0;if((this.isCircular=k)&&c.max===C&&l-b===2*Math.PI)this.autoConnect=!0}});r(y,"getPosition",function(a,b,c,d,e){var f=this.axis;return f.getPosition?f.getPosition(c):a.call(this,b,c,d,e)});r(y,"getLabelPosition",function(a,b,c,d,e,f,g,k,l){var n=this.axis,j=f.y,i=f.align,h=(n.translate(this.pos)+n.startAngleRad+Math.PI/2)/Math.PI*180%360;n.isRadial?(a=n.getPosition(this.pos,n.center[2]/2+q(f.distance,-25)),f.rotation==="auto"?d.attr({rotation:h}):j===null&&(j=n.chart.renderer.fontMetrics(d.styles.fontSize).b-
|
||||
d.getBBox().height/2),i===null&&(i=n.isCircular?h>20&&h<160?"left":h>200&&h<340?"right":"center":"center",d.attr({align:i})),a.x+=f.x,a.y+=j):a=a.call(this,b,c,d,e,f,g,k,l);return a});r(y,"getMarkPath",function(a,b,c,d,e,f,g){var k=this.axis;k.isRadial?(a=k.getPosition(this.pos,k.center[2]/2+d),b=["M",b,c,"L",a.x,a.y]):b=a.call(this,b,c,d,e,f,g);return b});p.arearange=o(p.area,{lineWidth:1,marker:null,threshold:null,tooltip:{pointFormat:'<span style="color:{series.color}">●</span> {series.name}: <b>{point.low}</b> - <b>{point.high}</b><br/>'},
|
||||
trackByArea:!0,dataLabels:{verticalAlign:null,xLow:0,xHigh:0,yLow:0,yHigh:0},states:{hover:{halo:!1}}});h.arearange=u(h.area,{type:"arearange",pointArrayMap:["low","high"],toYData:function(a){return[a.low,a.high]},pointValKey:"low",getSegments:function(){var a=this;s(a.points,function(b){if(!a.options.connectNulls&&(b.low===null||b.high===null))b.y=null;else if(b.low===null&&b.high!==null)b.y=b.high});t.prototype.getSegments.call(this)},translate:function(){var a=this.yAxis;h.area.prototype.translate.apply(this);
|
||||
s(this.points,function(b){var c=b.low,d=b.high,e=b.plotY;d===null&&c===null?b.y=null:c===null?(b.plotLow=b.plotY=null,b.plotHigh=a.translate(d,0,1,0,1)):d===null?(b.plotLow=e,b.plotHigh=null):(b.plotLow=e,b.plotHigh=a.translate(d,0,1,0,1))})},getSegmentPath:function(a){var b,c=[],d=a.length,e=t.prototype.getSegmentPath,f,g;g=this.options;var k=g.step;for(b=HighchartsAdapter.grep(a,function(a){return a.plotLow!==null});d--;)f=a[d],f.plotHigh!==null&&c.push({plotX:f.plotX,plotY:f.plotHigh});a=e.call(this,
|
||||
b);if(k)k===!0&&(k="left"),g.step={left:"right",center:"center",right:"left"}[k];c=e.call(this,c);g.step=k;g=[].concat(a,c);c[0]="L";this.areaPath=this.areaPath.concat(a,c);return g},drawDataLabels:function(){var a=this.data,b=a.length,c,d=[],e=t.prototype,f=this.options.dataLabels,g,k=this.chart.inverted;if(f.enabled||this._hasPointLabels){for(c=b;c--;)g=a[c],g.y=g.high,g._plotY=g.plotY,g.plotY=g.plotHigh,d[c]=g.dataLabel,g.dataLabel=g.dataLabelUpper,g.below=!1,k?(f.align="left",f.x=f.xHigh):f.y=
|
||||
f.yHigh;e.drawDataLabels&&e.drawDataLabels.apply(this,arguments);for(c=b;c--;)g=a[c],g.dataLabelUpper=g.dataLabel,g.dataLabel=d[c],g.y=g.low,g.plotY=g._plotY,g.below=!0,k?(f.align="right",f.x=f.xLow):f.y=f.yLow;e.drawDataLabels&&e.drawDataLabels.apply(this,arguments)}},alignDataLabel:function(){h.column.prototype.alignDataLabel.apply(this,arguments)},getSymbol:h.column.prototype.getSymbol,drawPoints:w});p.areasplinerange=o(p.arearange);h.areasplinerange=u(h.arearange,{type:"areasplinerange",getPointSpline:h.spline.prototype.getPointSpline});
|
||||
(function(){var a=h.column.prototype;p.columnrange=o(p.column,p.arearange,{lineWidth:1,pointRange:null});h.columnrange=u(h.arearange,{type:"columnrange",translate:function(){var b=this,c=b.yAxis,d;a.translate.apply(b);s(b.points,function(a){var f=a.shapeArgs,g=b.options.minPointLength,k;a.tooltipPos=null;a.plotHigh=d=c.translate(a.high,0,1,0,1);a.plotLow=a.plotY;k=d;a=a.plotY-d;a<g&&(g-=a,a+=g,k-=g/2);f.height=a;f.y=k})},trackerGroups:["group","dataLabels"],drawGraph:w,pointAttrToOptions:a.pointAttrToOptions,
|
||||
drawPoints:a.drawPoints,drawTracker:a.drawTracker,animate:a.animate,getColumnMetrics:a.getColumnMetrics})})();p.gauge=o(p.line,{dataLabels:{enabled:!0,defer:!1,y:15,borderWidth:1,borderColor:"silver",borderRadius:3,crop:!1,style:{fontWeight:"bold"},verticalAlign:"top",zIndex:2},dial:{},pivot:{},tooltip:{headerFormat:""},showInLegend:!1});z={type:"gauge",pointClass:u(H,{setState:function(a){this.state=a}}),angular:!0,drawGraph:w,fixedBox:!0,forceDL:!0,trackerGroups:["group","dataLabels"],translate:function(){var a=
|
||||
this.yAxis,b=this.options,c=a.center;this.generatePoints();s(this.points,function(d){var e=o(b.dial,d.dial),f=x(q(e.radius,80))*c[2]/200,g=x(q(e.baseLength,70))*f/100,k=x(q(e.rearLength,10))*f/100,l=e.baseWidth||3,n=e.topWidth||1,j=b.overshoot,i=a.startAngleRad+a.translate(d.y,null,null,null,!0);j&&typeof j==="number"?(j=j/180*Math.PI,i=Math.max(a.startAngleRad-j,Math.min(a.endAngleRad+j,i))):b.wrap===!1&&(i=Math.max(a.startAngleRad,Math.min(a.endAngleRad,i)));i=i*180/Math.PI;d.shapeType="path";d.shapeArgs=
|
||||
{d:e.path||["M",-k,-l/2,"L",g,-l/2,f,-n/2,f,n/2,g,l/2,-k,l/2,"z"],translateX:c[0],translateY:c[1],rotation:i};d.plotX=c[0];d.plotY=c[1]})},drawPoints:function(){var a=this,b=a.yAxis.center,c=a.pivot,d=a.options,e=d.pivot,f=a.chart.renderer;s(a.points,function(c){var b=c.graphic,l=c.shapeArgs,e=l.d,j=o(d.dial,c.dial);b?(b.animate(l),l.d=e):c.graphic=f[c.shapeType](l).attr({stroke:j.borderColor||"none","stroke-width":j.borderWidth||0,fill:j.backgroundColor||"black",rotation:l.rotation}).add(a.group)});
|
||||
c?c.animate({translateX:b[0],translateY:b[1]}):a.pivot=f.circle(0,0,q(e.radius,5)).attr({"stroke-width":e.borderWidth||0,stroke:e.borderColor||"silver",fill:e.backgroundColor||"black"}).translate(b[0],b[1]).add(a.group)},animate:function(a){var b=this;if(!a)s(b.points,function(a){var d=a.graphic;d&&(d.attr({rotation:b.yAxis.startAngleRad*180/Math.PI}),d.animate({rotation:a.shapeArgs.rotation},b.options.animation))}),b.animate=null},render:function(){this.group=this.plotGroup("group","series",this.visible?
|
||||
"visible":"hidden",this.options.zIndex,this.chart.seriesGroup);t.prototype.render.call(this);this.group.clip(this.chart.clipRect)},setData:function(a,b){t.prototype.setData.call(this,a,!1);this.processData();this.generatePoints();q(b,!0)&&this.chart.redraw()},drawTracker:z&&z.drawTrackerPoint};h.gauge=u(h.line,z);p.boxplot=o(p.column,{fillColor:"#FFFFFF",lineWidth:1,medianWidth:2,states:{hover:{brightness:-0.3}},threshold:null,tooltip:{pointFormat:'<span style="color:{series.color}">●</span> <b> {series.name}</b><br/>Maximum: {point.high}<br/>Upper quartile: {point.q3}<br/>Median: {point.median}<br/>Lower quartile: {point.q1}<br/>Minimum: {point.low}<br/>'},
|
||||
whiskerLength:"50%",whiskerWidth:2});h.boxplot=u(h.column,{type:"boxplot",pointArrayMap:["low","q1","median","q3","high"],toYData:function(a){return[a.low,a.q1,a.median,a.q3,a.high]},pointValKey:"high",pointAttrToOptions:{fill:"fillColor",stroke:"color","stroke-width":"lineWidth"},drawDataLabels:w,translate:function(){var a=this.yAxis,b=this.pointArrayMap;h.column.prototype.translate.apply(this);s(this.points,function(c){s(b,function(b){c[b]!==null&&(c[b+"Plot"]=a.translate(c[b],0,1,0,1))})})},drawPoints:function(){var a=
|
||||
this,b=a.points,c=a.options,d=a.chart.renderer,e,f,g,k,l,n,j,i,h,m,p,I,r,o,J,u,w,t,v,x,z,y,E=a.doQuartiles!==!1,B=parseInt(a.options.whiskerLength,10)/100;s(b,function(b){h=b.graphic;z=b.shapeArgs;p={};o={};u={};y=b.color||a.color;if(b.plotY!==C)if(e=b.pointAttr[b.selected?"selected":""],w=z.width,t=A(z.x),v=t+w,x=D(w/2),f=A(E?b.q1Plot:b.lowPlot),g=A(E?b.q3Plot:b.lowPlot),k=A(b.highPlot),l=A(b.lowPlot),p.stroke=b.stemColor||c.stemColor||y,p["stroke-width"]=q(b.stemWidth,c.stemWidth,c.lineWidth),p.dashstyle=
|
||||
b.stemDashStyle||c.stemDashStyle,o.stroke=b.whiskerColor||c.whiskerColor||y,o["stroke-width"]=q(b.whiskerWidth,c.whiskerWidth,c.lineWidth),u.stroke=b.medianColor||c.medianColor||y,u["stroke-width"]=q(b.medianWidth,c.medianWidth,c.lineWidth),u["stroke-linecap"]="round",j=p["stroke-width"]%2/2,i=t+x+j,m=["M",i,g,"L",i,k,"M",i,f,"L",i,l],E&&(j=e["stroke-width"]%2/2,i=A(i)+j,f=A(f)+j,g=A(g)+j,t+=j,v+=j,I=["M",t,g,"L",t,f,"L",v,f,"L",v,g,"L",t,g,"z"]),B&&(j=o["stroke-width"]%2/2,k+=j,l+=j,r=["M",i-x*B,
|
||||
k,"L",i+x*B,k,"M",i-x*B,l,"L",i+x*B,l]),j=u["stroke-width"]%2/2,n=D(b.medianPlot)+j,J=["M",t,n,"L",v,n],h)b.stem.animate({d:m}),B&&b.whiskers.animate({d:r}),E&&b.box.animate({d:I}),b.medianShape.animate({d:J});else{b.graphic=h=d.g().add(a.group);b.stem=d.path(m).attr(p).add(h);if(B)b.whiskers=d.path(r).attr(o).add(h);if(E)b.box=d.path(I).attr(e).add(h);b.medianShape=d.path(J).attr(u).add(h)}})}});p.errorbar=o(p.boxplot,{color:"#000000",grouping:!1,linkedTo:":previous",tooltip:{pointFormat:'<span style="color:{series.color}">●</span> {series.name}: <b>{point.low}</b> - <b>{point.high}</b><br/>'},
|
||||
whiskerWidth:null});h.errorbar=u(h.boxplot,{type:"errorbar",pointArrayMap:["low","high"],toYData:function(a){return[a.low,a.high]},pointValKey:"high",doQuartiles:!1,drawDataLabels:h.arearange?h.arearange.prototype.drawDataLabels:w,getColumnMetrics:function(){return this.linkedParent&&this.linkedParent.columnMetrics||h.column.prototype.getColumnMetrics.call(this)}});p.waterfall=o(p.column,{lineWidth:1,lineColor:"#333",dashStyle:"dot",borderColor:"#333"});h.waterfall=u(h.column,{type:"waterfall",upColorProp:"fill",
|
||||
pointArrayMap:["low","y"],pointValKey:"y",init:function(a,b){b.stacking=!0;h.column.prototype.init.call(this,a,b)},translate:function(){var a=this.yAxis,b,c,d,e,f,g,k,l,n;b=this.options.threshold;h.column.prototype.translate.apply(this);l=b;d=this.points;for(c=0,b=d.length;c<b;c++){e=d[c];f=e.shapeArgs;g=this.getStack(c);n=g.points[this.index+","+c];if(isNaN(e.y))e.y=this.yData[c];k=T(l,l+e.y)+n[0];f.y=a.translate(k,0,1);e.isSum||e.isIntermediateSum?(f.y=a.translate(n[1],0,1),f.height=a.translate(n[0],
|
||||
0,1)-f.y):l+=g.total;f.height<0&&(f.y+=f.height,f.height*=-1);e.plotY=f.y=D(f.y)-this.borderWidth%2/2;f.height=D(f.height);e.yBottom=f.y+f.height}},processData:function(a){var b=this.yData,c=this.points,d,e=b.length,f=this.options.threshold||0,g,k,l,n,j,i;k=g=l=n=f;for(i=0;i<e;i++)j=b[i],d=c&&c[i]?c[i]:{},j==="sum"||d.isSum?b[i]=k:j==="intermediateSum"||d.isIntermediateSum?(b[i]=g,g=f):(k+=j,g+=j),l=Math.min(k,l),n=Math.max(k,n);t.prototype.processData.call(this,a);this.dataMin=l;this.dataMax=n},
|
||||
toYData:function(a){if(a.isSum)return"sum";else if(a.isIntermediateSum)return"intermediateSum";return a.y},getAttribs:function(){h.column.prototype.getAttribs.apply(this,arguments);var a=this.options,b=a.states,c=a.upColor||this.color,a=m.Color(c).brighten(0.1).get(),d=o(this.pointAttr),e=this.upColorProp;d[""][e]=c;d.hover[e]=b.hover.upColor||a;d.select[e]=b.select.upColor||c;s(this.points,function(a){if(a.y>0&&!a.color)a.pointAttr=d,a.color=c})},getGraphPath:function(){var a=this.data,b=a.length,
|
||||
c=D(this.options.lineWidth+this.borderWidth)%2/2,d=[],e,f,g;for(g=1;g<b;g++)f=a[g].shapeArgs,e=a[g-1].shapeArgs,f=["M",e.x+e.width,e.y+c,"L",f.x,e.y+c],a[g-1].y<0&&(f[2]+=e.height,f[5]+=e.height),d=d.concat(f);return d},getExtremes:w,getStack:function(a){var b=this.yAxis.stacks,c=this.stackKey;this.processedYData[a]<this.options.threshold&&(c="-"+c);return b[c][a]},drawGraph:t.prototype.drawGraph});p.bubble=o(p.scatter,{dataLabels:{format:"{point.z}",inside:!0,style:{color:"white",textShadow:"0px 0px 3px black"},
|
||||
verticalAlign:"middle"},marker:{lineColor:null,lineWidth:1},minSize:8,maxSize:"20%",states:{hover:{halo:{size:5}}},tooltip:{pointFormat:"({point.x}, {point.y}), Size: {point.z}"},turboThreshold:0,zThreshold:0});z=u(H,{haloPath:function(){return H.prototype.haloPath.call(this,this.shapeArgs.r+this.series.options.states.hover.halo.size)}});h.bubble=u(h.scatter,{type:"bubble",pointClass:z,pointArrayMap:["y","z"],parallelArrays:["x","y","z"],trackerGroups:["group","dataLabelsGroup"],bubblePadding:!0,
|
||||
pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor"},applyOpacity:function(a){var b=this.options.marker,c=q(b.fillOpacity,0.5),a=a||b.fillColor||this.color;c!==1&&(a=U(a).setOpacity(c).get("rgba"));return a},convertAttribs:function(){var a=t.prototype.convertAttribs.apply(this,arguments);a.fill=this.applyOpacity(a.fill);return a},getRadii:function(a,b,c,d){var e,f,g,k=this.zData,l=[],n=this.options.sizeBy!=="width";for(f=0,e=k.length;f<e;f++)g=b-a,g=g>0?(k[f]-a)/(b-
|
||||
a):0.5,n&&g>=0&&(g=Math.sqrt(g)),l.push(v.ceil(c+g*(d-c))/2);this.radii=l},animate:function(a){var b=this.options.animation;if(!a)s(this.points,function(a){var d=a.graphic,a=a.shapeArgs;d&&a&&(d.attr("r",1),d.animate({r:a.r},b))}),this.animate=null},translate:function(){var a,b=this.data,c,d,e=this.radii;h.scatter.prototype.translate.call(this);for(a=b.length;a--;)c=b[a],d=e?e[a]:0,c.negative=c.z<(this.options.zThreshold||0),d>=this.minPxSize/2?(c.shapeType="circle",c.shapeArgs={x:c.plotX,y:c.plotY,
|
||||
r:d},c.dlBox={x:c.plotX-d,y:c.plotY-d,width:2*d,height:2*d}):c.shapeArgs=c.plotY=c.dlBox=C},drawLegendSymbol:function(a,b){var c=x(a.itemStyle.fontSize)/2;b.legendSymbol=this.chart.renderer.circle(c,a.baseline-c,c).attr({zIndex:3}).add(b.legendGroup);b.legendSymbol.isMarker=!0},drawPoints:h.column.prototype.drawPoints,alignDataLabel:h.column.prototype.alignDataLabel});M.prototype.beforePadding=function(){var a=this,b=this.len,c=this.chart,d=0,e=b,f=this.isXAxis,g=f?"xData":"yData",k=this.min,l={},
|
||||
n=v.min(c.plotWidth,c.plotHeight),j=Number.MAX_VALUE,i=-Number.MAX_VALUE,h=this.max-k,m=b/h,p=[];this.tickPositions&&(s(this.series,function(b){var g=b.options;if(b.bubblePadding&&(b.visible||!c.options.chart.ignoreHiddenSeries))if(a.allowZoomOutside=!0,p.push(b),f)s(["minSize","maxSize"],function(a){var b=g[a],f=/%$/.test(b),b=x(b);l[a]=f?n*b/100:b}),b.minPxSize=l.minSize,b=b.zData,b.length&&(j=v.min(j,v.max(O(b),g.displayNegative===!1?g.zThreshold:-Number.MAX_VALUE)),i=v.max(i,P(b)))}),s(p,function(a){var b=
|
||||
a[g],c=b.length,n;f&&a.getRadii(j,i,l.minSize,l.maxSize);if(h>0)for(;c--;)typeof b[c]==="number"&&(n=a.radii[c],d=Math.min((b[c]-k)*m-n,d),e=Math.max((b[c]-k)*m+n,e))}),p.length&&h>0&&q(this.options.min,this.userMin)===C&&q(this.options.max,this.userMax)===C&&(e-=b,m*=(b+d-e)/b,this.min+=d/m,this.max+=e/m))};(function(){function a(a,b,c){a.call(this,b,c);if(this.chart.polar)this.closeSegment=function(a){var b=this.xAxis.center;a.push("L",b[0],b[1])},this.closedStacks=!0}function b(a,b){var c=this.chart,
|
||||
d=this.options.animation,e=this.group,j=this.markerGroup,i=this.xAxis.center,h=c.plotLeft,m=c.plotTop;if(c.polar){if(c.renderer.isSVG)d===!0&&(d={}),b?(c={translateX:i[0]+h,translateY:i[1]+m,scaleX:0.001,scaleY:0.001},e.attr(c),j&&j.attr(c)):(c={translateX:h,translateY:m,scaleX:1,scaleY:1},e.animate(c,d),j&&j.animate(c,d),this.animate=null)}else a.call(this,b)}var c=t.prototype,d=R.prototype,e;c.toXY=function(a){var b,c=this.chart,d=a.plotX;b=a.plotY;a.rectPlotX=d;a.rectPlotY=b;d=(d/Math.PI*180+this.xAxis.pane.options.startAngle)%
|
||||
360;d<0&&(d+=360);a.clientX=d;b=this.xAxis.postTranslate(a.plotX,this.yAxis.len-b);a.plotX=a.polarPlotX=b.x-c.plotLeft;a.plotY=a.polarPlotY=b.y-c.plotTop};c.orderTooltipPoints=function(a){if(this.chart.polar&&(a.sort(function(a,b){return a.clientX-b.clientX}),a[0]))a[0].wrappedClientX=a[0].clientX+360,a.push(a[0])};h.area&&r(h.area.prototype,"init",a);h.areaspline&&r(h.areaspline.prototype,"init",a);h.spline&&r(h.spline.prototype,"getPointSpline",function(a,b,c,d){var e,j,i,h,m,p,o;if(this.chart.polar){e=
|
||||
c.plotX;j=c.plotY;a=b[d-1];i=b[d+1];this.connectEnds&&(a||(a=b[b.length-2]),i||(i=b[1]));if(a&&i)h=a.plotX,m=a.plotY,b=i.plotX,p=i.plotY,h=(1.5*e+h)/2.5,m=(1.5*j+m)/2.5,i=(1.5*e+b)/2.5,o=(1.5*j+p)/2.5,b=Math.sqrt(Math.pow(h-e,2)+Math.pow(m-j,2)),p=Math.sqrt(Math.pow(i-e,2)+Math.pow(o-j,2)),h=Math.atan2(m-j,h-e),m=Math.atan2(o-j,i-e),o=Math.PI/2+(h+m)/2,Math.abs(h-o)>Math.PI/2&&(o-=Math.PI),h=e+Math.cos(o)*b,m=j+Math.sin(o)*b,i=e+Math.cos(Math.PI+o)*p,o=j+Math.sin(Math.PI+o)*p,c.rightContX=i,c.rightContY=
|
||||
o;d?(c=["C",a.rightContX||a.plotX,a.rightContY||a.plotY,h||e,m||j,e,j],a.rightContX=a.rightContY=null):c=["M",e,j]}else c=a.call(this,b,c,d);return c});r(c,"translate",function(a){a.call(this);if(this.chart.polar&&!this.preventPostTranslate)for(var a=this.points,b=a.length;b--;)this.toXY(a[b])});r(c,"getSegmentPath",function(a,b){var c=this.points;if(this.chart.polar&&this.options.connectEnds!==!1&&b[b.length-1]===c[c.length-1]&&c[0].y!==null)this.connectEnds=!0,b=[].concat(b,[c[0]]);return a.call(this,
|
||||
b)});r(c,"animate",b);r(c,"setTooltipPoints",function(a,b){this.chart.polar&&F(this.xAxis,{tooltipLen:360});return a.call(this,b)});if(h.column)e=h.column.prototype,r(e,"animate",b),r(e,"translate",function(a){var b=this.xAxis,c=this.yAxis.len,d=b.center,e=b.startAngleRad,h=this.chart.renderer,i,m;this.preventPostTranslate=!0;a.call(this);if(b.isRadial){b=this.points;for(m=b.length;m--;)i=b[m],a=i.barX+e,i.shapeType="path",i.shapeArgs={d:h.symbols.arc(d[0],d[1],c-i.plotY,null,{start:a,end:a+i.pointWidth,
|
||||
innerR:c-q(i.yBottom,c)})},this.toXY(i),i.tooltipPos=[i.plotX,i.plotY],i.ttBelow=i.plotY>d[1]}}),r(e,"alignDataLabel",function(a,b,d,e,h,j){if(this.chart.polar){a=b.rectPlotX/Math.PI*180;if(e.align===null)e.align=a>20&&a<160?"left":a>200&&a<340?"right":"center";if(e.verticalAlign===null)e.verticalAlign=a<45||a>315?"bottom":a>135&&a<225?"top":"middle";c.alignDataLabel.call(this,b,d,e,h,j)}else a.call(this,b,d,e,h,j)});r(d,"getIndex",function(a,b){var c,d=this.chart,e;d.polar?(e=d.xAxis[0].center,c=
|
||||
b.chartX-e[0]-d.plotLeft,d=b.chartY-e[1]-d.plotTop,c=180-Math.round(Math.atan2(c,d)/Math.PI*180)):c=a.call(this,b);return c});r(d,"getCoordinates",function(a,b){var c=this.chart,d={xAxis:[],yAxis:[]};c.polar?s(c.axes,function(a){var e=a.isXAxis,f=a.center,h=b.chartX-f[0]-c.plotLeft,f=b.chartY-f[1]-c.plotTop;d[e?"xAxis":"yAxis"].push({axis:a,value:a.translate(e?Math.PI-Math.atan2(h,f):Math.sqrt(Math.pow(h,2)+Math.pow(f,2)),!0)})}):d=a.call(this,b);return d})})()})(Highcharts);
|
|
@ -0,0 +1,383 @@
|
|||
/*
|
||||
Highstock JS v2.0.1 (2014-04-24)
|
||||
|
||||
(c) 2009-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(){function v(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function y(){var a,b=arguments,c,d={},e=function(a,b){var c,d;typeof a!=="object"&&(a={});for(d in b)b.hasOwnProperty(d)&&(c=b[d],a[d]=c&&typeof c==="object"&&Object.prototype.toString.call(c)!=="[object Array]"&&d!=="renderTo"&&typeof c.nodeType!=="number"?e(a[d]||{},c):b[d]);return a};b[0]===!0&&(d=b[1],b=Array.prototype.slice.call(b,2));c=b.length;for(a=0;a<c;a++)d=e(d,b[a]);return d}function Kb(){for(var a=0,b=arguments,
|
||||
c=b.length,d={};a<c;a++)d[b[a++]]=b[a];return d}function I(a,b){return parseInt(a,b||10)}function Oa(a){return typeof a==="string"}function fa(a){return typeof a==="object"}function Pa(a){return Object.prototype.toString.call(a)==="[object Array]"}function la(a){return typeof a==="number"}function Ga(a){return V.log(a)/V.LN10}function oa(a){return V.pow(10,a)}function pa(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function t(a){return a!==r&&a!==null}function W(a,b,c){var d,e;if(Oa(b))t(c)?
|
||||
a.setAttribute(b,c):a&&a.getAttribute&&(e=a.getAttribute(b));else if(t(b)&&fa(b))for(d in b)a.setAttribute(d,b[d]);return e}function ma(a){return Pa(a)?a:[a]}function o(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++)if(c=a[b],typeof c!=="undefined"&&c!==null)return c}function E(a,b){if(Ha&&!ca&&b&&b.opacity!==r)b.filter="alpha(opacity="+b.opacity*100+")";v(a.style,b)}function $(a,b,c,d,e){a=B.createElement(a);b&&v(a,b);e&&E(a,{padding:0,border:Y,margin:0});c&&E(a,c);d&&d.appendChild(a);return a}
|
||||
function ga(a,b){var c=function(){};c.prototype=new a;v(c.prototype,b);return c}function Ia(a,b,c,d){var e=F.lang,a=+a||0,f=b===-1?(a.toString().split(".")[1]||"").length:isNaN(b=M(b))?2:b,b=c===void 0?e.decimalPoint:c,d=d===void 0?e.thousandsSep:d,e=a<0?"-":"",c=String(I(a=M(a).toFixed(f))),g=c.length>3?c.length%3:0;return e+(g?c.substr(0,g)+d:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?b+M(a-c).toFixed(f).slice(2):"")}function Qa(a,b){return Array((b||2)+1-String(a).length).join(0)+a}function O(a,
|
||||
b,c){var d=a[b];a[b]=function(){var a=Array.prototype.slice.call(arguments);a.unshift(d);return c.apply(this,a)}}function Ja(a,b){for(var c="{",d=!1,e,f,g,h,i,k=[];(c=a.indexOf(c))!==-1;){e=a.slice(0,c);if(d){f=e.split(":");g=f.shift().split(".");i=g.length;e=b;for(h=0;h<i;h++)e=e[g[h]];if(f.length)f=f.join(":"),g=/\.([0-9])/,h=F.lang,i=void 0,/f$/.test(f)?(i=(i=f.match(g))?i[1]:-1,e!==null&&(e=Ia(e,i,h.decimalPoint,f.indexOf(",")>-1?h.thousandsSep:""))):e=ua(f,e)}k.push(e);a=a.slice(c+1);c=(d=!d)?
|
||||
"}":"{"}k.push(a);return k.join("")}function rb(a){return V.pow(10,S(V.log(a)/V.LN10))}function sb(a,b,c,d){var e,c=o(c,1);e=a/c;b||(b=[1,2,2.5,5,10],d&&d.allowDecimals===!1&&(c===1?b=[1,2,5,10]:c<=0.1&&(b=[1/c])));for(d=0;d<b.length;d++)if(a=b[d],e<=(b[d]+(b[d+1]||b[d]))/2)break;a*=c;return a}function Lb(){this.symbol=this.color=0}function tb(a,b){var c=a.length,d,e;for(e=0;e<c;e++)a[e].ss_i=e;a.sort(function(a,c){d=b(a,c);return d===0?a.ss_i-c.ss_i:d});for(e=0;e<c;e++)delete a[e].ss_i}function Ra(a){for(var b=
|
||||
a.length,c=a[0];b--;)a[b]<c&&(c=a[b]);return c}function Ba(a){for(var b=a.length,c=a[0];b--;)a[b]>c&&(c=a[b]);return c}function Ka(a,b){for(var c in a)a[c]&&a[c]!==b&&a[c].destroy&&a[c].destroy(),delete a[c]}function Sa(a){hb||(hb=$(Ta));a&&hb.appendChild(a);hb.innerHTML=""}function qa(a,b){var c="Highcharts error #"+a+": www.highcharts.com/errors/"+a;if(b)throw c;else X.console&&console.log(c)}function ha(a){return parseFloat(a.toPrecision(14))}function Ya(a,b){Ca=o(a,b.animation)}function Mb(){var a=
|
||||
F.global.useUTC,b=a?"getUTC":"get",c=a?"setUTC":"set";La=(a&&F.global.timezoneOffset||0)*6E4;ib=a?Date.UTC:function(a,b,c,g,h,i){return(new Date(a,b,o(c,1),o(g,0),o(h,0),o(i,0))).getTime()};ub=b+"Minutes";vb=b+"Hours";wb=b+"Day";Ua=b+"Date";jb=b+"Month";kb=b+"FullYear";Nb=c+"Minutes";Ob=c+"Hours";xb=c+"Date";Pb=c+"Month";Qb=c+"FullYear"}function Z(){}function Za(a,b,c,d){this.axis=a;this.pos=b;this.type=c||"";this.isNew=!0;!c&&!d&&this.addLabel()}function L(){this.init.apply(this,arguments)}function va(){this.init.apply(this,
|
||||
arguments)}function Rb(a,b,c,d,e){var f=a.chart.inverted;this.axis=a;this.isNegative=c;this.options=b;this.x=d;this.total=null;this.points={};this.stack=e;this.alignOptions={align:b.align||(f?c?"left":"right":"center"),verticalAlign:b.verticalAlign||(f?"middle":c?"bottom":"top"),y:o(b.y,f?4:c?14:-6),x:o(b.x,f?c?-6:6:0)};this.textAlign=b.textAlign||(f?c?"right":"left":"center")}function yb(a){var b=a.options,c=b.navigator,d=c.enabled,b=b.scrollbar,e=b.enabled,f=d?c.height:0,g=e?b.height:0;this.handles=
|
||||
[];this.scrollbarButtons=[];this.elementsToDestroy=[];this.chart=a;this.setBaseSeries();this.height=f;this.scrollbarHeight=g;this.scrollbarEnabled=e;this.navigatorEnabled=d;this.navigatorOptions=c;this.scrollbarOptions=b;this.outlineHeight=f+g;this.init()}function zb(a){this.init(a)}var r,B=document,X=window,V=Math,s=V.round,S=V.floor,Va=V.ceil,w=V.max,z=V.min,M=V.abs,da=V.cos,ia=V.sin,ra=V.PI,Ma=ra*2/360,Da=navigator.userAgent,Sb=X.opera,Ha=/msie/i.test(Da)&&!Sb,lb=B.documentMode===8,mb=/AppleWebKit/.test(Da),
|
||||
$a=/Firefox/.test(Da),cb=/(Mobile|Android|Windows Phone)/.test(Da),Ea="http://www.w3.org/2000/svg",ca=!!B.createElementNS&&!!B.createElementNS(Ea,"svg").createSVGRect,Yb=$a&&parseInt(Da.split("Firefox/")[1],10)<4,ja=!ca&&!Ha&&!!B.createElement("canvas").getContext,Wa,ab,Tb={},Ab=0,hb,F,ua,Ca,Bb,H,na=function(){},aa=[],db=0,Ta="div",Y="none",Zb=/^[0-9]+$/,$b="stroke-width",ib,La,ub,vb,wb,Ua,jb,kb,Nb,Ob,xb,Pb,Qb,C={},P=X.Highcharts=X.Highcharts?qa(16,!0):{};ua=function(a,b,c){if(!t(b)||isNaN(b))return"Invalid date";
|
||||
var a=o(a,"%Y-%m-%d %H:%M:%S"),d=new Date(b-La),e,f=d[vb](),g=d[wb](),h=d[Ua](),i=d[jb](),k=d[kb](),j=F.lang,l=j.weekdays,d=v({a:l[g].substr(0,3),A:l[g],d:Qa(h),e:h,b:j.shortMonths[i],B:j.months[i],m:Qa(i+1),y:k.toString().substr(2,2),Y:k,H:Qa(f),I:Qa(f%12||12),l:f%12||12,M:Qa(d[ub]()),p:f<12?"AM":"PM",P:f<12?"am":"pm",S:Qa(d.getSeconds()),L:Qa(s(b%1E3),3)},P.dateFormats);for(e in d)for(;a.indexOf("%"+e)!==-1;)a=a.replace("%"+e,typeof d[e]==="function"?d[e](b):d[e]);return c?a.substr(0,1).toUpperCase()+
|
||||
a.substr(1):a};Lb.prototype={wrapColor:function(a){if(this.color>=a)this.color=0},wrapSymbol:function(a){if(this.symbol>=a)this.symbol=0}};H=Kb("millisecond",1,"second",1E3,"minute",6E4,"hour",36E5,"day",864E5,"week",6048E5,"month",26784E5,"year",31556952E3);Bb={init:function(a,b,c){var b=b||"",d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,g,b=b.split(" "),c=[].concat(c),h,i,k=function(a){for(g=a.length;g--;)a[g]==="M"&&a.splice(g+1,0,a[g+1],a[g+2],a[g+1],a[g+2])};e&&(k(b),k(c));a.isArea&&(h=b.splice(b.length-
|
||||
6,6),i=c.splice(c.length-6,6));if(d<=c.length/f&&b.length===c.length)for(;d--;)c=[].concat(c).splice(0,f).concat(c);a.shift=0;if(b.length)for(a=c.length;b.length<a;)d=[].concat(b).splice(b.length-f,f),e&&(d[f-6]=d[f-2],d[f-5]=d[f-1]),b=b.concat(d);h&&(b=b.concat(h),c=c.concat(i));return[b,c]},step:function(a,b,c,d){var e=[],f=a.length;if(c===1)e=d;else if(f===b.length&&c<1)for(;f--;)d=parseFloat(a[f]),e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d;else e=b;return e}};(function(a){X.HighchartsAdapter=X.HighchartsAdapter||
|
||||
a&&{init:function(b){var c=a.fx,d=c.step,e,f=a.Tween,g=f&&f.propHooks;e=a.cssHooks.opacity;a.extend(a.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}});a.each(["cur","_default","width","height","opacity"],function(a,b){var e=d,j;b==="cur"?e=c.prototype:b==="_default"&&f&&(e=g[b],b="set");(j=e[b])&&(e[b]=function(c){var d,c=a?c:this;if(c.prop!=="align")return d=c.elem,d.attr?d.attr(c.prop,b==="cur"?r:c.now):j.apply(this,arguments)})});O(e,"get",function(a,b,c){return b.attr?b.opacity||
|
||||
0:a.call(this,b,c)});e=function(a){var c=a.elem,d;if(!a.started)d=b.init(c,c.d,c.toD),a.start=d[0],a.end=d[1],a.started=!0;c.attr("d",b.step(a.start,a.end,a.pos,c.toD))};f?g.d={set:e}:d.d=e;this.each=Array.prototype.forEach?function(a,b){return Array.prototype.forEach.call(a,b)}:function(a,b){for(var c=0,d=a.length;c<d;c++)if(b.call(a[c],a[c],c,a)===!1)return c};a.fn.highcharts=function(){var a="Chart",b=arguments,c,d;if(this[0]){Oa(b[0])&&(a=b[0],b=Array.prototype.slice.call(b,1));c=b[0];if(c!==
|
||||
r)c.chart=c.chart||{},c.chart.renderTo=this[0],new P[a](c,b[1]),d=this;c===r&&(d=aa[W(this[0],"data-highcharts-chart")])}return d}},getScript:a.getScript,inArray:a.inArray,adapterRun:function(b,c){return a(b)[c]()},grep:a.grep,map:function(a,c){for(var d=[],e=0,f=a.length;e<f;e++)d[e]=c.call(a[e],a[e],e,a);return d},offset:function(b){return a(b).offset()},addEvent:function(b,c,d){a(b).bind(c,d)},removeEvent:function(b,c,d){var e=B.removeEventListener?"removeEventListener":"detachEvent";B[e]&&b&&
|
||||
!b[e]&&(b[e]=function(){});a(b).unbind(c,d)},fireEvent:function(b,c,d,e){var f=a.Event(c),g="detached"+c,h;!Ha&&d&&(delete d.layerX,delete d.layerY,delete d.returnValue);v(f,d);b[c]&&(b[g]=b[c],b[c]=null);a.each(["preventDefault","stopPropagation"],function(a,b){var c=f[b];f[b]=function(){try{c.call(f)}catch(a){b==="preventDefault"&&(h=!0)}}});a(b).trigger(f);b[g]&&(b[c]=b[g],b[g]=null);e&&!f.isDefaultPrevented()&&!h&&e(f)},washMouseEvent:function(a){var c=a.originalEvent||a;if(c.pageX===r)c.pageX=
|
||||
a.pageX,c.pageY=a.pageY;return c},animate:function(b,c,d){var e=a(b);if(!b.style)b.style={};if(c.d)b.toD=c.d,c.d=1;e.stop();c.opacity!==r&&b.attr&&(c.opacity+="px");e.animate(c,d)},stop:function(b){a(b).stop()}}})(X.jQuery);var J=X.HighchartsAdapter,Q=J||{};J&&J.init.call(J,Bb);var nb=Q.adapterRun,ac=Q.getScript,wa=Q.inArray,q=Q.each,Cb=Q.grep,bc=Q.offset,xa=Q.map,A=Q.addEvent,R=Q.removeEvent,N=Q.fireEvent,cc=Q.washMouseEvent,ob=Q.animate,eb=Q.stop,Q={enabled:!0,x:0,y:15,style:{color:"#606060",cursor:"default",
|
||||
fontSize:"11px"}};F={colors:"#7cb5ec,#434348,#90ed7d,#f7a35c,#8085e9,#f15c80,#e4d354,#8085e8,#8d4653,#91e8e1".split(","),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),shortMonths:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),decimalPoint:".",numericSymbols:"k,M,G,T,P,E".split(","),
|
||||
resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:!0,canvasToolsURL:"http://code.highcharts.com/stock/2.0.1/modules/canvas-tools.js",VMLRadialGradientURL:"http://code.highcharts.com/stock/2.0.1/gfx/vml-radial-gradient.png"},chart:{borderColor:"#4572A7",borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0",resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}}},
|
||||
title:{text:"Chart title",align:"center",margin:15,style:{color:"#333333",fontSize:"18px"}},subtitle:{text:"",align:"center",style:{color:"#555555"}},plotOptions:{line:{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},lineWidth:2,marker:{lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{enabled:!0},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:y(Q,{align:"center",enabled:!1,formatter:function(){return this.y===null?"":Ia(this.y,
|
||||
-1)},verticalAlign:"bottom",y:0}),cropThreshold:300,pointRange:0,states:{hover:{marker:{},halo:{size:10,opacity:0.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1E3}},labels:{style:{position:"absolute",color:"#3E576F"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#909090",borderRadius:0,navigation:{activeColor:"#274b6d",inactiveColor:"#CCC"},shadow:!1,itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},itemHoverStyle:{color:"#000"},
|
||||
itemHiddenStyle:{color:"#CCC"},itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"1em"},style:{position:"absolute",backgroundColor:"white",opacity:0.5,textAlign:"center"}},tooltip:{enabled:!0,animation:ca,backgroundColor:"rgba(249, 249, 249, .85)",borderWidth:1,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",
|
||||
minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{series.color}">●</span> {series.name}: <b>{point.y}</b><br/>',shadow:!0,snap:cb?25:10,style:{color:"#333333",cursor:"default",fontSize:"12px",padding:"8px",whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",
|
||||
x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"9px"}}};var T=F.plotOptions,J=T.line;Mb();var dc=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,ec=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,fc=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,Fa=function(a){var b=[],c,d;(function(a){a&&a.stops?d=xa(a.stops,function(a){return Fa(a[1])}):(c=dc.exec(a))?b=[I(c[1]),I(c[2]),I(c[3]),parseFloat(c[4],
|
||||
10)]:(c=ec.exec(a))?b=[I(c[1],16),I(c[2],16),I(c[3],16),1]:(c=fc.exec(a))&&(b=[I(c[1]),I(c[2]),I(c[3]),1])})(a);return{get:function(c){var f;d?(f=y(a),f.stops=[].concat(f.stops),q(d,function(a,b){f.stops[b]=[f.stops[b][0],a.get(c)]})):f=b&&!isNaN(b[0])?c==="rgb"?"rgb("+b[0]+","+b[1]+","+b[2]+")":c==="a"?b[3]:"rgba("+b.join(",")+")":a;return f},brighten:function(a){if(d)q(d,function(b){b.brighten(a)});else if(la(a)&&a!==0){var c;for(c=0;c<3;c++)b[c]+=I(a*255),b[c]<0&&(b[c]=0),b[c]>255&&(b[c]=255)}return this},
|
||||
rgba:b,setOpacity:function(a){b[3]=a;return this}}};Z.prototype={init:function(a,b){this.element=b==="span"?$(b):B.createElementNS(Ea,b);this.renderer=a},opacity:1,animate:function(a,b,c){b=o(b,Ca,!0);eb(this);if(b){b=y(b,{});if(c)b.complete=c;ob(this,a,b)}else this.attr(a),c&&c()},colorGradient:function(a,b,c){var d=this.renderer,e,f,g,h,i,k,j,l,m,n,p=[];a.linearGradient?f="linearGradient":a.radialGradient&&(f="radialGradient");if(f){g=a[f];h=d.gradients;k=a.stops;m=c.radialReference;Pa(g)&&(a[f]=
|
||||
g={x1:g[0],y1:g[1],x2:g[2],y2:g[3],gradientUnits:"userSpaceOnUse"});f==="radialGradient"&&m&&!t(g.gradientUnits)&&(g=y(g,{cx:m[0]-m[2]/2+g.cx*m[2],cy:m[1]-m[2]/2+g.cy*m[2],r:g.r*m[2],gradientUnits:"userSpaceOnUse"}));for(n in g)n!=="id"&&p.push(n,g[n]);for(n in k)p.push(k[n]);p=p.join(",");h[p]?a=h[p].attr("id"):(g.id=a="highcharts-"+Ab++,h[p]=i=d.createElement(f).attr(g).add(d.defs),i.stops=[],q(k,function(a){a[1].indexOf("rgba")===0?(e=Fa(a[1]),j=e.get("rgb"),l=e.get("a")):(j=a[1],l=1);a=d.createElement("stop").attr({offset:a[0],
|
||||
"stop-color":j,"stop-opacity":l}).add(i);i.stops.push(a)}));c.setAttribute(b,"url("+d.url+"#"+a+")")}},attr:function(a,b){var c,d,e=this.element,f,g=this,h;typeof a==="string"&&b!==r&&(c=a,a={},a[c]=b);if(typeof a==="string")g=(this[a+"Getter"]||this._defaultGetter).call(this,a,e);else{for(c in a){d=a[c];h=!1;this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(c)&&(f||(this.symbolAttr(a),f=!0),h=!0);if(this.rotation&&(c==="x"||c==="y"))this.doTransform=!0;h||(this[c+"Setter"]||
|
||||
this._defaultSetter).call(this,d,c,e);this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(c)&&this.updateShadows(c,d)}if(this.doTransform)this.updateTransform(),this.doTransform=!1}return g},updateShadows:function(a,b){for(var c=this.shadows,d=c.length;d--;)c[d].setAttribute(a,a==="height"?w(b-(c[d].cutHeight||0),0):a==="d"?this.d:b)},addClass:function(a){var b=this.element,c=W(b,"class")||"";c.indexOf(a)===-1&&W(b,"class",c+" "+a);return this},symbolAttr:function(a){var b=this;
|
||||
q("x,y,r,start,end,width,height,innerR,anchorX,anchorY".split(","),function(c){b[c]=o(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](b.x,b.y,b.width,b.height,b)})},clip:function(a){return this.attr("clip-path",a?"url("+this.renderer.url+"#"+a.id+")":Y)},crisp:function(a){var b,c={},d,e=a.strokeWidth||this.strokeWidth||this.attr&&this.attr("stroke-width")||0;d=s(e)%2/2;a.x=S(a.x||this.x||0)+d;a.y=S(a.y||this.y||0)+d;a.width=S((a.width||this.width||0)-2*d);a.height=S((a.height||this.height||
|
||||
0)-2*d);a.strokeWidth=e;for(b in a)this[b]!==a[b]&&(this[b]=c[b]=a[b]);return c},css:function(a){var b=this.styles,c={},d=this.element,e,f,g="";e=!b;if(a&&a.color)a.fill=a.color;if(b)for(f in a)a[f]!==b[f]&&(c[f]=a[f],e=!0);if(e){e=this.textWidth=a&&a.width&&d.nodeName.toLowerCase()==="text"&&I(a.width);b&&(a=v(b,c));this.styles=a;e&&(ja||!ca&&this.renderer.forExport)&&delete a.width;if(Ha&&!ca)E(this.element,a);else{b=function(a,b){return"-"+b.toLowerCase()};for(f in a)g+=f.replace(/([A-Z])/g,b)+
|
||||
":"+a[f]+";";W(d,"style",g)}e&&this.added&&this.renderer.buildText(this)}return this},on:function(a,b){var c=this,d=c.element;ab&&a==="click"?(d.ontouchstart=function(a){c.touchEventFired=Date.now();a.preventDefault();b.call(d,a)},d.onclick=function(a){(Da.indexOf("Android")===-1||Date.now()-(c.touchEventFired||0)>1100)&&b.call(d,a)}):d["on"+a]=b;return this},setRadialReference:function(a){this.element.radialReference=a;return this},translate:function(a,b){return this.attr({translateX:a,translateY:b})},
|
||||
invert:function(){this.inverted=!0;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.scaleX,d=this.scaleY,e=this.inverted,f=this.rotation,g=this.element;e&&(a+=this.attr("width"),b+=this.attr("height"));a=["translate("+a+","+b+")"];e?a.push("rotate(90) scale(-1,1)"):f&&a.push("rotate("+f+" "+(g.getAttribute("x")||0)+" "+(g.getAttribute("y")||0)+")");(t(c)||t(d))&&a.push("scale("+o(c,1)+" "+o(d,1)+")");a.length&&g.setAttribute("transform",
|
||||
a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){var d,e,f,g,h={};e=this.renderer;f=e.alignedObjects;if(a){if(this.alignOptions=a,this.alignByTranslate=b,!c||Oa(c))this.alignTo=d=c||"renderer",pa(f,this),f.push(this),c=null}else a=this.alignOptions,b=this.alignByTranslate,d=this.alignTo;c=o(c,e[d],e);d=a.align;e=a.verticalAlign;f=(c.x||0)+(a.x||0);g=(c.y||0)+(a.y||0);if(d==="right"||d==="center")f+=(c.width-(a.width||0))/{right:1,center:2}[d];
|
||||
h[b?"translateX":"x"]=s(f);if(e==="bottom"||e==="middle")g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||1);h[b?"translateY":"y"]=s(g);this[this.placed?"animate":"attr"](h);this.placed=!0;this.alignAttr=h;return this},getBBox:function(){var a=this.bBox,b=this.renderer,c,d,e=this.rotation;c=this.element;var f=this.styles,g=e*Ma;d=this.textStr;var h;if(d===""||Zb.test(d))h="num."+d.toString().length+(f?"|"+f.fontSize+"|"+f.fontFamily:"");h&&(a=b.cache[h]);if(!a){if(c.namespaceURI===Ea||b.forExport){try{a=
|
||||
c.getBBox?v({},c.getBBox()):{width:c.offsetWidth,height:c.offsetHeight}}catch(i){}if(!a||a.width<0)a={width:0,height:0}}else a=this.htmlGetBBox();if(b.isSVG){c=a.width;d=a.height;if(Ha&&f&&f.fontSize==="11px"&&d.toPrecision(3)==="16.9")a.height=d=14;if(e)a.width=M(d*ia(g))+M(c*da(g)),a.height=M(d*da(g))+M(c*ia(g))}this.bBox=a;h&&(b.cache[h]=a)}return a},show:function(a){return a&&this.element.namespaceURI===Ea?(this.element.removeAttribute("visibility"),this):this.attr({visibility:a?"inherit":"visible"})},
|
||||
hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var b=this;b.animate({opacity:0},{duration:a||150,complete:function(){b.hide()}})},add:function(a){var b=this.renderer,c=a||b,d=c.element||b.box,e=this.element,f=this.zIndex,g,h;if(a)this.parentGroup=a;this.parentInverted=a&&a.inverted;this.textStr!==void 0&&b.buildText(this);if(f)c.handleZ=!0,f=I(f);if(c.handleZ){a=d.childNodes;for(g=0;g<a.length;g++)if(b=a[g],c=W(b,"zIndex"),b!==e&&(I(c)>f||!t(f)&&t(c))){d.insertBefore(e,
|
||||
b);h=!0;break}}h||d.appendChild(e);this.added=!0;if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(a){var b=a.parentNode;b&&b.removeChild(a)},destroy:function(){var a=this,b=a.element||{},c=a.shadows,d=a.renderer.isSVG&&b.nodeName==="SPAN"&&a.parentGroup,e,f;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=b.point=null;eb(a);if(a.clipPath)a.clipPath=a.clipPath.destroy();if(a.stops){for(f=0;f<a.stops.length;f++)a.stops[f]=a.stops[f].destroy();a.stops=null}a.safeRemoveChild(b);for(c&&
|
||||
q(c,function(b){a.safeRemoveChild(b)});d&&d.div.childNodes.length===0;)b=d.parentGroup,a.safeRemoveChild(d.div),delete d.div,d=b;a.alignTo&&pa(a.renderer.alignedObjects,a);for(e in a)delete a[e];return null},shadow:function(a,b,c){var d=[],e,f,g=this.element,h,i,k,j;if(a){i=o(a.width,3);k=(a.opacity||0.15)/i;j=this.parentInverted?"(-1,-1)":"("+o(a.offsetX,1)+", "+o(a.offsetY,1)+")";for(e=1;e<=i;e++){f=g.cloneNode(0);h=i*2+1-2*e;W(f,{isShadow:"true",stroke:a.color||"black","stroke-opacity":k*e,"stroke-width":h,
|
||||
transform:"translate"+j,fill:Y});if(c)W(f,"height",w(W(f,"height")-h,0)),f.cutHeight=h;b?b.element.appendChild(f):g.parentNode.insertBefore(f,g);d.push(f)}this.shadows=d}return this},xGetter:function(a){this.element.nodeName==="circle"&&(a={x:"cx",y:"cy"}[a]||a);return this._defaultGetter(a)},_defaultGetter:function(a){a=o(this[a],this.element?this.element.getAttribute(a):null,0);/^[0-9\.]+$/.test(a)&&(a=parseFloat(a));return a},dSetter:function(a,b,c){a&&a.join&&(a=a.join(" "));/(NaN| {2}|^$)/.test(a)&&
|
||||
(a="M 0 0");c.setAttribute(b,a);this[b]=a},dashstyleSetter:function(a){var b;if(a=a&&a.toLowerCase()){a=a.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(b=a.length;b--;)a[b]=I(a[b])*this.element.getAttribute("stroke-width");a=a.join(",");this.element.setAttribute("stroke-dasharray",a)}},alignSetter:function(a){this.element.setAttribute("text-anchor",
|
||||
{left:"start",center:"middle",right:"end"}[a])},opacitySetter:function(a,b,c){this[b]=a;c.setAttribute(b,a)},"stroke-widthSetter":function(a,b,c){a===0&&(a=1.0E-5);this.strokeWidth=a;c.setAttribute(b,a)},titleSetter:function(a){var b=this.element.getElementsByTagName("title")[0];b||(b=B.createElementNS(Ea,"title"),this.element.appendChild(b));b.textContent=a},textSetter:function(a){if(a!==this.textStr)delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this)},fillSetter:function(a,
|
||||
b,c){typeof a==="string"?c.setAttribute(b,a):a&&this.colorGradient(a,b,c)},zIndexSetter:function(a,b,c){c.setAttribute(b,a);this[b]=a},_defaultSetter:function(a,b,c){c.setAttribute(b,a)}};Z.prototype.yGetter=Z.prototype.xGetter;Z.prototype.translateXSetter=Z.prototype.translateYSetter=Z.prototype.rotationSetter=Z.prototype.verticalAlignSetter=Z.prototype.scaleXSetter=Z.prototype.scaleYSetter=function(a,b){this[b]=a;this.doTransform=!0};Z.prototype.strokeSetter=Z.prototype.fillSetter;var ka=function(){this.init.apply(this,
|
||||
arguments)};ka.prototype={Element:Z,init:function(a,b,c,d,e){var f=location,g,d=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(d));g=d.element;a.appendChild(g);a.innerHTML.indexOf("xmlns")===-1&&W(g,"xmlns",Ea);this.isSVG=!0;this.box=g;this.boxWrapper=d;this.alignedObjects=[];this.url=($a||mb)&&B.getElementsByTagName("base").length?f.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(B.createTextNode("Created with Highstock 2.0.1"));
|
||||
this.defs=this.createElement("defs").add();this.forExport=e;this.gradients={};this.cache={};this.setSize(b,c,!1);var h;if($a&&a.getBoundingClientRect)this.subPixelFix=b=function(){E(a,{left:0,top:0});h=a.getBoundingClientRect();E(a,{left:Va(h.left)-h.left+"px",top:Va(h.top)-h.top+"px"})},b(),A(X,"resize",b)},getStyle:function(a){return this.style=v({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},a)},isHidden:function(){return!this.boxWrapper.getBBox().width},
|
||||
destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();Ka(this.gradients||{});this.gradients=null;if(a)this.defs=a.destroy();this.subPixelFix&&R(X,"resize",this.subPixelFix);return this.alignedObjects=null},createElement:function(a){var b=new this.Element;b.init(this,a);return b},draw:function(){},buildText:function(a){for(var b=a.element,c=this,d=c.forExport,e=o(a.textStr,"").toString(),f=e.indexOf("<")!==-1,g=b.childNodes,h,i,k=W(b,"x"),j=a.styles,l=a.textWidth,
|
||||
m=j&&j.lineHeight,n=g.length,p=function(a){return m?I(m):c.fontMetrics(/(px|em)$/.test(a&&a.style.fontSize)?a.style.fontSize:j&&j.fontSize||c.style.fontSize||12).h};n--;)b.removeChild(g[n]);!f&&e.indexOf(" ")===-1?b.appendChild(B.createTextNode(e)):(h=/<.*style="([^"]+)".*>/,i=/<.*href="(http[^"]+)".*>/,l&&!a.added&&this.box.appendChild(b),e=f?e.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,
|
||||
"</span>").split(/<br.*?>/g):[e],e[e.length-1]===""&&e.pop(),q(e,function(e,f){var g,m=0,e=e.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");g=e.split("|||");q(g,function(e){if(e!==""||g.length===1){var n={},u=B.createElementNS(Ea,"tspan"),o;h.test(e)&&(o=e.match(h)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),W(u,"style",o));i.test(e)&&!d&&(W(u,"onclick",'location.href="'+e.match(i)[1]+'"'),E(u,{cursor:"pointer"}));e=(e.replace(/<(.|\n)*?>/g,"")||" ").replace(/</g,"<").replace(/>/g,
|
||||
">");if(e!==" "){u.appendChild(B.createTextNode(e));if(m)n.dx=0;else if(f&&k!==null)n.x=k;W(u,n);!m&&f&&(!ca&&d&&E(u,{display:"block"}),W(u,"dy",p(u),mb&&u.offsetHeight));b.appendChild(u);m++;if(l)for(var e=e.replace(/([^\^])-/g,"$1- ").split(" "),n=e.length>1&&j.whiteSpace!=="nowrap",q,r,D=a._clipHeight,t=[],s=p(),w=1;n&&(e.length||t.length);)delete a.bBox,q=a.getBBox(),r=q.width,!ca&&c.forExport&&(r=c.measureSpanWidth(u.firstChild.data,a.styles)),q=r>l,!q||e.length===1?(e=t,t=[],e.length&&(w++,
|
||||
D&&w*s>D?(e=["..."],a.attr("title",a.textStr)):(u=B.createElementNS(Ea,"tspan"),W(u,{dy:s,x:k}),o&&W(u,"style",o),b.appendChild(u),r>l&&(l=r)))):(u.removeChild(u.firstChild),t.unshift(e.pop())),e.length&&u.appendChild(B.createTextNode(e.join(" ").replace(/- /g,"-")))}}})}))},button:function(a,b,c,d,e,f,g,h,i){var k=this.label(a,b,c,i,null,null,null,null,"button"),j=0,l,m,n,p,u,o,a={x1:0,y1:0,x2:0,y2:1},e=y({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:a,stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},
|
||||
r:2,padding:5,style:{color:"black"}},e);n=e.style;delete e.style;f=y(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#FFF"],[1,"#ACF"]]}},f);p=f.style;delete f.style;g=y(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#9BD"],[1,"#CDF"]]}},g);u=g.style;delete g.style;h=y(e,{style:{color:"#CCC"}},h);o=h.style;delete h.style;A(k.element,Ha?"mouseover":"mouseenter",function(){j!==3&&k.attr(f).css(p)});A(k.element,Ha?"mouseout":"mouseleave",function(){j!==3&&(l=[e,f,g][j],m=[n,p,u][j],k.attr(l).css(m))});
|
||||
k.setState=function(a){(k.state=j=a)?a===2?k.attr(g).css(u):a===3&&k.attr(h).css(o):k.attr(e).css(n)};return k.on("click",function(){j!==3&&d.call(k)}).attr(e).css(v({cursor:"default"},n))},crispLine:function(a,b){a[1]===a[4]&&(a[1]=a[4]=s(a[1])-b%2/2);a[2]===a[5]&&(a[2]=a[5]=s(a[2])+b%2/2);return a},path:function(a){var b={fill:Y};Pa(a)?b.d=a:fa(a)&&v(b,a);return this.createElement("path").attr(b)},circle:function(a,b,c){a=fa(a)?a:{x:a,y:b,r:c};b=this.createElement("circle");b.xSetter=function(a){this.element.setAttribute("cx",
|
||||
a)};b.ySetter=function(a){this.element.setAttribute("cy",a)};return b.attr(a)},arc:function(a,b,c,d,e,f){if(fa(a))b=a.y,c=a.r,d=a.innerR,e=a.start,f=a.end,a=a.x;a=this.symbol("arc",a||0,b||0,c||0,c||0,{innerR:d||0,start:e||0,end:f||0});a.r=c;return a},rect:function(a,b,c,d,e,f){var e=fa(a)?a.r:e,g=this.createElement("rect"),a=fa(a)?a:a===r?{}:{x:a,y:b,width:w(c,0),height:w(d,0)};if(f!==r)a.strokeWidth=f,a=g.crisp(a);if(e)a.r=e;g.rSetter=function(a){W(this.element,{rx:a,ry:a})};return g.attr(a)},setSize:function(a,
|
||||
b,c){var d=this.alignedObjects,e=d.length;this.width=a;this.height=b;for(this.boxWrapper[o(c,!0)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){var b=this.createElement("g");return t(a)?b.attr({"class":"highcharts-"+a}):b},image:function(a,b,c,d,e){var f={preserveAspectRatio:Y};arguments.length>1&&v(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",
|
||||
a);return f},symbol:function(a,b,c,d,e,f){var g,h=this.symbols[a],h=h&&h(s(b),s(c),d,e,f),i=/^url\((.*?)\)$/,k,j;if(h)g=this.path(h),v(g,{symbolName:a,x:b,y:c,width:d,height:e}),f&&v(g,f);else if(i.test(a))j=function(a,b){a.element&&(a.attr({width:b[0],height:b[1]}),a.alignByTranslate||a.translate(s((d-b[0])/2),s((e-b[1])/2)))},k=a.match(i)[1],a=Tb[k],g=this.image(k).attr({x:b,y:c}),g.isImg=!0,a?j(g,a):(g.attr({width:0,height:0}),$("img",{onload:function(){j(g,Tb[k]=[this.width,this.height])},src:k}));
|
||||
return g},symbols:{circle:function(a,b,c,d){var e=0.166*c;return["M",a+c/2,b,"C",a+c+e,b,a+c+e,b+d,a+c/2,b+d,"C",a-e,b+d,a-e,b,a+c/2,b,"Z"]},square:function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c,b+d,a,b+d,"Z"]},triangle:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d,a,b+d,"Z"]},"triangle-down":function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c/2,b+d,"Z"]},diamond:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d/2,a+c/2,b+d,a,b+d/2,"Z"]},arc:function(a,b,c,d,e){var f=e.start,c=e.r||c||d,g=e.end-0.001,
|
||||
d=e.innerR,h=e.open,i=da(f),k=ia(f),j=da(g),g=ia(g),e=e.end-f<ra?0:1;return["M",a+c*i,b+c*k,"A",c,c,0,e,1,a+c*j,b+c*g,h?"M":"L",a+d*j,b+d*g,"A",d,d,0,e,0,a+d*i,b+d*k,h?"":"Z"]},callout:function(a,b,c,d,e){var f=z(e&&e.r||0,c,d),g=f+6,h=e&&e.anchorX,i=e&&e.anchorY,e=s(e.strokeWidth||0)%2/2;a+=e;b+=e;e=["M",a+f,b,"L",a+c-f,b,"C",a+c,b,a+c,b,a+c,b+f,"L",a+c,b+d-f,"C",a+c,b+d,a+c,b+d,a+c-f,b+d,"L",a+f,b+d,"C",a,b+d,a,b+d,a,b+d-f,"L",a,b+f,"C",a,b,a,b,a+f,b];h&&h>c&&i>b+g&&i<b+d-g?e.splice(13,3,"L",a+
|
||||
c,i-6,a+c+6,i,a+c,i+6,a+c,b+d-f):h&&h<0&&i>b+g&&i<b+d-g?e.splice(33,3,"L",a,i+6,a-6,i,a,i-6,a,b+f):i&&i>d&&h>a+g&&h<a+c-g?e.splice(23,3,"L",h+6,b+d,h,b+d+6,h-6,b+d,a+f,b+d):i&&i<0&&h>a+g&&h<a+c-g&&e.splice(3,3,"L",h-6,b,h,b-6,h+6,b,c-f,b);return e}},clipRect:function(a,b,c,d){var e="highcharts-"+Ab++,f=this.createElement("clipPath").attr({id:e}).add(this.defs),a=this.rect(a,b,c,d,0).add(f);a.id=e;a.clipPath=f;return a},text:function(a,b,c,d){var e=ja||!ca&&this.forExport,f={};if(d&&!this.forExport)return this.html(a,
|
||||
b,c);f.x=Math.round(b||0);if(c)f.y=Math.round(c);if(a||a===0)f.text=a;a=this.createElement("text").attr(f);e&&a.css({position:"absolute"});if(!d)a.xSetter=function(a,b,c){var d=c.childNodes,e,f;for(f=1;f<d.length;f++)e=d[f],e.getAttribute("x")===c.getAttribute("x")&&e.setAttribute("x",a);c.setAttribute(b,a)};return a},fontMetrics:function(a){var a=a||this.style.fontSize,a=/px/.test(a)?I(a):/em/.test(a)?parseFloat(a)*12:12,a=a<24?a+4:s(a*1.2),b=s(a*0.8);return{h:a,b:b}},label:function(a,b,c,d,e,f,
|
||||
g,h,i){function k(){var a,b;a=p.element.style;o=(bb===void 0||Eb===void 0||n.styles.textAlign)&&p.textStr&&p.getBBox();n.width=(bb||o.width||0)+2*x+w;n.height=(Eb||o.height||0)+2*x;U=x+m.fontMetrics(a&&a.fontSize).b;if(z){if(!u)a=s(-G*x),b=h?-U:0,n.box=u=d?m.symbol(d,a,b,n.width,n.height,D):m.rect(a,b,n.width,n.height,0,D[$b]),u.attr("fill",Y).add(n);u.isImg||u.attr(v({width:s(n.width),height:s(n.height)},D));D=null}}function j(){var a=n.styles,a=a&&a.textAlign,b=w+x*(1-G),c;c=h?0:U;if(t(bb)&&o&&
|
||||
(a==="center"||a==="right"))b+={center:0.5,right:1}[a]*(bb-o.width);if(b!==p.x||c!==p.y)p.attr("x",b),c!==r&&p.attr("y",c);p.x=b;p.y=c}function l(a,b){u?u.attr(a,b):D[a]=b}var m=this,n=m.g(i),p=m.text("",0,0,g).attr({zIndex:1}),u,o,G=0,x=3,w=0,bb,Eb,Fb,Gb,Ub=0,D={},U,z;n.onAdd=function(){p.add(n);n.attr({text:a||"",x:b,y:c});u&&t(e)&&n.attr({anchorX:e,anchorY:f})};n.widthSetter=function(a){bb=a};n.heightSetter=function(a){Eb=a};n.paddingSetter=function(a){t(a)&&a!==x&&(x=a,j())};n.paddingLeftSetter=
|
||||
function(a){t(a)&&a!==w&&(w=a,j())};n.alignSetter=function(a){G={left:0,center:0.5,right:1}[a]};n.textSetter=function(a){a!==r&&p.textSetter(a);k();j()};n["stroke-widthSetter"]=function(a,b){a&&(z=!0);Ub=a%2/2;l(b,a)};n.strokeSetter=n.fillSetter=n.rSetter=function(a,b){b==="fill"&&a&&(z=!0);l(b,a)};n.anchorXSetter=function(a,b){e=a;l(b,a+Ub-Fb)};n.anchorYSetter=function(a,b){f=a;l(b,a-Gb)};n.xSetter=function(a){n.x=a;G&&(a-=G*((bb||o.width)+x));Fb=s(a);n.attr("translateX",Fb)};n.ySetter=function(a){Gb=
|
||||
n.y=s(a);n.attr("translateY",Gb)};var A=n.css;return v(n,{css:function(a){if(a){var b={},a=y(a);q("fontSize,fontWeight,fontFamily,color,lineHeight,width,textDecoration,textShadow".split(","),function(c){a[c]!==r&&(b[c]=a[c],delete a[c])});p.css(b)}return A.call(n,a)},getBBox:function(){return{width:o.width+2*x,height:o.height+2*x,x:o.x-x,y:o.y-x}},shadow:function(a){u&&u.shadow(a);return n},destroy:function(){R(n.element,"mouseenter");R(n.element,"mouseleave");p&&(p=p.destroy());u&&(u=u.destroy());
|
||||
Z.prototype.destroy.call(n);n=m=k=j=l=null}})}};Wa=ka;v(Z.prototype,{htmlCss:function(a){var b=this.element;if(b=a&&b.tagName==="SPAN"&&a.width)delete a.width,this.textWidth=b,this.updateTransform();this.styles=v(this.styles,a);E(this.element,a);return this},htmlGetBBox:function(){var a=this.element,b=this.bBox;if(!b){if(a.nodeName==="text")a.style.position="absolute";b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}}return b},htmlUpdateTransform:function(){if(this.added){var a=
|
||||
this.renderer,b=this.element,c=this.translateX||0,d=this.translateY||0,e=this.x||0,f=this.y||0,g=this.textAlign||"left",h={left:0,center:0.5,right:1}[g],i=this.shadows;E(b,{marginLeft:c,marginTop:d});i&&q(i,function(a){E(a,{marginLeft:c+1,marginTop:d+1})});this.inverted&&q(b.childNodes,function(c){a.invertChild(c,b)});if(b.tagName==="SPAN"){var k=this.rotation,j,l=I(this.textWidth),m=[k,g,b.innerHTML,this.textWidth].join(",");if(m!==this.cTT){j=a.fontMetrics(b.style.fontSize).b;t(k)&&this.setSpanRotation(k,
|
||||
h,j);i=o(this.elemWidth,b.offsetWidth);if(i>l&&/[ \-]/.test(b.textContent||b.innerText))E(b,{width:l+"px",display:"block",whiteSpace:"normal"}),i=l;this.getSpanCorrection(i,j,h,k,g)}E(b,{left:e+(this.xCorr||0)+"px",top:f+(this.yCorr||0)+"px"});if(mb)j=b.offsetHeight;this.cTT=m}}else this.alignOnAdd=!0},setSpanRotation:function(a,b,c){var d={},e=Ha?"-ms-transform":mb?"-webkit-transform":$a?"MozTransform":Sb?"-o-transform":"";d[e]=d.transform="rotate("+a+"deg)";d[e+($a?"Origin":"-origin")]=d.transformOrigin=
|
||||
b*100+"% "+c+"px";E(this.element,d)},getSpanCorrection:function(a,b,c){this.xCorr=-a*c;this.yCorr=-b}});v(ka.prototype,{html:function(a,b,c){var d=this.createElement("span"),e=d.element,f=d.renderer;d.textSetter=function(a){a!==e.innerHTML&&delete this.bBox;e.innerHTML=this.textStr=a};d.xSetter=d.ySetter=d.alignSetter=d.rotationSetter=function(a,b){b==="align"&&(b="textAlign");d[b]=a;d.htmlUpdateTransform()};d.attr({text:a,x:s(b),y:s(c)}).css({position:"absolute",whiteSpace:"nowrap",fontFamily:this.style.fontFamily,
|
||||
fontSize:this.style.fontSize});d.css=d.htmlCss;if(f.isSVG)d.add=function(a){var b,c=f.box.parentNode,k=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)k.push(a),a=a.parentGroup;q(k.reverse(),function(a){var d;b=a.div=a.div||$(Ta,{className:W(a.element,"class")},{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px"},b||c);d=b.style;v(a,{translateXSetter:function(b,c){d.left=b+"px";a[c]=b;a.doTransform=!0},translateYSetter:function(b,c){d.top=b+"px";a[c]=b;a.doTransform=!0},visibilitySetter:function(a,
|
||||
b){d[b]=a}})})}}else b=c;b.appendChild(e);d.added=!0;d.alignOnAdd&&d.htmlUpdateTransform();return d};return d}});var fb,ea;if(!ca&&!ja)P.VMLElement=ea={init:function(a,b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ","absolute",";"],e=b===Ta;(b==="shape"||e)&&d.push("left:0;top:0;width:1px;height:1px;");d.push("visibility: ",e?"hidden":"visible");c.push(' style="',d.join(""),'"/>');if(b)c=e||b==="span"||b==="img"?c.join(""):a.prepVML(c),this.element=$(c);this.renderer=a},add:function(a){var b=
|
||||
this.renderer,c=this.element,d=b.box,d=a?a.element||a:d;a&&a.inverted&&b.invertChild(c,d);d.appendChild(c);this.added=!0;this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform();if(this.onAdd)this.onAdd();return this},updateTransform:Z.prototype.htmlUpdateTransform,setSpanRotation:function(){var a=this.rotation,b=da(a*Ma),c=ia(a*Ma);E(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11=",b,", M12=",-c,", M21=",c,", M22=",b,", sizingMethod='auto expand')"].join(""):Y})},
|
||||
getSpanCorrection:function(a,b,c,d,e){var f=d?da(d*Ma):1,g=d?ia(d*Ma):0,h=o(this.elemHeight,this.element.offsetHeight),i;this.xCorr=f<0&&-a;this.yCorr=g<0&&-h;i=f*g<0;this.xCorr+=g*b*(i?1-c:c);this.yCorr-=f*b*(d?i?c:1-c:1);e&&e!=="left"&&(this.xCorr-=a*c*(f<0?-1:1),d&&(this.yCorr-=h*c*(g<0?-1:1)),E(this.element,{textAlign:e}))},pathToVML:function(a){for(var b=a.length,c=[];b--;)if(la(a[b]))c[b]=s(a[b]*10)-5;else if(a[b]==="Z")c[b]="x";else if(c[b]=a[b],a.isArc&&(a[b]==="wa"||a[b]==="at"))c[b+5]===
|
||||
c[b+7]&&(c[b+7]+=a[b+7]>a[b+5]?1:-1),c[b+6]===c[b+8]&&(c[b+8]+=a[b+8]>a[b+6]?1:-1);return c.join(" ")||"x"},clip:function(a){var b=this,c;a?(c=a.members,pa(c,b),c.push(b),b.destroyClip=function(){pa(c,b)},a=a.getCSS(b)):(b.destroyClip&&b.destroyClip(),a={clip:lb?"inherit":"rect(auto)"});return b.css(a)},css:Z.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&Sa(a)},destroy:function(){this.destroyClip&&this.destroyClip();return Z.prototype.destroy.apply(this)},on:function(a,b){this.element["on"+
|
||||
a]=function(){var a=X.event;a.target=a.srcElement;b(a)};return this},cutOffPath:function(a,b){var c,a=a.split(/[ ,]/);c=a.length;if(c===9||c===11)a[c-4]=a[c-2]=I(a[c-2])-10*b;return a.join(" ")},shadow:function(a,b,c){var d=[],e,f=this.element,g=this.renderer,h,i=f.style,k,j=f.path,l,m,n,p;j&&typeof j.value!=="string"&&(j="x");m=j;if(a){n=o(a.width,3);p=(a.opacity||0.15)/n;for(e=1;e<=3;e++){l=n*2+1-2*e;c&&(m=this.cutOffPath(j.value,l+0.5));k=['<shape isShadow="true" strokeweight="',l,'" filled="false" path="',
|
||||
m,'" coordsize="10 10" style="',f.style.cssText,'" />'];h=$(g.prepVML(k),null,{left:I(i.left)+o(a.offsetX,1),top:I(i.top)+o(a.offsetY,1)});if(c)h.cutOff=l+1;k=['<stroke color="',a.color||"black",'" opacity="',p*e,'"/>'];$(g.prepVML(k),null,null,h);b?b.element.appendChild(h):f.parentNode.insertBefore(h,f);d.push(h)}this.shadows=d}return this},updateShadows:na,setAttr:function(a,b){lb?this.element[a]=b:this.element.setAttribute(a,b)},classSetter:function(a){this.element.className=a},dashstyleSetter:function(a,
|
||||
b,c){(c.getElementsByTagName("stroke")[0]||$(this.renderer.prepVML(["<stroke/>"]),null,null,c))[b]=a||"solid";this[b]=a},dSetter:function(a,b,c){var d=this.shadows,a=a||[];this.d=a.join(" ");c.path=a=this.pathToVML(a);if(d)for(c=d.length;c--;)d[c].path=d[c].cutOff?this.cutOffPath(a,d[c].cutOff):a;this.setAttr(b,a)},fillSetter:function(a,b,c){var d=c.nodeName;if(d==="SPAN")c.style.color=a;else if(d!=="IMG")c.filled=a!==Y,this.setAttr("fillcolor",this.renderer.color(a,c,b,this))},opacitySetter:na,rotationSetter:function(a,
|
||||
b,c){c=c.style;this[b]=c[b]=a;c.left=-s(ia(a*Ma)+1)+"px";c.top=s(da(a*Ma))+"px"},strokeSetter:function(a,b,c){this.setAttr("strokecolor",this.renderer.color(a,c,b))},"stroke-widthSetter":function(a,b,c){c.stroked=!!a;this[b]=a;la(a)&&(a+="px");this.setAttr("strokeweight",a)},titleSetter:function(a,b){this.setAttr(b,a)},visibilitySetter:function(a,b,c){a==="inherit"&&(a="visible");this.shadows&&q(this.shadows,function(c){c.style[b]=a});c.nodeName==="DIV"&&(a=a==="hidden"?"-999em":0,lb||(c.style[b]=
|
||||
a?"visible":"hidden"),b="top");c.style[b]=a},xSetter:function(a,b,c){this[b]=a;b==="x"?b="left":b==="y"&&(b="top");this.updateClipping?(this[b]=a,this.updateClipping()):c.style[b]=a},zIndexSetter:function(a,b,c){c.style[b]=a}},ea=ga(Z,ea),ea.prototype.ySetter=ea.prototype.widthSetter=ea.prototype.heightSetter=ea.prototype.xSetter,ea={Element:ea,isIE8:Da.indexOf("MSIE 8.0")>-1,init:function(a,b,c,d){var e;this.alignedObjects=[];d=this.createElement(Ta).css(v(this.getStyle(d),{position:"relative"}));
|
||||
e=d.element;a.appendChild(d.element);this.isVML=!0;this.box=e;this.boxWrapper=d;this.cache={};this.setSize(b,c,!1);if(!B.namespaces.hcv){B.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{B.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(f){B.styleSheets[0].cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}},isHidden:function(){return!this.box.offsetWidth},
|
||||
clipRect:function(a,b,c,d){var e=this.createElement(),f=fa(a);return v(e,{members:[],left:(f?a.x:a)+1,top:(f?a.y:b)+1,width:(f?a.width:c)-1,height:(f?a.height:d)-1,getCSS:function(a){var b=a.element,c=b.nodeName,a=a.inverted,d=this.top-(c==="shape"?b.offsetTop:0),e=this.left,b=e+this.width,f=d+this.height,d={clip:"rect("+s(a?e:d)+"px,"+s(a?f:b)+"px,"+s(a?b:f)+"px,"+s(a?d:e)+"px)"};!a&&lb&&c==="DIV"&&v(d,{width:b+"px",height:f+"px"});return d},updateClipping:function(){q(e.members,function(a){a.element&&
|
||||
a.css(e.getCSS(a))})}})},color:function(a,b,c,d){var e=this,f,g=/^rgba/,h,i,k=Y;a&&a.linearGradient?i="gradient":a&&a.radialGradient&&(i="pattern");if(i){var j,l,m=a.linearGradient||a.radialGradient,n,p,u,o,G,x="",a=a.stops,r,t=[],s=function(){h=['<fill colors="'+t.join(",")+'" opacity="',u,'" o:opacity2="',p,'" type="',i,'" ',x,'focus="100%" method="any" />'];$(e.prepVML(h),null,null,b)};n=a[0];r=a[a.length-1];n[0]>0&&a.unshift([0,n[1]]);r[0]<1&&a.push([1,r[1]]);q(a,function(a,b){g.test(a[1])?(f=
|
||||
Fa(a[1]),j=f.get("rgb"),l=f.get("a")):(j=a[1],l=1);t.push(a[0]*100+"% "+j);b?(u=l,o=j):(p=l,G=j)});if(c==="fill")if(i==="gradient")c=m.x1||m[0]||0,a=m.y1||m[1]||0,n=m.x2||m[2]||0,m=m.y2||m[3]||0,x='angle="'+(90-V.atan((m-a)/(n-c))*180/ra)+'"',s();else{var k=m.r,w=k*2,v=k*2,y=m.cx,D=m.cy,U=b.radialReference,z,k=function(){U&&(z=d.getBBox(),y+=(U[0]-z.x)/z.width-0.5,D+=(U[1]-z.y)/z.height-0.5,w*=U[2]/z.width,v*=U[2]/z.height);x='src="'+F.global.VMLRadialGradientURL+'" size="'+w+","+v+'" origin="0.5,0.5" position="'+
|
||||
y+","+D+'" color2="'+G+'" ';s()};d.added?k():d.onAdd=k;k=o}else k=j}else if(g.test(a)&&b.tagName!=="IMG")f=Fa(a),h=["<",c,' opacity="',f.get("a"),'"/>'],$(this.prepVML(h),null,null,b),k=f.get("rgb");else{k=b.getElementsByTagName(c);if(k.length)k[0].opacity=1,k[0].type="solid";k=a}return k},prepVML:function(a){var b=this.isIE8,a=a.join("");b?(a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):
|
||||
a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):a=a.replace("<","<hcv:");return a},text:ka.prototype.html,path:function(a){var b={coordsize:"10 10"};Pa(a)?b.d=a:fa(a)&&v(b,a);return this.createElement("shape").attr(b)},circle:function(a,b,c){var d=this.symbol("circle");if(fa(a))c=a.r,b=a.y,a=a.x;d.isCircle=!0;d.r=c;return d.attr({x:a,y:b})},g:function(a){var b;a&&(b={className:"highcharts-"+a,"class":"highcharts-"+a});return this.createElement(Ta).attr(b)},image:function(a,
|
||||
b,c,d,e){var f=this.createElement("img").attr({src:a});arguments.length>1&&f.attr({x:b,y:c,width:d,height:e});return f},createElement:function(a){return a==="rect"?this.symbol(a):ka.prototype.createElement.call(this,a)},invertChild:function(a,b){var c=this,d=b.style,e=a.tagName==="IMG"&&a.style;E(a,{flip:"x",left:I(d.width)-(e?I(e.top):1),top:I(d.height)-(e?I(e.left):1),rotation:-90});q(a.childNodes,function(b){c.invertChild(b,a)})},symbols:{arc:function(a,b,c,d,e){var f=e.start,g=e.end,h=e.r||c||
|
||||
d,c=e.innerR,d=da(f),i=ia(f),k=da(g),j=ia(g);if(g-f===0)return["x"];f=["wa",a-h,b-h,a+h,b+h,a+h*d,b+h*i,a+h*k,b+h*j];e.open&&!c&&f.push("e","M",a,b);f.push("at",a-c,b-c,a+c,b+c,a+c*k,b+c*j,a+c*d,b+c*i,"x","e");f.isArc=!0;return f},circle:function(a,b,c,d,e){e&&(c=d=2*e.r);e&&e.isCircle&&(a-=c/2,b-=d/2);return["wa",a,b,a+c,b+d,a+c,b+d/2,a+c,b+d/2,"e"]},rect:function(a,b,c,d,e){return ka.prototype.symbols[!t(e)||!e.r?"square":"callout"].call(0,a,b,c,d,e)}}},P.VMLRenderer=fb=function(){this.init.apply(this,
|
||||
arguments)},fb.prototype=y(ka.prototype,ea),Wa=fb;ka.prototype.measureSpanWidth=function(a,b){var c=B.createElement("span"),d;d=B.createTextNode(a);c.appendChild(d);E(c,b);this.box.appendChild(c);d=c.offsetWidth;Sa(c);return d};var Vb;if(ja)P.CanVGRenderer=ea=function(){Ea="http://www.w3.org/1999/xhtml"},ea.prototype.symbols={},Vb=function(){function a(){var a=b.length,d;for(d=0;d<a;d++)b[d]();b=[]}var b=[];return{push:function(c,d){b.length===0&&ac(d,a);b.push(c)}}}(),Wa=ea;Za.prototype={addLabel:function(){var a=
|
||||
this.axis,b=a.options,c=a.chart,d=a.horiz,e=a.categories,f=a.names,g=this.pos,h=b.labels,i=a.tickPositions,d=d&&e&&!h.step&&!h.staggerLines&&!h.rotation&&c.plotWidth/i.length||!d&&(c.margin[3]||c.chartWidth*0.33),k=g===i[0],j=g===i[i.length-1],l,f=e?o(e[g],f[g],g):g,e=this.label,m=i.info;a.isDatetimeAxis&&m&&(l=b.dateTimeLabelFormats[m.higherRanks[g]||m.unitName]);this.isFirst=k;this.isLast=j;b=a.labelFormatter.call({axis:a,chart:c,isFirst:k,isLast:j,dateTimeLabelFormat:l,value:a.isLog?ha(oa(f)):
|
||||
f});g=d&&{width:w(1,s(d-2*(h.padding||10)))+"px"};g=v(g,h.style);if(t(e))e&&e.attr({text:b}).css(g);else{l={align:a.labelAlign};if(la(h.rotation))l.rotation=h.rotation;if(d&&h.ellipsis)l._clipHeight=a.len/i.length;this.label=t(b)&&h.enabled?c.renderer.text(b,0,0,h.useHTML).attr(l).css(g).add(a.labelGroup):null}},getLabelSize:function(){var a=this.label,b=this.axis;return a?a.getBBox()[b.horiz?"height":"width"]:0},getLabelSides:function(){var a=this.label.getBBox(),b=this.axis,c=b.horiz,d=b.options.labels,
|
||||
a=c?a.width:a.height,b=c?d.x-a*{left:0,center:0.5,right:1}[b.labelAlign]:0;return[b,c?a+b:a]},handleOverflow:function(a,b){var c=!0,d=this.axis,e=this.isFirst,f=this.isLast,g=d.horiz?b.x:b.y,h=d.reversed,i=d.tickPositions,k=this.getLabelSides(),j=k[0],k=k[1],l,m,n,p=this.label.line||0;l=d.labelEdge;m=d.justifyLabels&&(e||f);l[p]===r||g+j>l[p]?l[p]=g+k:m||(c=!1);if(m){l=(m=d.justifyToPlot)?d.pos:0;m=m?l+d.len:d.chart.chartWidth;do a+=e?1:-1,n=d.ticks[i[a]];while(i[a]&&(!n||n.label.line!==p));d=n&&
|
||||
n.label.xy&&n.label.xy.x+n.getLabelSides()[e?0:1];e&&!h||f&&h?g+j<l&&(g=l-j,n&&g+k>d&&(c=!1)):g+k>m&&(g=m-k,n&&g+j<d&&(c=!1));b.x=g}return c},getPosition:function(a,b,c,d){var e=this.axis,f=e.chart,g=d&&f.oldChartHeight||f.chartHeight;return{x:a?e.translate(b+c,null,null,d)+e.transB:e.left+e.offset+(e.opposite?(d&&f.oldChartWidth||f.chartWidth)-e.right-e.left:0),y:a?g-e.bottom+e.offset-(e.opposite?e.height:0):g-e.translate(b+c,null,null,d)-e.transB}},getLabelPosition:function(a,b,c,d,e,f,g,h){var i=
|
||||
this.axis,k=i.transA,j=i.reversed,l=i.staggerLines,m=i.chart.renderer.fontMetrics(e.style.fontSize).b,n=e.rotation,a=a+e.x-(f&&d?f*k*(j?-1:1):0),b=b+e.y-(f&&!d?f*k*(j?1:-1):0);n&&i.side===2&&(b-=m-m*da(n*Ma));!t(e.y)&&!n&&(b+=m-c.getBBox().height/2);if(l)c.line=g/(h||1)%l,b+=c.line*(i.labelOffset/l);return{x:a,y:b}},getMarkPath:function(a,b,c,d,e,f){return f.crispLine(["M",a,b,"L",a+(e?0:-c),b+(e?c:0)],d)},render:function(a,b,c){var d=this.axis,e=d.options,f=d.chart.renderer,g=d.horiz,h=this.type,
|
||||
i=this.label,k=this.pos,j=e.labels,l=this.gridLine,m=h?h+"Grid":"grid",n=h?h+"Tick":"tick",p=e[m+"LineWidth"],u=e[m+"LineColor"],q=e[m+"LineDashStyle"],G=e[n+"Length"],m=e[n+"Width"]||0,x=e[n+"Color"],t=e[n+"Position"],n=this.mark,s=j.step,w=!0,v=d.tickmarkOffset,y=this.getPosition(g,k,v,b),z=y.x,y=y.y,D=g&&z===d.pos+d.len||!g&&y===d.pos?-1:1;this.isActive=!0;if(p){k=d.getPlotLinePath(k+v,p*D,b,!0);if(l===r){l={stroke:u,"stroke-width":p};if(q)l.dashstyle=q;if(!h)l.zIndex=1;if(b)l.opacity=0;this.gridLine=
|
||||
l=p?f.path(k).attr(l).add(d.gridGroup):null}if(!b&&l&&k)l[this.isNew?"attr":"animate"]({d:k,opacity:c})}if(m&&G)t==="inside"&&(G=-G),d.opposite&&(G=-G),h=this.getMarkPath(z,y,G,m*D,g,f),n?n.animate({d:h,opacity:c}):this.mark=f.path(h).attr({stroke:x,"stroke-width":m,opacity:c}).add(d.axisGroup);if(i&&!isNaN(z))i.xy=y=this.getLabelPosition(z,y,i,g,j,v,a,s),this.isFirst&&!this.isLast&&!o(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!o(e.showLastLabel,1)?w=!1:!d.isRadial&&!j.step&&!j.rotation&&!b&&
|
||||
c!==0&&(w=this.handleOverflow(a,y)),s&&a%s&&(w=!1),w&&!isNaN(y.y)?(y.opacity=c,i[this.isNew?"attr":"animate"](y),this.isNew=!1):i.attr("y",-9999)},destroy:function(){Ka(this,this.axis)}};P.PlotLineOrBand=function(a,b){this.axis=a;if(b)this.options=b,this.id=b.id};P.PlotLineOrBand.prototype={render:function(){var a=this,b=a.axis,c=b.horiz,d=(b.pointRange||0)/2,e=a.options,f=e.label,g=a.label,h=e.width,i=e.to,k=e.from,j=t(k)&&t(i),l=e.value,m=e.dashStyle,n=a.svgElem,p=[],u,q=e.color,G=e.zIndex,x=e.events,
|
||||
r={},s=b.chart.renderer;b.isLog&&(k=Ga(k),i=Ga(i),l=Ga(l));if(h){if(p=b.getPlotLinePath(l,h),r={stroke:q,"stroke-width":h},m)r.dashstyle=m}else if(j){k=w(k,b.min-d);i=z(i,b.max+d);p=b.getPlotBandPath(k,i,e);if(q)r.fill=q;if(e.borderWidth)r.stroke=e.borderColor,r["stroke-width"]=e.borderWidth}else return;if(t(G))r.zIndex=G;if(n)if(p)n.animate({d:p},null,n.onGetPath);else{if(n.hide(),n.onGetPath=function(){n.show()},g)a.label=g=g.destroy()}else if(p&&p.length&&(a.svgElem=n=s.path(p).attr(r).add(),x))for(u in d=
|
||||
function(b){n.on(b,function(c){x[b].apply(a,[c])})},x)d(u);if(f&&t(f.text)&&p&&p.length&&b.width>0&&b.height>0){f=y({align:c&&j&&"center",x:c?!j&&4:10,verticalAlign:!c&&j&&"middle",y:c?j?16:10:j?6:-4,rotation:c&&!j&&90},f);if(!g){r={align:f.textAlign||f.align,rotation:f.rotation};if(t(G))r.zIndex=G;a.label=g=s.text(f.text,0,0,f.useHTML).attr(r).css(f.style).add()}b=[p[1],p[4],o(p[6],p[1])];p=[p[2],p[5],o(p[7],p[2])];c=Ra(b);j=Ra(p);g.align(f,!1,{x:c,y:j,width:Ba(b)-c,height:Ba(p)-j});g.show()}else g&&
|
||||
g.hide();return a},destroy:function(){pa(this.axis.plotLinesAndBands,this);delete this.axis;Ka(this)}};L.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#C0C0C0",labels:Q,lineColor:"#C0D0E0",lineWidth:1,minPadding:0.01,maxPadding:0.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",
|
||||
startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:!0,tickWidth:0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return Ia(this.total,-1)},style:Q.style}},
|
||||
defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{x:0,y:20},title:{rotation:0}},defaultTopAxisOptions:{labels:{x:0,y:-15},title:{rotation:0}},init:function(a,b){var c=b.isX;this.horiz=a.inverted?!c:c;this.coll=(this.isXAxis=c)?"xAxis":"yAxis";this.opposite=b.opposite;this.side=b.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(b);var d=this.options,e=d.type;
|
||||
this.labelFormatter=d.labels.formatter||this.defaultLabelFormatter;this.userOptions=b;this.minPixelPadding=0;this.chart=a;this.reversed=d.reversed;this.zoomEnabled=d.zoomEnabled!==!1;this.categories=d.categories||e==="category";this.names=[];this.isLog=e==="logarithmic";this.isDatetimeAxis=e==="datetime";this.isLinked=t(d.linkedTo);this.tickmarkOffset=this.categories&&d.tickmarkPlacement==="between"?0.5:0;this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands=
|
||||
{};this.len=0;this.minRange=this.userMinRange=d.minRange||d.maxZoom;this.range=d.range;this.offset=d.offset||0;this.stacks={};this.oldStacks={};this.min=this.max=null;this.crosshair=o(d.crosshair,ma(a.options.tooltip.crosshairs)[c?0:1],!1);var f,d=this.options.events;wa(this,a.axes)===-1&&(c&&!this.isColorAxis?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));this.series=this.series||[];if(a.inverted&&c&&this.reversed===r)this.reversed=!0;this.removePlotLine=this.removePlotBand=
|
||||
this.removePlotBandOrLine;for(f in d)A(this,f,d[f]);if(this.isLog)this.val2lin=Ga,this.lin2val=oa},setOptions:function(a){this.options=y(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],y(F[this.coll],a))},defaultLabelFormatter:function(){var a=this.axis,b=this.value,c=a.categories,d=this.dateTimeLabelFormat,e=F.lang.numericSymbols,f=e&&e.length,g,h=a.options.labels.format,
|
||||
a=a.isLog?b:a.tickInterval;if(h)g=Ja(h,this);else if(c)g=b;else if(d)g=ua(d,b);else if(f&&a>=1E3)for(;f--&&g===r;)c=Math.pow(1E3,f+1),a>=c&&e[f]!==null&&(g=Ia(b/c,-1)+e[f]);g===r&&(g=M(b)>=1E4?Ia(b,0):Ia(b,-1,r,""));return g},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=null;a.buildStacks&&a.buildStacks();q(a.series,function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries){var d;d=c.options.threshold;var e;a.hasVisibleSeries=!0;a.isLog&&d<=0&&(d=
|
||||
null);if(a.isXAxis){if(d=c.xData,d.length)a.dataMin=z(o(a.dataMin,d[0]),Ra(d)),a.dataMax=w(o(a.dataMax,d[0]),Ba(d))}else{c.getExtremes();e=c.dataMax;c=c.dataMin;if(t(c)&&t(e))a.dataMin=z(o(a.dataMin,c),c),a.dataMax=w(o(a.dataMax,e),e);if(t(d))if(a.dataMin>=d)a.dataMin=d,a.ignoreMinPadding=!0;else if(a.dataMax<d)a.dataMax=d,a.ignoreMaxPadding=!0}}})},translate:function(a,b,c,d,e,f){var g=1,h=0,i=d?this.oldTransA:this.transA,d=d?this.oldMin:this.min,k=this.minPixelPadding,e=(this.options.ordinal||this.isLog&&
|
||||
e)&&this.lin2val;if(!i)i=this.transA;if(c)g*=-1,h=this.len;this.reversed&&(g*=-1,h-=g*(this.sector||this.len));b?(a=a*g+h,a-=k,a=a/i+d,e&&(a=this.lin2val(a))):(e&&(a=this.val2lin(a)),f==="between"&&(f=0.5),a=g*(a-d)*i+h+g*k+(la(f)?i*f*this.pointRange:0));return a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,b){return this.translate(a-(b?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,b,c,d,e){var f=this.chart,g=this.left,
|
||||
h=this.top,i,k,j=c&&f.oldChartHeight||f.chartHeight,l=c&&f.oldChartWidth||f.chartWidth,m;i=this.transB;e=o(e,this.translate(a,null,null,c));a=c=s(e+i);i=k=s(j-e-i);if(isNaN(e))m=!0;else if(this.horiz){if(i=h,k=j-this.bottom,a<g||a>g+this.width)m=!0}else if(a=g,c=l-this.right,i<h||i>h+this.height)m=!0;return m&&!d?null:f.renderer.crispLine(["M",a,i,"L",c,k],b||1)},getLinearTickPositions:function(a,b,c){var d,e=ha(S(b/a)*a),f=ha(Va(c/a)*a),g=[];if(b===c&&la(b))return[b];for(b=e;b<=f;){g.push(b);b=ha(b+
|
||||
a);if(b===d)break;d=b}return g},getMinorTickPositions:function(){var a=this.options,b=this.tickPositions,c=this.minorTickInterval,d=[],e;if(this.isLog){e=b.length;for(a=1;a<e;a++)d=d.concat(this.getLogTickPositions(c,b[a-1],b[a],!0))}else if(this.isDatetimeAxis&&a.minorTickInterval==="auto")d=d.concat(this.getTimeTicks(this.normalizeTimeTickInterval(c),this.min,this.max,a.startOfWeek)),d[0]<this.min&&d.shift();else for(b=this.min+(b[0]-this.min)%c;b<=this.max;b+=c)d.push(b);return d},adjustForMinRange:function(){var a=
|
||||
this.options,b=this.min,c=this.max,d,e=this.dataMax-this.dataMin>=this.minRange,f,g,h,i,k;if(this.isXAxis&&this.minRange===r&&!this.isLog)t(a.min)||t(a.max)?this.minRange=null:(q(this.series,function(a){i=a.xData;for(g=k=a.xIncrement?1:i.length-1;g>0;g--)if(h=i[g]-i[g-1],f===r||h<f)f=h}),this.minRange=z(f*5,this.dataMax-this.dataMin));if(c-b<this.minRange){var j=this.minRange;d=(j-c+b)/2;d=[b-d,o(a.min,b-d)];if(e)d[2]=this.dataMin;b=Ba(d);c=[b+j,o(a.max,b+j)];if(e)c[2]=this.dataMax;c=Ra(c);c-b<j&&
|
||||
(d[0]=c-j,d[1]=o(a.min,c-j),b=Ba(d))}this.min=b;this.max=c},setAxisTranslation:function(a){var b=this,c=b.max-b.min,d=b.axisPointRange||0,e,f=0,g=0,h=b.linkedParent,i=!!b.categories,k=b.transA;if(b.isXAxis||i||d)h?(f=h.minPointOffset,g=h.pointRangePadding):q(b.series,function(a){var h=i?1:b.isXAxis?a.pointRange:b.axisPointRange||0,k=a.options.pointPlacement,n=a.closestPointRange;h>c&&(h=0);d=w(d,h);f=w(f,Oa(k)?0:h/2);g=w(g,k==="on"?0:h);!a.noSharedTooltip&&t(n)&&(e=t(e)?z(e,n):n)}),h=b.ordinalSlope&&
|
||||
e?b.ordinalSlope/e:1,b.minPointOffset=f*=h,b.pointRangePadding=g*=h,b.pointRange=z(d,c),b.closestPointRange=e;if(a)b.oldTransA=k;b.translationSlope=b.transA=k=b.len/(c+g||1);b.transB=b.horiz?b.left:b.bottom;b.minPixelPadding=k*f},setTickPositions:function(a){var b=this,c=b.chart,d=b.options,e=b.isLog,f=b.isDatetimeAxis,g=b.isXAxis,h=b.isLinked,i=b.options.tickPositioner,k=d.maxPadding,j=d.minPadding,l=d.tickInterval,m=d.minTickInterval,n=d.tickPixelInterval,p,u=b.categories;h?(b.linkedParent=c[b.coll][d.linkedTo],
|
||||
c=b.linkedParent.getExtremes(),b.min=o(c.min,c.dataMin),b.max=o(c.max,c.dataMax),d.type!==b.linkedParent.options.type&&qa(11,1)):(b.min=o(b.userMin,d.min,b.dataMin),b.max=o(b.userMax,d.max,b.dataMax));if(e)!a&&z(b.min,o(b.dataMin,b.min))<=0&&qa(10,1),b.min=ha(Ga(b.min)),b.max=ha(Ga(b.max));if(b.range&&t(b.max))b.userMin=b.min=w(b.min,b.max-b.range),b.userMax=b.max,b.range=null;b.beforePadding&&b.beforePadding();b.adjustForMinRange();if(!u&&!b.axisPointRange&&!b.usePercentage&&!h&&t(b.min)&&t(b.max)&&
|
||||
(c=b.max-b.min)){if(!t(d.min)&&!t(b.userMin)&&j&&(b.dataMin<0||!b.ignoreMinPadding))b.min-=c*j;if(!t(d.max)&&!t(b.userMax)&&k&&(b.dataMax>0||!b.ignoreMaxPadding))b.max+=c*k}if(la(d.floor))b.min=w(b.min,d.floor);if(la(d.ceiling))b.max=z(b.max,d.ceiling);b.min===b.max||b.min===void 0||b.max===void 0?b.tickInterval=1:h&&!l&&n===b.linkedParent.options.tickPixelInterval?b.tickInterval=b.linkedParent.tickInterval:(b.tickInterval=o(l,u?1:(b.max-b.min)*n/w(b.len,n)),!t(l)&&b.len<n&&!this.isRadial&&!this.isLog&&
|
||||
!u&&d.startOnTick&&d.endOnTick&&(p=!0,b.tickInterval/=4));g&&!a&&q(b.series,function(a){a.processData(b.min!==b.oldMin||b.max!==b.oldMax)});b.setAxisTranslation(!0);b.beforeSetTickPositions&&b.beforeSetTickPositions();if(b.postProcessTickInterval)b.tickInterval=b.postProcessTickInterval(b.tickInterval);if(b.pointRange)b.tickInterval=w(b.pointRange,b.tickInterval);if(!l&&b.tickInterval<m)b.tickInterval=m;if(!f&&!e&&!l)b.tickInterval=sb(b.tickInterval,null,rb(b.tickInterval),d);b.minorTickInterval=
|
||||
d.minorTickInterval==="auto"&&b.tickInterval?b.tickInterval/5:d.minorTickInterval;b.tickPositions=a=d.tickPositions?[].concat(d.tickPositions):i&&i.apply(b,[b.min,b.max]);if(!a)!b.ordinalPositions&&(b.max-b.min)/b.tickInterval>w(2*b.len,200)&&qa(19,!0),a=f?b.getTimeTicks(b.normalizeTimeTickInterval(b.tickInterval,d.units),b.min,b.max,d.startOfWeek,b.ordinalPositions,b.closestPointRange,!0):e?b.getLogTickPositions(b.tickInterval,b.min,b.max):b.getLinearTickPositions(b.tickInterval,b.min,b.max),p&&
|
||||
a.splice(1,a.length-2),b.tickPositions=a;if(!h)e=a[0],f=a[a.length-1],h=b.minPointOffset||0,d.startOnTick?b.min=e:b.min-h>e&&a.shift(),d.endOnTick?b.max=f:b.max+h<f&&a.pop(),a.length===1&&(d=M(b.max)>1E13?1:0.001,b.min-=d,b.max+=d)},setMaxTicks:function(){var a=this.chart,b=a.maxTicks||{},c=this.tickPositions,d=this._maxTicksKey=[this.coll,this.pos,this.len].join("-");if(!this.isLinked&&!this.isDatetimeAxis&&c&&c.length>(b[d]||0)&&this.options.alignTicks!==!1)b[d]=c.length;a.maxTicks=b},adjustTickAmount:function(){var a=
|
||||
this._maxTicksKey,b=this.tickPositions,c=this.chart.maxTicks;if(c&&c[a]&&!this.isDatetimeAxis&&!this.categories&&!this.isLinked&&this.options.alignTicks!==!1&&this.min!==r){var d=this.tickAmount,e=b.length;this.tickAmount=a=c[a];if(e<a){for(;b.length<a;)b.push(ha(b[b.length-1]+this.tickInterval));this.transA*=(e-1)/(a-1);this.max=b[b.length-1]}if(t(d)&&a!==d)this.isDirty=!0}},setScale:function(){var a=this.stacks,b,c,d,e;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();
|
||||
e=this.len!==this.oldAxisLength;q(this.series,function(a){if(a.isDirtyData||a.isDirty||a.xAxis.isDirty)d=!0});if(e||d||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax){if(!this.isXAxis)for(b in a)for(c in a[b])a[b][c].total=null,a[b][c].cum=0;this.forceRedraw=!1;this.getSeriesExtremes();this.setTickPositions();this.oldUserMin=this.userMin;this.oldUserMax=this.userMax;if(!this.isDirty)this.isDirty=e||this.min!==this.oldMin||this.max!==this.oldMax}else if(!this.isXAxis){if(this.oldStacks)a=
|
||||
this.stacks=this.oldStacks;for(b in a)for(c in a[b])a[b][c].cum=a[b][c].total}this.setMaxTicks()},setExtremes:function(a,b,c,d,e){var f=this,g=f.chart,c=o(c,!0),e=v(e,{min:a,max:b});N(f,"setExtremes",e,function(){f.userMin=a;f.userMax=b;f.eventArgs=e;f.isDirtyExtremes=!0;c&&g.redraw(d)})},zoom:function(a,b){var c=this.dataMin,d=this.dataMax,e=this.options;this.allowZoomOutside||(t(c)&&a<=z(c,o(e.min,c))&&(a=r),t(d)&&b>=w(d,o(e.max,d))&&(b=r));this.displayBtn=a!==r||b!==r;this.setExtremes(a,b,!1,r,
|
||||
{trigger:"zoom"});return!0},setAxisSize:function(){var a=this.chart,b=this.options,c=b.offsetLeft||0,d=this.horiz,e=o(b.width,a.plotWidth-c+(b.offsetRight||0)),f=o(b.height,a.plotHeight),g=o(b.top,a.plotTop),b=o(b.left,a.plotLeft+c),c=/%$/;c.test(f)&&(f=parseInt(f,10)/100*a.plotHeight);c.test(g)&&(g=parseInt(g,10)/100*a.plotHeight+a.plotTop);this.left=b;this.top=g;this.width=e;this.height=f;this.bottom=a.chartHeight-f-g;this.right=a.chartWidth-e-b;this.len=w(d?e:f,0);this.pos=d?b:g},getExtremes:function(){var a=
|
||||
this.isLog;return{min:a?ha(oa(this.min)):this.min,max:a?ha(oa(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,c=b?oa(this.min):this.min,b=b?oa(this.max):this.max;c>a||a===null?a=c:b<a&&(a=b);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){a=(o(a,0)-this.side*90+720)%360;return a>15&&a<165?"right":a>195&&a<345?"left":"center"},getOffset:function(){var a=this,b=a.chart,c=b.renderer,d=a.options,
|
||||
e=a.tickPositions,f=a.ticks,g=a.horiz,h=a.side,i=b.inverted?[1,0,3,2][h]:h,k,j=0,l,m=0,n=d.title,p=d.labels,u=0,Db=b.axisOffset,G=b.clipOffset,x=[-1,1,1,-1][h],s,v=1,y=o(p.maxStaggerLines,5),z,A,B,D,U=h===2?c.fontMetrics(p.style.fontSize).b:0;a.hasData=k=a.hasVisibleSeries||t(a.min)&&t(a.max)&&!!e;a.showAxis=b=k||o(d.showEmpty,!0);a.staggerLines=a.horiz&&p.staggerLines;if(!a.axisGroup)a.gridGroup=c.g("grid").attr({zIndex:d.gridZIndex||1}).add(),a.axisGroup=c.g("axis").attr({zIndex:d.zIndex||2}).add(),
|
||||
a.labelGroup=c.g("axis-labels").attr({zIndex:p.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels").add();if(k||a.isLinked){a.labelAlign=o(p.align||a.autoLabelAlign(p.rotation));q(e,function(b){f[b]?f[b].addLabel():f[b]=new Za(a,b)});if(a.horiz&&!a.staggerLines&&y&&!p.rotation){for(s=a.reversed?[].concat(e).reverse():e;v<y;){k=[];z=!1;for(p=0;p<s.length;p++)A=s[p],B=(B=f[A].label&&f[A].label.getBBox())?B.width:0,D=p%v,B&&(A=a.translate(A),k[D]!==r&&A<k[D]&&(z=!0),k[D]=A+B);if(z)v++;
|
||||
else break}if(v>1)a.staggerLines=v}q(e,function(b){if(h===0||h===2||{1:"left",3:"right"}[h]===a.labelAlign)u=w(f[b].getLabelSize(),u)});if(a.staggerLines)u*=a.staggerLines,a.labelOffset=u}else for(s in f)f[s].destroy(),delete f[s];if(n&&n.text&&n.enabled!==!1){if(!a.axisTitle)a.axisTitle=c.text(n.text,0,0,n.useHTML).attr({zIndex:7,rotation:n.rotation||0,align:n.textAlign||{low:"left",middle:"center",high:"right"}[n.align]}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(n.style).add(a.axisGroup),
|
||||
a.axisTitle.isNew=!0;if(b)j=a.axisTitle.getBBox()[g?"height":"width"],m=o(n.margin,g?5:10),l=n.offset;a.axisTitle[b?"show":"hide"]()}a.offset=x*o(d.offset,Db[h]);a.axisTitleMargin=o(l,u+m+(u&&x*d.labels[g?"y":"x"]-U));Db[h]=w(Db[h],a.axisTitleMargin+j+x*a.offset);G[i]=w(G[i],S(d.lineWidth/2)*2)},getLinePath:function(a){var b=this.chart,c=this.opposite,d=this.offset,e=this.horiz,f=this.left+(c?this.width:0)+d,d=b.chartHeight-this.bottom-(c?this.height:0)+d;c&&(a*=-1);return b.renderer.crispLine(["M",
|
||||
e?this.left:f,e?d:this.top,"L",e?b.chartWidth-this.right:f,e?d:b.chartHeight-this.bottom],a)},getTitlePosition:function(){var a=this.horiz,b=this.left,c=this.top,d=this.len,e=this.options.title,f=a?b:c,g=this.opposite,h=this.offset,i=I(e.style.fontSize||12),d={low:f+(a?0:d),middle:f+d/2,high:f+(a?d:0)}[e.align],b=(a?c+this.height:b)+(a?1:-1)*(g?-1:1)*this.axisTitleMargin+(this.side===2?i:0);return{x:a?d:b+(g?this.width:0)+h+(e.x||0),y:a?b-(g?this.height:0)+h:d+(e.y||0)}},render:function(){var a=this,
|
||||
b=a.horiz,c=a.reversed,d=a.chart,e=d.renderer,f=a.options,g=a.isLog,h=a.isLinked,i=a.tickPositions,k,j=a.axisTitle,l=a.ticks,m=a.minorTicks,n=a.alternateBands,p=f.stackLabels,u=f.alternateGridColor,o=a.tickmarkOffset,G=f.lineWidth,x=d.hasRendered&&t(a.oldMin)&&!isNaN(a.oldMin),s=a.hasData,w=a.showAxis,v,y=f.labels.overflow,z=a.justifyLabels=b&&y!==!1,A;a.labelEdge.length=0;a.justifyToPlot=y==="justify";q([l,m,n],function(a){for(var b in a)a[b].isActive=!1});if(s||h)if(a.minorTickInterval&&!a.categories&&
|
||||
q(a.getMinorTickPositions(),function(b){m[b]||(m[b]=new Za(a,b,"minor"));x&&m[b].isNew&&m[b].render(null,!0);m[b].render(null,!1,1)}),i.length&&(k=i.slice(),(b&&c||!b&&!c)&&k.reverse(),z&&(k=k.slice(1).concat([k[0]])),q(k,function(b,c){z&&(c=c===k.length-1?0:c+1);if(!h||b>=a.min&&b<=a.max)l[b]||(l[b]=new Za(a,b)),x&&l[b].isNew&&l[b].render(c,!0,0.1),l[b].render(c,!1,1)}),o&&a.min===0&&(l[-1]||(l[-1]=new Za(a,-1,null,!0)),l[-1].render(-1))),u&&q(i,function(b,c){if(c%2===0&&b<a.max)n[b]||(n[b]=new P.PlotLineOrBand(a)),
|
||||
v=b+o,A=i[c+1]!==r?i[c+1]+o:a.max,n[b].options={from:g?oa(v):v,to:g?oa(A):A,color:u},n[b].render(),n[b].isActive=!0}),!a._addedPlotLB)q((f.plotLines||[]).concat(f.plotBands||[]),function(b){a.addPlotBandOrLine(b)}),a._addedPlotLB=!0;q([l,m,n],function(a){var b,c,e=[],f=Ca?Ca.duration||500:0,g=function(){for(c=e.length;c--;)a[e[c]]&&!a[e[c]].isActive&&(a[e[c]].destroy(),delete a[e[c]])};for(b in a)if(!a[b].isActive)a[b].render(b,!1,0),a[b].isActive=!1,e.push(b);a===n||!d.hasRendered||!f?g():f&&setTimeout(g,
|
||||
f)});if(G)b=a.getLinePath(G),a.axisLine?a.axisLine.animate({d:b}):a.axisLine=e.path(b).attr({stroke:f.lineColor,"stroke-width":G,zIndex:7}).add(a.axisGroup),a.axisLine[w?"show":"hide"]();if(j&&w)j[j.isNew?"attr":"animate"](a.getTitlePosition()),j.isNew=!1;p&&p.enabled&&a.renderStackTotals();a.isDirty=!1},redraw:function(){var a=this.chart.pointer;a&&a.reset(!0);this.render();q(this.plotLinesAndBands,function(a){a.render()});q(this.series,function(a){a.isDirty=!0})},destroy:function(a){var b=this,
|
||||
c=b.stacks,d,e=b.plotLinesAndBands;a||R(b);for(d in c)Ka(c[d]),c[d]=null;q([b.ticks,b.minorTicks,b.alternateBands],function(a){Ka(a)});for(a=e.length;a--;)e[a].destroy();q("stackTotalGroup,axisLine,axisTitle,axisGroup,cross,gridGroup,labelGroup".split(","),function(a){b[a]&&(b[a]=b[a].destroy())});this.cross&&this.cross.destroy()},drawCrosshair:function(a,b){if(this.crosshair)if((t(b)||!o(this.crosshair.snap,!0))===!1)this.hideCrosshair();else{var c,d=this.crosshair,e=d.animation;o(d.snap,!0)?t(b)&&
|
||||
(c=this.chart.inverted!=this.horiz?b.plotX:this.len-b.plotY):c=this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos;c=this.isRadial?this.getPlotLinePath(this.isXAxis?b.x:o(b.stackY,b.y)):this.getPlotLinePath(null,null,null,null,c);if(c===null)this.hideCrosshair();else if(this.cross)this.cross.attr({visibility:"visible"})[e?"animate":"attr"]({d:c},e);else{e={"stroke-width":d.width||1,stroke:d.color||"#C0C0C0",zIndex:d.zIndex||2};if(d.dashStyle)e.dashstyle=d.dashStyle;this.cross=this.chart.renderer.path(c).attr(e).add()}}},
|
||||
hideCrosshair:function(){this.cross&&this.cross.hide()}};v(L.prototype,{getPlotBandPath:function(a,b){var c=this.getPlotLinePath(b),d=this.getPlotLinePath(a);d&&c?d.push(c[4],c[5],c[1],c[2]):d=null;return d},addPlotBand:function(a){this.addPlotBandOrLine(a,"plotBands")},addPlotLine:function(a){this.addPlotBandOrLine(a,"plotLines")},addPlotBandOrLine:function(a,b){var c=(new P.PlotLineOrBand(this,a)).render(),d=this.userOptions;c&&(b&&(d[b]=d[b]||[],d[b].push(a)),this.plotLinesAndBands.push(c));return c},
|
||||
removePlotBandOrLine:function(a){for(var b=this.plotLinesAndBands,c=this.options,d=this.userOptions,e=b.length;e--;)b[e].id===a&&b[e].destroy();q([c.plotLines||[],d.plotLines||[],c.plotBands||[],d.plotBands||[]],function(b){for(e=b.length;e--;)b[e].id===a&&pa(b,b[e])})}});L.prototype.getTimeTicks=function(a,b,c,d){var e=[],f={},g=F.global.useUTC,h,i=new Date(b-La),k=a.unitRange,j=a.count;if(t(b)){k>=H.second&&(i.setMilliseconds(0),i.setSeconds(k>=H.minute?0:j*S(i.getSeconds()/j)));if(k>=H.minute)i[Nb](k>=
|
||||
H.hour?0:j*S(i[ub]()/j));if(k>=H.hour)i[Ob](k>=H.day?0:j*S(i[vb]()/j));if(k>=H.day)i[xb](k>=H.month?1:j*S(i[Ua]()/j));k>=H.month&&(i[Pb](k>=H.year?0:j*S(i[jb]()/j)),h=i[kb]());k>=H.year&&(h-=h%j,i[Qb](h));if(k===H.week)i[xb](i[Ua]()-i[wb]()+o(d,1));b=1;La&&(i=new Date(i.getTime()+La));h=i[kb]();for(var d=i.getTime(),l=i[jb](),m=i[Ua](),n=g?La:(864E5+i.getTimezoneOffset()*6E4)%864E5;d<c;)e.push(d),k===H.year?d=ib(h+b*j,0):k===H.month?d=ib(h,l+b*j):!g&&(k===H.day||k===H.week)?d=ib(h,l,m+b*j*(k===H.day?
|
||||
1:7)):d+=k*j,b++;e.push(d);q(Cb(e,function(a){return k<=H.hour&&a%H.day===n}),function(a){f[a]="day"})}e.info=v(a,{higherRanks:f,totalRange:k*j});return e};L.prototype.normalizeTimeTickInterval=function(a,b){var c=b||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],d=c[c.length-1],e=H[d[0]],f=d[1],g;for(g=0;g<c.length;g++)if(d=c[g],e=H[d[0]],f=d[1],c[g+
|
||||
1]&&a<=(e*f[f.length-1]+H[c[g+1][0]])/2)break;e===H.year&&a<5*e&&(f=[1,2,5]);c=sb(a/e,f,d[0]==="year"?w(rb(a/e),1):1);return{unitRange:e,count:c,unitName:d[0]}};L.prototype.getLogTickPositions=function(a,b,c,d){var e=this.options,f=this.len,g=[];if(!d)this._minorAutoInterval=null;if(a>=0.5)a=s(a),g=this.getLinearTickPositions(a,b,c);else if(a>=0.08)for(var f=S(b),h,i,k,j,l,e=a>0.3?[1,2,4]:a>0.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];f<c+1&&!l;f++){i=e.length;for(h=0;h<i&&!l;h++)k=Ga(oa(f)*e[h]),k>b&&(!d||
|
||||
j<=c)&&g.push(j),j>c&&(l=!0),j=k}else if(b=oa(b),c=oa(c),a=e[d?"minorTickInterval":"tickInterval"],a=o(a==="auto"?null:a,this._minorAutoInterval,(c-b)*(e.tickPixelInterval/(d?5:1))/((d?f/this.tickPositions.length:f)||1)),a=sb(a,null,rb(a)),g=xa(this.getLinearTickPositions(a,b,c),Ga),!d)this._minorAutoInterval=a/5;if(!d)this.tickInterval=a;return g};var Hb=P.Tooltip=function(){this.init.apply(this,arguments)};Hb.prototype={init:function(a,b){var c=b.borderWidth,d=b.style,e=I(d.padding);this.chart=
|
||||
a;this.options=b;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.label=a.renderer.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,"tooltip").attr({padding:e,fill:b.backgroundColor,"stroke-width":c,r:b.borderRadius,zIndex:8}).css(d).css({padding:0}).add().attr({y:-9999});ja||this.label.shadow(b.shadow);this.shared=b.shared},destroy:function(){if(this.label)this.label=this.label.destroy();clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,b,c,d){var e=
|
||||
this,f=e.now,g=e.options.animation!==!1&&!e.isHidden,h=e.followPointer||e.len>1;v(f,{x:g?(2*f.x+a)/3:a,y:g?(f.y+b)/2:b,anchorX:h?r:g?(2*f.anchorX+c)/3:c,anchorY:h?r:g?(f.anchorY+d)/2:d});e.label.attr(f);if(g&&(M(a-f.x)>1||M(b-f.y)>1))clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){e&&e.move(a,b,c,d)},32)},hide:function(){var a=this,b;clearTimeout(this.hideTimer);if(!this.isHidden)b=this.chart.hoverPoints,this.hideTimer=setTimeout(function(){a.label.fadeOut();a.isHidden=
|
||||
!0},o(this.options.hideDelay,500)),b&&q(b,function(a){a.setState()}),this.chart.hoverPoints=null},getAnchor:function(a,b){var c,d=this.chart,e=d.inverted,f=d.plotTop,g=0,h=0,i,a=ma(a);c=a[0].tooltipPos;this.followPointer&&b&&(b.chartX===r&&(b=d.pointer.normalize(b)),c=[b.chartX-d.plotLeft,b.chartY-f]);c||(q(a,function(a){i=a.series.yAxis;g+=a.plotX;h+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&i?i.top-f:0)}),g/=a.length,h/=a.length,c=[e?d.plotWidth-h:g,this.shared&&!e&&a.length>1&&b?b.chartY-
|
||||
f:e?d.plotHeight-g:h]);return xa(c,s)},getPosition:function(a,b,c){var d=this.chart,e=this.distance,f={},g,h=["y",d.chartHeight,b,c.plotY+d.plotTop],i=["x",d.chartWidth,a,c.plotX+d.plotLeft],k=c.ttBelow||d.inverted&&!c.negative||!d.inverted&&c.negative,j=function(a,b,c,d){var g=c<d-e,b=d+e+c<b,c=d-e-c;d+=e;if(k&&b)f[a]=d;else if(!k&&g)f[a]=c;else if(g)f[a]=c;else if(b)f[a]=d;else return!1},l=function(a,b,c,d){if(d<e||d>b-e)return!1;else f[a]=d<c/2?1:d>b-c/2?b-c-2:d-c/2},m=function(a){var b=h;h=i;
|
||||
i=b;g=a},n=function(){j.apply(0,h)!==!1?l.apply(0,i)===!1&&!g&&(m(!0),n()):g?f.x=f.y=0:(m(!0),n())};(d.inverted||this.len>1)&&m();n();return f},defaultFormatter:function(a){var b=this.points||ma(this),c=b[0].series,d;d=[a.tooltipHeaderFormatter(b[0])];q(b,function(a){c=a.series;d.push(c.tooltipFormatter&&c.tooltipFormatter(a)||a.point.tooltipFormatter(c.tooltipOptions.pointFormat))});d.push(a.options.footerFormat||"");return d.join("")},refresh:function(a,b){var c=this.chart,d=this.label,e=this.options,
|
||||
f,g,h={},i,k=[];i=e.formatter||this.defaultFormatter;var h=c.hoverPoints,j,l=this.shared;clearTimeout(this.hideTimer);this.followPointer=ma(a)[0].series.tooltipOptions.followPointer;g=this.getAnchor(a,b);f=g[0];g=g[1];l&&(!a.series||!a.series.noSharedTooltip)?(c.hoverPoints=a,h&&q(h,function(a){a.setState()}),q(a,function(a){a.setState("hover");k.push(a.getLabelConfig())}),h={x:a[0].category,y:a[0].y},h.points=k,this.len=k.length,a=a[0]):h=a.getLabelConfig();i=i.call(h,this);h=a.series;this.distance=
|
||||
o(h.tooltipOptions.distance,16);i===!1?this.hide():(this.isHidden&&(eb(d),d.attr("opacity",1).show()),d.attr({text:i}),j=e.borderColor||a.color||h.color||"#606060",d.attr({stroke:j}),this.updatePosition({plotX:f,plotY:g,negative:a.negative,ttBelow:a.ttBelow}),this.isHidden=!1);N(c,"tooltipRefresh",{text:i,x:f+c.plotLeft,y:g+c.plotTop,borderColor:j})},updatePosition:function(a){var b=this.chart,c=this.label,c=(this.options.positioner||this.getPosition).call(this,c.width,c.height,a);this.move(s(c.x),
|
||||
s(c.y),a.plotX+b.plotLeft,a.plotY+b.plotTop)},tooltipHeaderFormatter:function(a){var b=a.series,c=b.tooltipOptions,d=c.dateTimeLabelFormats,e=c.xDateFormat,f=b.xAxis,g=f&&f.options.type==="datetime"&&la(a.key),c=c.headerFormat,f=f&&f.closestPointRange,h;if(g&&!e){if(f)for(h in H){if(H[h]>=f||H[h]<=H.day&&a.key%H[h]>0){e=d[h];break}}else e=d.day;e=e||d.year}g&&e&&(c=c.replace("{point.key}","{point.key:"+e+"}"));return Ja(c,{point:a,series:b})}};var sa;ab=B.documentElement.ontouchstart!==r;var Xa=P.Pointer=
|
||||
function(a,b){this.init(a,b)};Xa.prototype={init:function(a,b){var c=b.chart,d=c.events,e=ja?"":c.zoomType,c=a.inverted,f;this.options=b;this.chart=a;this.zoomX=f=/x/.test(e);this.zoomY=e=/y/.test(e);this.zoomHor=f&&!c||e&&c;this.zoomVert=e&&!c||f&&c;this.hasZoom=f||e;this.runChartClick=d&&!!d.click;this.pinchDown=[];this.lastValidTouch={};if(P.Tooltip&&b.tooltip.enabled)a.tooltip=new Hb(a,b.tooltip),this.followTouchMove=b.tooltip.followTouchMove;this.setDOMEvents()},normalize:function(a,b){var c,
|
||||
d,a=a||window.event,a=cc(a);if(!a.target)a.target=a.srcElement;d=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a;if(!b)this.chartPosition=b=bc(this.chart.container);d.pageX===r?(c=w(a.x,a.clientX-b.left),d=a.y):(c=d.pageX-b.left,d=d.pageY-b.top);return v(a,{chartX:s(c),chartY:s(d)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};q(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})});return b},getIndex:function(a){var b=
|
||||
this.chart;return b.inverted?b.plotHeight+b.plotTop-a.chartY:a.chartX-b.plotLeft},runPointActions:function(a){var b=this.chart,c=b.series,d=b.tooltip,e,f,g=b.hoverPoint,h=b.hoverSeries,i,k,j=b.chartWidth,l=this.getIndex(a);if(d&&this.options.tooltip.shared&&(!h||!h.noSharedTooltip)){f=[];i=c.length;for(k=0;k<i;k++)if(c[k].visible&&c[k].options.enableMouseTracking!==!1&&!c[k].noSharedTooltip&&c[k].singularTooltips!==!0&&c[k].tooltipPoints.length&&(e=c[k].tooltipPoints[l])&&e.series)e._dist=M(l-e.clientX),
|
||||
j=z(j,e._dist),f.push(e);for(i=f.length;i--;)f[i]._dist>j&&f.splice(i,1);if(f.length&&f[0].clientX!==this.hoverX)d.refresh(f,a),this.hoverX=f[0].clientX}c=h&&h.tooltipOptions.followPointer;if(h&&h.tracker&&!c){if((e=h.tooltipPoints[l])&&e!==g)e.onMouseOver(a)}else d&&c&&!d.isHidden&&(h=d.getAnchor([{}],a),d.updatePosition({plotX:h[0],plotY:h[1]}));if(d&&!this._onDocumentMouseMove)this._onDocumentMouseMove=function(a){if(aa[sa])aa[sa].pointer.onDocumentMouseMove(a)},A(B,"mousemove",this._onDocumentMouseMove);
|
||||
q(b.axes,function(b){b.drawCrosshair(a,o(e,g))})},reset:function(a){var b=this.chart,c=b.hoverSeries,d=b.hoverPoint,e=b.tooltip,f=e&&e.shared?b.hoverPoints:d;(a=a&&e&&f)&&ma(f)[0].plotX===r&&(a=!1);if(a)e.refresh(f),d&&d.setState(d.state,!0);else{if(d)d.onMouseOut();if(c)c.onMouseOut();e&&e.hide();if(this._onDocumentMouseMove)R(B,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null;q(b.axes,function(a){a.hideCrosshair()});this.hoverX=null}},scaleGroups:function(a,b){var c=this.chart,
|
||||
d;q(c.series,function(e){d=a||e.getPlotBox();e.xAxis&&e.xAxis.zoomEnabled&&(e.group.attr(d),e.markerGroup&&(e.markerGroup.attr(d),e.markerGroup.clip(b?c.clipRect:null)),e.dataLabelsGroup&&e.dataLabelsGroup.attr(d))});c.clipRect.attr(b||c.clipBox)},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type;b.cancelClick=!1;b.mouseDownX=this.mouseDownX=a.chartX;b.mouseDownY=this.mouseDownY=a.chartY},drag:function(a){var b=this.chart,c=b.options.chart,d=a.chartX,e=a.chartY,f=this.zoomHor,g=this.zoomVert,
|
||||
h=b.plotLeft,i=b.plotTop,k=b.plotWidth,j=b.plotHeight,l,m=this.mouseDownX,n=this.mouseDownY;d<h?d=h:d>h+k&&(d=h+k);e<i?e=i:e>i+j&&(e=i+j);this.hasDragged=Math.sqrt(Math.pow(m-d,2)+Math.pow(n-e,2));if(this.hasDragged>10){l=b.isInsidePlot(m-h,n-i);if(b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&l&&!this.selectionMarker)this.selectionMarker=b.renderer.rect(h,i,f?1:k,g?1:j,0).attr({fill:c.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add();this.selectionMarker&&f&&(d-=m,this.selectionMarker.attr({width:M(d),
|
||||
x:(d>0?0:d)+m}));this.selectionMarker&&g&&(d=e-n,this.selectionMarker.attr({height:M(d),y:(d>0?0:d)+n}));l&&!this.selectionMarker&&c.panning&&b.pan(a,c.panning)}},drop:function(a){var b=this.chart,c=this.hasPinched;if(this.selectionMarker){var d={xAxis:[],yAxis:[],originalEvent:a.originalEvent||a},a=this.selectionMarker,e=a.attr?a.attr("x"):a.x,f=a.attr?a.attr("y"):a.y,g=a.attr?a.attr("width"):a.width,h=a.attr?a.attr("height"):a.height,i;if(this.hasDragged||c)q(b.axes,function(a){if(a.zoomEnabled){var b=
|
||||
a.horiz,c=a.toValue(b?e:f),b=a.toValue(b?e+g:f+h);!isNaN(c)&&!isNaN(b)&&(d[a.coll].push({axis:a,min:z(c,b),max:w(c,b)}),i=!0)}}),i&&N(b,"selection",d,function(a){b.zoom(v(a,c?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();c&&this.scaleGroups()}if(b)E(b.container,{cursor:b._cursor}),b.cancelClick=this.hasDragged>10,b.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[]},onContainerMouseDown:function(a){a=this.normalize(a);a.preventDefault&&a.preventDefault();
|
||||
this.dragStart(a)},onDocumentMouseUp:function(a){aa[sa]&&aa[sa].pointer.drop(a)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition,d=b.hoverSeries,a=this.normalize(a,c);c&&d&&!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&this.reset()},onContainerMouseLeave:function(){var a=aa[sa];if(a)a.pointer.reset(),a.pointer.chartPosition=null},onContainerMouseMove:function(a){var b=this.chart;sa=b.index;a=this.normalize(a);b.mouseIsDown===
|
||||
"mousedown"&&this.drag(a);(this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop))&&!b.openMenu&&this.runPointActions(a)},inClass:function(a,b){for(var c;a;){if(c=W(a,"class"))if(c.indexOf(b)!==-1)return!0;else if(c.indexOf("highcharts-container")!==-1)return!1;a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries,c=(a=a.relatedTarget||a.toElement)&&a.point&&a.point.series;if(b&&!b.options.stickyTracking&&!this.inClass(a,"highcharts-tooltip")&&
|
||||
c!==b)b.onMouseOut()},onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop,a=this.normalize(a);a.cancelBubble=!0;b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(N(c.series,"click",v(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(v(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&N(b,"click",a)))},setDOMEvents:function(){var a=this,b=a.chart.container;b.onmousedown=function(b){a.onContainerMouseDown(b)};b.onmousemove=function(b){a.onContainerMouseMove(b)};
|
||||
b.onclick=function(b){a.onContainerClick(b)};A(b,"mouseleave",a.onContainerMouseLeave);db===1&&A(B,"mouseup",a.onDocumentMouseUp);if(ab)b.ontouchstart=function(b){a.onContainerTouchStart(b)},b.ontouchmove=function(b){a.onContainerTouchMove(b)},db===1&&A(B,"touchend",a.onDocumentTouchEnd)},destroy:function(){var a;R(this.chart.container,"mouseleave",this.onContainerMouseLeave);db||(R(B,"mouseup",this.onDocumentMouseUp),R(B,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(a in this)this[a]=
|
||||
null}};v(P.Pointer.prototype,{pinchTranslate:function(a,b,c,d,e,f){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,a,b,c,d,e,f);(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,a,b,c,d,e,f)},pinchTranslateDirection:function(a,b,c,d,e,f,g,h){var i=this.chart,k=a?"x":"y",j=a?"X":"Y",l="chart"+j,m=a?"width":"height",n=i["plot"+(a?"Left":"Top")],p,u,o=h||1,q=i.inverted,x=i.bounds[a?"h":"v"],r=b.length===1,s=b[0][l],t=c[0][l],w=!r&&b[1][l],v=!r&&c[1][l],y,c=function(){!r&&
|
||||
M(s-w)>20&&(o=h||M(t-v)/M(s-w));u=(n-t)/o+s;p=i["plot"+(a?"Width":"Height")]/o};c();b=u;b<x.min?(b=x.min,y=!0):b+p>x.max&&(b=x.max-p,y=!0);y?(t-=0.8*(t-g[k][0]),r||(v-=0.8*(v-g[k][1])),c()):g[k]=[t,v];q||(f[k]=u-n,f[m]=p);f=q?1/o:o;e[m]=p;e[k]=b;d[q?a?"scaleY":"scaleX":"scale"+j]=o;d["translate"+j]=f*n+(t-f*s)},pinch:function(a){var b=this,c=b.chart,d=b.pinchDown,e=b.followTouchMove,f=a.touches,g=f.length,h=b.lastValidTouch,i=b.hasZoom,k=b.selectionMarker,j={},l=g===1&&(b.inClass(a.target,"highcharts-tracker")&&
|
||||
c.runTrackerClick||c.runChartClick),m={};(i||e)&&!l&&a.preventDefault();xa(f,function(a){return b.normalize(a)});if(a.type==="touchstart")q(f,function(a,b){d[b]={chartX:a.chartX,chartY:a.chartY}}),h.x=[d[0].chartX,d[1]&&d[1].chartX],h.y=[d[0].chartY,d[1]&&d[1].chartY],q(c.axes,function(a){if(a.zoomEnabled){var b=c.bounds[a.horiz?"h":"v"],d=a.minPixelPadding,e=a.toPixels(a.dataMin),f=a.toPixels(a.dataMax),g=z(e,f),e=w(e,f);b.min=z(a.pos,g-d);b.max=w(a.pos+a.len,e+d)}});else if(d.length){if(!k)b.selectionMarker=
|
||||
k=v({destroy:na},c.plotBox);b.pinchTranslate(d,f,j,k,m,h);b.hasPinched=i;b.scaleGroups(j,m);!i&&e&&g===1&&this.runPointActions(b.normalize(a))}},onContainerTouchStart:function(a){var b=this.chart;sa=b.index;a.touches.length===1?(a=this.normalize(a),b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)?(this.runPointActions(a),this.pinch(a)):this.reset()):a.touches.length===2&&this.pinch(a)},onContainerTouchMove:function(a){(a.touches.length===1||a.touches.length===2)&&this.pinch(a)},onDocumentTouchEnd:function(a){aa[sa]&&
|
||||
aa[sa].pointer.drop(a)}});if(X.PointerEvent||X.MSPointerEvent){var ya={},Ib=!!X.PointerEvent,gc=function(){var a,b=[];b.item=function(a){return this[a]};for(a in ya)ya.hasOwnProperty(a)&&b.push({pageX:ya[a].pageX,pageY:ya[a].pageY,target:ya[a].target});return b},Jb=function(a,b,c,d){a=a.originalEvent||a;if((a.pointerType==="touch"||a.pointerType===a.MSPOINTER_TYPE_TOUCH)&&aa[sa])d(a),d=aa[sa].pointer,d[b]({type:c,target:a.currentTarget,preventDefault:na,touches:gc()})};v(Xa.prototype,{onContainerPointerDown:function(a){Jb(a,
|
||||
"onContainerTouchStart","touchstart",function(a){ya[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){Jb(a,"onContainerTouchMove","touchmove",function(a){ya[a.pointerId]={pageX:a.pageX,pageY:a.pageY};if(!ya[a.pointerId].target)ya[a.pointerId].target=a.currentTarget})},onDocumentPointerUp:function(a){Jb(a,"onContainerTouchEnd","touchend",function(a){delete ya[a.pointerId]})},batchMSEvents:function(a){a(this.chart.container,Ib?"pointerdown":"MSPointerDown",
|
||||
this.onContainerPointerDown);a(this.chart.container,Ib?"pointermove":"MSPointerMove",this.onContainerPointerMove);a(B,Ib?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});O(Xa.prototype,"init",function(a,b,c){a.call(this,b,c);(this.hasZoom||this.followTouchMove)&&E(b.container,{"-ms-touch-action":Y,"touch-action":Y})});O(Xa.prototype,"setDOMEvents",function(a){a.apply(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(A)});O(Xa.prototype,"destroy",function(a){this.batchMSEvents(R);
|
||||
a.call(this)})}var pb=P.Legend=function(a,b){this.init(a,b)};pb.prototype={init:function(a,b){var c=this,d=b.itemStyle,e=o(b.padding,8),f=b.itemMarginTop||0;this.options=b;if(b.enabled)c.baseline=I(d.fontSize)+3+f,c.itemStyle=d,c.itemHiddenStyle=y(d,b.itemHiddenStyle),c.itemMarginTop=f,c.padding=e,c.initialItemX=e,c.initialItemY=e-5,c.maxItemWidth=0,c.chart=a,c.itemHeight=0,c.lastLineHeight=0,c.symbolWidth=o(b.symbolWidth,16),c.pages=[],c.render(),A(c.chart,"endResize",function(){c.positionCheckboxes()})},
|
||||
colorizeItem:function(a,b){var c=this.options,d=a.legendItem,e=a.legendLine,f=a.legendSymbol,g=this.itemHiddenStyle.color,c=b?c.itemStyle.color:g,h=b?a.legendColor||a.color||"#CCC":g,g=a.options&&a.options.marker,i={fill:h},k;d&&d.css({fill:c,color:c});e&&e.attr({stroke:h});if(f){if(g&&f.isMarker)for(k in i.stroke=h,g=a.convertAttribs(g),g)d=g[k],d!==r&&(i[k]=d);f.attr(i)}},positionItem:function(a){var b=this.options,c=b.symbolPadding,b=!b.rtl,d=a._legendItemPos,e=d[0],d=d[1],f=a.checkbox;a.legendGroup&&
|
||||
a.legendGroup.translate(b?e:this.legendWidth-e-2*c-4,d);if(f)f.x=e,f.y=d},destroyItem:function(a){var b=a.checkbox;q(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())});b&&Sa(a.checkbox)},destroy:function(){var a=this.group,b=this.box;if(b)this.box=b.destroy();if(a)this.group=a.destroy()},positionCheckboxes:function(a){var b=this.group.alignAttr,c,d=this.clipHeight||this.legendHeight;if(b)c=b.translateY,q(this.allItems,function(e){var f=e.checkbox,g;
|
||||
f&&(g=c+f.y+(a||0)+3,E(f,{left:b.translateX+e.checkboxOffset+f.x-20+"px",top:g+"px",display:g>c-6&&g<c+d-6?"":Y}))})},renderTitle:function(){var a=this.padding,b=this.options.title,c=0;if(b.text){if(!this.title)this.title=this.chart.renderer.label(b.text,a-3,a-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(b.style).add(this.group);a=this.title.getBBox();c=a.height;this.offsetWidth=a.width;this.contentGroup.attr({translateY:c})}this.titleHeight=c},renderItem:function(a){var b=this.chart,
|
||||
c=b.renderer,d=this.options,e=d.layout==="horizontal",f=this.symbolWidth,g=d.symbolPadding,h=this.itemStyle,i=this.itemHiddenStyle,k=this.padding,j=e?o(d.itemDistance,20):0,l=!d.rtl,m=d.width,n=d.itemMarginBottom||0,p=this.itemMarginTop,u=this.initialItemX,q=a.legendItem,G=a.series&&a.series.drawLegendSymbol?a.series:a,x=G.options,x=this.createCheckboxForItem&&x&&x.showCheckbox,r=d.useHTML;if(!q)a.legendGroup=c.g("legend-item").attr({zIndex:1}).add(this.scrollGroup),G.drawLegendSymbol(this,a),a.legendItem=
|
||||
q=c.text(d.labelFormat?Ja(d.labelFormat,a):d.labelFormatter.call(a),l?f+g:-g,this.baseline,r).css(y(a.visible?h:i)).attr({align:l?"left":"right",zIndex:2}).add(a.legendGroup),this.setItemEvents&&this.setItemEvents(a,q,r,h,i),this.colorizeItem(a,a.visible),x&&this.createCheckboxForItem(a);c=q.getBBox();f=a.checkboxOffset=d.itemWidth||a.legendItemWidth||f+g+c.width+j+(x?20:0);this.itemHeight=g=s(a.legendItemHeight||c.height);if(e&&this.itemX-u+f>(m||b.chartWidth-2*k-u-d.x))this.itemX=u,this.itemY+=
|
||||
p+this.lastLineHeight+n,this.lastLineHeight=0;this.maxItemWidth=w(this.maxItemWidth,f);this.lastItemY=p+this.itemY+n;this.lastLineHeight=w(g,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];e?this.itemX+=f:(this.itemY+=p+g+n,this.lastLineHeight=g);this.offsetWidth=m||w((e?this.itemX-u-j:f)+k,this.offsetWidth)},getAllItems:function(){var a=[];q(this.chart.series,function(b){var c=b.options;if(o(c.showInLegend,!t(c.linkedTo)?r:!1,!0))a=a.concat(b.legendItems||(c.legendType==="point"?b.data:
|
||||
b))});return a},render:function(){var a=this,b=a.chart,c=b.renderer,d=a.group,e,f,g,h,i=a.box,k=a.options,j=a.padding,l=k.borderWidth,m=k.backgroundColor;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;if(!d)a.group=d=c.g("legend").attr({zIndex:7}).add(),a.contentGroup=c.g().attr({zIndex:1}).add(d),a.scrollGroup=c.g().add(a.contentGroup);a.renderTitle();e=a.getAllItems();tb(e,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});
|
||||
k.reversed&&e.reverse();a.allItems=e;a.display=f=!!e.length;q(e,function(b){a.renderItem(b)});g=k.width||a.offsetWidth;h=a.lastItemY+a.lastLineHeight+a.titleHeight;h=a.handleOverflow(h);if(l||m){g+=j;h+=j;if(i){if(g>0&&h>0)i[i.isNew?"attr":"animate"](i.crisp({width:g,height:h})),i.isNew=!1}else a.box=i=c.rect(0,0,g,h,k.borderRadius,l||0).attr({stroke:k.borderColor,"stroke-width":l||0,fill:m||Y}).add(d).shadow(k.shadow),i.isNew=!0;i[f?"show":"hide"]()}a.legendWidth=g;a.legendHeight=h;q(e,function(b){a.positionItem(b)});
|
||||
f&&d.align(v({width:g,height:h},k),!0,"spacingBox");b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var b=this,c=this.chart,d=c.renderer,e=this.options,f=e.y,f=c.spacingBox.height+(e.verticalAlign==="top"?-f:f)-this.padding,g=e.maxHeight,h,i=this.clipRect,k=e.navigation,j=o(k.animation,!0),l=k.arrowSize||12,m=this.nav,n=this.pages,p,u=this.allItems;e.layout==="horizontal"&&(f/=2);g&&(f=z(f,g));n.length=0;if(a>f&&!e.useHTML){this.clipHeight=h=f-20-this.titleHeight-this.padding;
|
||||
this.currentPage=o(this.currentPage,1);this.fullHeight=a;q(u,function(a,b){var c=a._legendItemPos[1],d=s(a.legendItem.getBBox().height),e=n.length;if(!e||c-n[e-1]>h&&(p||c)!==n[e-1])n.push(p||c),e++;b===u.length-1&&c+d-n[e-1]>h&&n.push(c);c!==p&&(p=c)});if(!i)i=b.clipRect=d.clipRect(0,this.padding,9999,0),b.contentGroup.clip(i);i.attr({height:h});if(!m)this.nav=m=d.g().attr({zIndex:1}).add(this.group),this.up=d.symbol("triangle",0,0,l,l).on("click",function(){b.scroll(-1,j)}).add(m),this.pager=d.text("",
|
||||
15,10).css(k.style).add(m),this.down=d.symbol("triangle-down",0,0,l,l).on("click",function(){b.scroll(1,j)}).add(m);b.scroll(0);a=f}else if(m)i.attr({height:c.chartHeight}),m.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0;return a},scroll:function(a,b){var c=this.pages,d=c.length,e=this.currentPage+a,f=this.clipHeight,g=this.options.navigation,h=g.activeColor,g=g.inactiveColor,i=this.pager,k=this.padding;e>d&&(e=d);if(e>0)b!==r&&Ya(b,this.chart),this.nav.attr({translateX:k,translateY:f+
|
||||
this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:e===1?g:h}).css({cursor:e===1?"default":"pointer"}),i.attr({text:e+"/"+d}),this.down.attr({x:18+this.pager.getBBox().width,fill:e===d?g:h}).css({cursor:e===d?"default":"pointer"}),c=-c[e-1]+this.initialItemY,this.scrollGroup.animate({translateY:c}),this.currentPage=e,this.positionCheckboxes(c)}};Q=P.LegendSymbolMixin={drawRectangle:function(a,b){var c=a.options.symbolHeight||12;b.legendSymbol=this.chart.renderer.rect(0,a.baseline-
|
||||
5-c/2,a.symbolWidth,c,a.options.symbolRadius||0).attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var b=this.options,c=b.marker,d;d=a.symbolWidth;var e=this.chart.renderer,f=this.legendGroup,a=a.baseline-s(e.fontMetrics(a.options.itemStyle.fontSize).b*0.3),g;if(b.lineWidth){g={"stroke-width":b.lineWidth};if(b.dashStyle)g.dashstyle=b.dashStyle;this.legendLine=e.path(["M",0,a,"L",d,a]).attr(g).add(f)}if(c&&c.enabled!==!1)b=c.radius,this.legendSymbol=d=e.symbol(this.symbol,d/2-b,a-b,2*
|
||||
b,2*b).add(f),d.isMarker=!0}};(/Trident\/7\.0/.test(Da)||$a)&&O(pb.prototype,"positionItem",function(a,b){var c=this,d=function(){b._legendItemPos&&a.call(c,b)};d();setTimeout(d)});va.prototype={init:function(a,b){var c,d=a.series;a.series=null;c=y(F,a);c.series=a.series=d;this.userOptions=a;d=c.chart;this.margin=this.splashArray("margin",d);this.spacing=this.splashArray("spacing",d);var e=d.events;this.bounds={h:{},v:{}};this.callback=b;this.isResizing=0;this.options=c;this.axes=[];this.series=[];
|
||||
this.hasCartesianSeries=d.showAxes;var f=this,g;f.index=aa.length;aa.push(f);db++;d.reflow!==!1&&A(f,"load",function(){f.initReflow()});if(e)for(g in e)A(f,g,e[g]);f.xAxis=[];f.yAxis=[];f.animation=ja?!1:o(d.animation,!0);f.pointCount=0;f.counters=new Lb;f.firstRender()},initSeries:function(a){var b=this.options.chart;(b=C[a.type||b.type||b.defaultSeriesType])||qa(17,!0);b=new b;b.init(this,a);return b},isInsidePlot:function(a,b,c){var d=c?b:a,a=c?a:b;return d>=0&&d<=this.plotWidth&&a>=0&&a<=this.plotHeight},
|
||||
adjustTickAmounts:function(){this.options.chart.alignTicks!==!1&&q(this.axes,function(a){a.adjustTickAmount()});this.maxTicks=null},redraw:function(a){var b=this.axes,c=this.series,d=this.pointer,e=this.legend,f=this.isDirtyLegend,g,h,i=this.isDirtyBox,k=c.length,j=k,l=this.renderer,m=l.isHidden(),n=[];Ya(a,this);m&&this.cloneRenderTo();for(this.layOutTitles();j--;)if(a=c[j],a.options.stacking&&(g=!0,a.isDirty)){h=!0;break}if(h)for(j=k;j--;)if(a=c[j],a.options.stacking)a.isDirty=!0;q(c,function(a){a.isDirty&&
|
||||
a.options.legendType==="point"&&(f=!0)});if(f&&e.options.enabled)e.render(),this.isDirtyLegend=!1;g&&this.getStacks();if(this.hasCartesianSeries){if(!this.isResizing)this.maxTicks=null,q(b,function(a){a.setScale()});this.adjustTickAmounts();this.getMargins();q(b,function(a){a.isDirty&&(i=!0)});q(b,function(a){if(a.isDirtyExtremes)a.isDirtyExtremes=!1,n.push(function(){N(a,"afterSetExtremes",v(a.eventArgs,a.getExtremes()));delete a.eventArgs});(i||g)&&a.redraw()})}i&&this.drawChartBox();q(c,function(a){a.isDirty&&
|
||||
a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()});d&&d.reset(!0);l.draw();N(this,"redraw");m&&this.cloneRenderTo(!0);q(n,function(a){a.call()})},get:function(a){var b=this.axes,c=this.series,d,e;for(d=0;d<b.length;d++)if(b[d].options.id===a)return b[d];for(d=0;d<c.length;d++)if(c[d].options.id===a)return c[d];for(d=0;d<c.length;d++){e=c[d].points||[];for(b=0;b<e.length;b++)if(e[b].id===a)return e[b]}return null},getAxes:function(){var a=this,b=this.options,c=b.xAxis=ma(b.xAxis||{}),b=b.yAxis=ma(b.yAxis||
|
||||
{});q(c,function(a,b){a.index=b;a.isX=!0});q(b,function(a,b){a.index=b});c=c.concat(b);q(c,function(b){new L(a,b)});a.adjustTickAmounts()},getSelectedPoints:function(){var a=[];q(this.series,function(b){a=a.concat(Cb(b.points||[],function(a){return a.selected}))});return a},getSelectedSeries:function(){return Cb(this.series,function(a){return a.selected})},getStacks:function(){var a=this;q(a.yAxis,function(a){if(a.stacks&&a.hasVisibleSeries)a.oldStacks=a.stacks});q(a.series,function(b){if(b.options.stacking&&
|
||||
(b.visible===!0||a.options.chart.ignoreHiddenSeries===!1))b.stackKey=b.type+o(b.options.stack,"")})},setTitle:function(a,b,c){var g;var d=this,e=d.options,f;f=e.title=y(e.title,a);g=e.subtitle=y(e.subtitle,b),e=g;q([["title",a,f],["subtitle",b,e]],function(a){var b=a[0],c=d[b],e=a[1],a=a[2];c&&e&&(d[b]=c=c.destroy());a&&a.text&&!c&&(d[b]=d.renderer.text(a.text,0,0,a.useHTML).attr({align:a.align,"class":"highcharts-"+b,zIndex:a.zIndex||4}).css(a.style).add())});d.layOutTitles(c)},layOutTitles:function(a){var b=
|
||||
0,c=this.title,d=this.subtitle,e=this.options,f=e.title,e=e.subtitle,g=this.spacingBox.width-44;if(c&&(c.css({width:(f.width||g)+"px"}).align(v({y:15},f),!1,"spacingBox"),!f.floating&&!f.verticalAlign))b=c.getBBox().height;d&&(d.css({width:(e.width||g)+"px"}).align(v({y:b+f.margin},e),!1,"spacingBox"),!e.floating&&!e.verticalAlign&&(b=Va(b+d.getBBox().height)));c=this.titleOffset!==b;this.titleOffset=b;if(!this.isDirtyBox&&c)this.isDirtyBox=c,this.hasRendered&&o(a,!0)&&this.isDirtyBox&&this.redraw()},
|
||||
getChartSize:function(){var a=this.options.chart,b=a.width,a=a.height,c=this.renderToClone||this.renderTo;if(!t(b))this.containerWidth=nb(c,"width");if(!t(a))this.containerHeight=nb(c,"height");this.chartWidth=w(0,b||this.containerWidth||600);this.chartHeight=w(0,o(a,this.containerHeight>19?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;a?b&&(this.renderTo.appendChild(c),Sa(b),delete this.renderToClone):(c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),
|
||||
this.renderToClone=b=this.renderTo.cloneNode(0),E(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),B.body.appendChild(b),c&&b.appendChild(c))},getContainer:function(){var a,b=this.options.chart,c,d,e;this.renderTo=a=b.renderTo;e="highcharts-"+Ab++;if(Oa(a))this.renderTo=a=B.getElementById(a);a||qa(13,!0);c=I(W(a,"data-highcharts-chart"));!isNaN(c)&&aa[c]&&aa[c].hasRendered&&aa[c].destroy();W(a,"data-highcharts-chart",this.index);
|
||||
a.innerHTML="";!b.skipClone&&!a.offsetWidth&&this.cloneRenderTo();this.getChartSize();c=this.chartWidth;d=this.chartHeight;this.container=a=$(Ta,{className:"highcharts-container"+(b.className?" "+b.className:""),id:e},v({position:"relative",overflow:"hidden",width:c+"px",height:d+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},b.style),this.renderToClone||a);this._cursor=a.style.cursor;this.renderer=b.forExport?new ka(a,c,d,b.style,!0):new Wa(a,c,
|
||||
d,b.style);ja&&this.renderer.create(this,a,c,d)},getMargins:function(){var a=this.spacing,b,c=this.legend,d=this.margin,e=this.options.legend,f=o(e.margin,20),g=e.x,h=e.y,i=e.align,k=e.verticalAlign,j=this.titleOffset;this.resetMargins();b=this.axisOffset;if(j&&!t(d[0]))this.plotTop=w(this.plotTop,j+this.options.title.margin+a[0]);if(c.display&&!e.floating)if(i==="right"){if(!t(d[1]))this.marginRight=w(this.marginRight,c.legendWidth-g+f+a[1])}else if(i==="left"){if(!t(d[3]))this.plotLeft=w(this.plotLeft,
|
||||
c.legendWidth+g+f+a[3])}else if(k==="top"){if(!t(d[0]))this.plotTop=w(this.plotTop,c.legendHeight+h+f+a[0])}else if(k==="bottom"&&!t(d[2]))this.marginBottom=w(this.marginBottom,c.legendHeight-h+f+a[2]);this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);this.hasCartesianSeries&&q(this.axes,function(a){a.getOffset()});t(d[3])||(this.plotLeft+=b[3]);t(d[0])||(this.plotTop+=b[0]);t(d[2])||(this.marginBottom+=b[2]);t(d[1])||(this.marginRight+=
|
||||
b[1]);this.setChartSize()},reflow:function(a){var b=this,c=b.options.chart,d=b.renderTo,e=c.width||nb(d,"width"),f=c.height||nb(d,"height"),c=a?a.target:X,d=function(){if(b.container)b.setSize(e,f,!1),b.hasUserSize=null};if(!b.hasUserSize&&e&&f&&(c===X||c===B)){if(e!==b.containerWidth||f!==b.containerHeight)clearTimeout(b.reflowTimeout),a?b.reflowTimeout=setTimeout(d,100):d();b.containerWidth=e;b.containerHeight=f}},initReflow:function(){var a=this,b=function(b){a.reflow(b)};A(X,"resize",b);A(a,"destroy",
|
||||
function(){R(X,"resize",b)})},setSize:function(a,b,c){var d=this,e,f,g;d.isResizing+=1;g=function(){d&&N(d,"endResize",null,function(){d.isResizing-=1})};Ya(c,d);d.oldChartHeight=d.chartHeight;d.oldChartWidth=d.chartWidth;if(t(a))d.chartWidth=e=w(0,s(a)),d.hasUserSize=!!e;if(t(b))d.chartHeight=f=w(0,s(b));(Ca?ob:E)(d.container,{width:e+"px",height:f+"px"},Ca);d.setChartSize(!0);d.renderer.setSize(e,f,c);d.maxTicks=null;q(d.axes,function(a){a.isDirty=!0;a.setScale()});q(d.series,function(a){a.isDirty=
|
||||
!0});d.isDirtyLegend=!0;d.isDirtyBox=!0;d.layOutTitles();d.getMargins();d.redraw(c);d.oldChartHeight=null;N(d,"resize");Ca===!1?g():setTimeout(g,Ca&&Ca.duration||500)},setChartSize:function(a){var b=this.inverted,c=this.renderer,d=this.chartWidth,e=this.chartHeight,f=this.options.chart,g=this.spacing,h=this.clipOffset,i,k,j,l;this.plotLeft=i=s(this.plotLeft);this.plotTop=k=s(this.plotTop);this.plotWidth=j=w(0,s(d-i-this.marginRight));this.plotHeight=l=w(0,s(e-k-this.marginBottom));this.plotSizeX=
|
||||
b?l:j;this.plotSizeY=b?j:l;this.plotBorderWidth=f.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:g[3],y:g[0],width:d-g[3]-g[1],height:e-g[0]-g[2]};this.plotBox=c.plotBox={x:i,y:k,width:j,height:l};d=2*S(this.plotBorderWidth/2);b=Va(w(d,h[3])/2);c=Va(w(d,h[0])/2);this.clipBox={x:b,y:c,width:S(this.plotSizeX-w(d,h[1])/2-b),height:S(this.plotSizeY-w(d,h[2])/2-c)};a||q(this.axes,function(a){a.setAxisSize();a.setAxisTranslation()})},resetMargins:function(){var a=this.spacing,b=this.margin;this.plotTop=
|
||||
o(b[0],a[0]);this.marginRight=o(b[1],a[1]);this.marginBottom=o(b[2],a[2]);this.plotLeft=o(b[3],a[3]);this.axisOffset=[0,0,0,0];this.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,b=this.renderer,c=this.chartWidth,d=this.chartHeight,e=this.chartBackground,f=this.plotBackground,g=this.plotBorder,h=this.plotBGImage,i=a.borderWidth||0,k=a.backgroundColor,j=a.plotBackgroundColor,l=a.plotBackgroundImage,m=a.plotBorderWidth||0,n,p=this.plotLeft,u=this.plotTop,o=this.plotWidth,q=this.plotHeight,
|
||||
x=this.plotBox,r=this.clipRect,s=this.clipBox;n=i+(a.shadow?8:0);if(i||k)if(e)e.animate(e.crisp({width:c-n,height:d-n}));else{e={fill:k||Y};if(i)e.stroke=a.borderColor,e["stroke-width"]=i;this.chartBackground=b.rect(n/2,n/2,c-n,d-n,a.borderRadius,i).attr(e).addClass("highcharts-background").add().shadow(a.shadow)}if(j)f?f.animate(x):this.plotBackground=b.rect(p,u,o,q,0).attr({fill:j}).add().shadow(a.plotShadow);if(l)h?h.animate(x):this.plotBGImage=b.image(l,p,u,o,q).add();r?r.animate({width:s.width,
|
||||
height:s.height}):this.clipRect=b.clipRect(s);if(m)g?g.animate(g.crisp({x:p,y:u,width:o,height:q})):this.plotBorder=b.rect(p,u,o,q,0,-m).attr({stroke:a.plotBorderColor,"stroke-width":m,fill:Y,zIndex:1}).add();this.isDirtyBox=!1},propFromSeries:function(){var a=this,b=a.options.chart,c,d=a.options.series,e,f;q(["inverted","angular","polar"],function(g){c=C[b.type||b.defaultSeriesType];f=a[g]||b[g]||c&&c.prototype[g];for(e=d&&d.length;!f&&e--;)(c=C[d[e].type])&&c.prototype[g]&&(f=!0);a[g]=f})},linkSeries:function(){var a=
|
||||
this,b=a.series;q(b,function(a){a.linkedSeries.length=0});q(b,function(b){var d=b.options.linkedTo;if(Oa(d)&&(d=d===":previous"?a.series[b.index-1]:a.get(d)))d.linkedSeries.push(b),b.linkedParent=d})},renderSeries:function(){q(this.series,function(a){a.translate();a.setTooltipPoints&&a.setTooltipPoints();a.render()})},render:function(){var a=this,b=a.axes,c=a.renderer,d=a.options,e=d.labels,f=d.credits,g;a.setTitle();a.legend=new pb(a,d.legend);a.getStacks();q(b,function(a){a.setScale()});a.getMargins();
|
||||
a.maxTicks=null;q(b,function(a){a.setTickPositions(!0);a.setMaxTicks()});a.adjustTickAmounts();a.getMargins();a.drawChartBox();a.hasCartesianSeries&&q(b,function(a){a.render()});if(!a.seriesGroup)a.seriesGroup=c.g("series-group").attr({zIndex:3}).add();a.renderSeries();e.items&&q(e.items,function(b){var d=v(e.style,b.style),f=I(d.left)+a.plotLeft,g=I(d.top)+a.plotTop+12;delete d.left;delete d.top;c.text(b.html,f,g).attr({zIndex:2}).css(d).add()});if(f.enabled&&!a.credits)g=f.href,a.credits=c.text(f.text,
|
||||
0,0).on("click",function(){if(g)location.href=g}).attr({align:f.position.align,zIndex:8}).css(f.style).add().align(f.position);a.hasRendered=!0},destroy:function(){var a=this,b=a.axes,c=a.series,d=a.container,e,f=d&&d.parentNode;N(a,"destroy");aa[a.index]=r;db--;a.renderTo.removeAttribute("data-highcharts-chart");R(a);for(e=b.length;e--;)b[e]=b[e].destroy();for(e=c.length;e--;)c[e]=c[e].destroy();q("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),
|
||||
function(b){var c=a[b];c&&c.destroy&&(a[b]=c.destroy())});if(d)d.innerHTML="",R(d),f&&Sa(d);for(e in a)delete a[e]},isReadyToRender:function(){var a=this;return!ca&&X==X.top&&B.readyState!=="complete"||ja&&!X.canvg?(ja?Vb.push(function(){a.firstRender()},a.options.global.canvasToolsURL):B.attachEvent("onreadystatechange",function(){B.detachEvent("onreadystatechange",a.firstRender);B.readyState==="complete"&&a.firstRender()}),!1):!0},firstRender:function(){var a=this,b=a.options,c=a.callback;if(a.isReadyToRender()){a.getContainer();
|
||||
N(a,"init");a.resetMargins();a.setChartSize();a.propFromSeries();a.getAxes();q(b.series||[],function(b){a.initSeries(b)});a.linkSeries();N(a,"beforeRender");if(P.Pointer)a.pointer=new Xa(a,b);a.render();a.renderer.draw();c&&c.apply(a,[a]);q(a.callbacks,function(b){b.apply(a,[a])});a.cloneRenderTo(!0);N(a,"load")}},splashArray:function(a,b){var c=b[a],c=fa(c)?c:[c,c,c,c];return[o(b[a+"Top"],c[0]),o(b[a+"Right"],c[1]),o(b[a+"Bottom"],c[2]),o(b[a+"Left"],c[3])]}};va.prototype.callbacks=[];ea=P.CenteredSeriesMixin=
|
||||
{getCenter:function(){var a=this.options,b=this.chart,c=2*(a.slicedOffset||0),d,e=b.plotWidth-2*c,f=b.plotHeight-2*c,b=a.center,a=[o(b[0],"50%"),o(b[1],"50%"),a.size||"100%",a.innerSize||0],g=z(e,f),h;return xa(a,function(a,b){h=/%$/.test(a);d=b<2||b===2&&h;return(h?[e,f,g,g][b]*I(a)/100:a)+(d?c:0)})}};var za=function(){};za.prototype={init:function(a,b,c){this.series=a;this.applyOptions(b,c);this.pointAttr={};if(a.options.colorByPoint&&(b=a.options.colors||a.chart.options.colors,this.color=this.color||
|
||||
b[a.colorCounter++],a.colorCounter===b.length))a.colorCounter=0;a.chart.pointCount++;return this},applyOptions:function(a,b){var c=this.series,d=c.pointValKey,a=za.prototype.optionsToObject.call(this,a);v(this,a);this.options=this.options?v(this.options,a):a;if(d)this.y=this[d];if(this.x===r&&c)this.x=b===r?c.autoIncrement():b;return this},optionsToObject:function(a){var b={},c=this.series,d=c.pointArrayMap||["y"],e=d.length,f=0,g=0;if(typeof a==="number"||a===null)b[d[0]]=a;else if(Pa(a)){if(a.length>
|
||||
e){c=typeof a[0];if(c==="string")b.name=a[0];else if(c==="number")b.x=a[0];f++}for(;g<e;)b[d[g++]]=a[f++]}else if(typeof a==="object"){b=a;if(a.dataLabels)c._hasPointLabels=!0;if(a.marker)c._hasPointMarkers=!0}return b},destroy:function(){var a=this.series.chart,b=a.hoverPoints,c;a.pointCount--;if(b&&(this.setState(),pa(b,this),!b.length))a.hoverPoints=null;if(this===a.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel)R(this),this.destroyElements();this.legendItem&&a.legend.destroyItem(this);
|
||||
for(c in this)this[c]=null},destroyElements:function(){for(var a="graphic,dataLabel,dataLabelUpper,group,connector,shadowGroup".split(","),b,c=6;c--;)b=a[c],this[b]&&(this[b]=this[b].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(a){var b=this.series,c=b.tooltipOptions,d=o(c.valueDecimals,""),e=c.valuePrefix||"",f=c.valueSuffix||
|
||||
"";q(b.pointArrayMap||["y"],function(b){b="{point."+b;if(e||f)a=a.replace(b+"}",e+b+"}"+f);a=a.replace(b+"}",b+":,."+d+"f}")});return Ja(a,{point:this,series:this.series})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])&&this.importEvents();a==="click"&&e.allowPointSelect&&(c=function(a){d.select(null,a.ctrlKey||a.metaKey||a.shiftKey)});N(this,a,b,c)}};var K=function(){};K.prototype={isCartesian:!0,type:"line",
|
||||
pointClass:za,sorted:!0,requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],init:function(a,b){var c=this,d,e,f=a.series,g=function(a,b){return o(a.options.index,a._i)-o(b.options.index,b._i)};c.chart=a;c.options=b=c.setOptions(b);c.linkedSeries=[];c.bindAxes();v(c,{name:b.name,state:"",pointAttr:{},visible:b.visible!==!1,selected:b.selected===!0});if(ja)b.animation=!1;
|
||||
e=b.events;for(d in e)A(c,d,e[d]);if(e&&e.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=!0;c.getColor();c.getSymbol();q(c.parallelArrays,function(a){c[a+"Data"]=[]});c.setData(b.data,!1);if(c.isCartesian)a.hasCartesianSeries=!0;f.push(c);c._i=f.length-1;tb(f,g);this.yAxis&&tb(this.yAxis.series,g);q(f,function(a,b){a.index=b;a.name=a.name||"Series "+(b+1)})},bindAxes:function(){var a=this,b=a.options,c=a.chart,d;q(a.axisTypes||[],function(e){q(c[e],function(c){d=
|
||||
c.options;if(b[e]===d.index||b[e]!==r&&b[e]===d.id||b[e]===r&&d.index===0)c.series.push(a),a[e]=c,c.isDirty=!0});!a[e]&&a.optionalAxis!==e&&qa(18,!0)})},updateParallelArrays:function(a,b){var c=a.series,d=arguments;q(c.parallelArrays,typeof b==="number"?function(d){var f=d==="y"&&c.toYData?c.toYData(a):a[d];c[d+"Data"][b]=f}:function(a){Array.prototype[b].apply(c[a+"Data"],Array.prototype.slice.call(d,2))})},autoIncrement:function(){var a=this.options,b=this.xIncrement,b=o(b,a.pointStart,0);this.pointInterval=
|
||||
o(this.pointInterval,a.pointInterval,1);this.xIncrement=b+this.pointInterval;return b},getSegments:function(){var a=-1,b=[],c,d=this.points,e=d.length;if(e)if(this.options.connectNulls){for(c=e;c--;)d[c].y===null&&d.splice(c,1);d.length&&(b=[d])}else q(d,function(c,g){c.y===null?(g>a+1&&b.push(d.slice(a+1,g)),a=g):g===e-1&&b.push(d.slice(a+1,g+1))});this.segments=b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},d=b.plotOptions||{},e=c[this.type];this.userOptions=
|
||||
a;c=y(e,c.series,a);this.tooltipOptions=y(F.tooltip,F.plotOptions[this.type].tooltip,b.tooltip,d.series&&d.series.tooltip,d[this.type]&&d[this.type].tooltip,a.tooltip);e.marker===null&&delete c.marker;return c},getColor:function(){var a=this.options,b=this.userOptions,c=this.chart.options.colors,d=this.chart.counters,e;e=a.color||T[this.type].color;if(!e&&!a.colorByPoint)t(b._colorIndex)?a=b._colorIndex:(b._colorIndex=d.color,a=d.color++),e=c[a];this.color=e;d.wrapColor(c.length)},getSymbol:function(){var a=
|
||||
this.userOptions,b=this.options.marker,c=this.chart,d=c.options.symbols,c=c.counters;this.symbol=b.symbol;if(!this.symbol)t(a._symbolIndex)?a=a._symbolIndex:(a._symbolIndex=c.symbol,a=c.symbol++),this.symbol=d[a];if(/^url/.test(this.symbol))b.radius=0;c.wrapSymbol(d.length)},drawLegendSymbol:Q.drawLineMarker,setData:function(a,b,c,d){var e=this,f=e.points,g=f&&f.length||0,h,i=e.options,k=e.chart,j=null,l=e.xAxis,m=l&&!!l.categories,n=e.tooltipPoints,p=i.turboThreshold,u=this.xData,s=this.yData,G=
|
||||
(h=e.pointArrayMap)&&h.length,a=a||[];h=a.length;b=o(b,!0);if(d!==!1&&h&&g===h&&!e.cropped&&!e.hasGroupedData)q(a,function(a,b){f[b].update(a,!1)});else{e.xIncrement=null;e.pointRange=m?1:i.pointRange;e.colorCounter=0;q(this.parallelArrays,function(a){e[a+"Data"].length=0});if(p&&h>p){for(c=0;j===null&&c<h;)j=a[c],c++;if(la(j)){m=o(i.pointStart,0);i=o(i.pointInterval,1);for(c=0;c<h;c++)u[c]=m,s[c]=a[c],m+=i;e.xIncrement=m}else if(Pa(j))if(G)for(c=0;c<h;c++)i=a[c],u[c]=i[0],s[c]=i.slice(1,G+1);else for(c=
|
||||
0;c<h;c++)i=a[c],u[c]=i[0],s[c]=i[1];else qa(12)}else for(c=0;c<h;c++)if(a[c]!==r&&(i={series:e},e.pointClass.prototype.applyOptions.apply(i,[a[c]]),e.updateParallelArrays(i,c),m&&i.name))l.names[i.x]=i.name;Oa(s[0])&&qa(14,!0);e.data=[];e.options.data=a;for(c=g;c--;)f[c]&&f[c].destroy&&f[c].destroy();if(n)n.length=0;if(l)l.minRange=l.userMinRange;e.isDirty=e.isDirtyData=k.isDirtyBox=!0;c=!1}b&&k.redraw(c)},processData:function(a){var b=this.xData,c=this.yData,d=b.length,e;e=0;var f,g,h=this.xAxis,
|
||||
i=this.options,k=i.cropThreshold,j=0,l=this.isCartesian,m,n;if(l&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!a)return!1;if(l&&this.sorted&&(!k||d>k||this.forceCrop))if(m=h.min,n=h.max,b[d-1]<m||b[0]>n)b=[],c=[];else if(b[0]<m||b[d-1]>n)e=this.cropData(this.xData,this.yData,m,n),b=e.xData,c=e.yData,e=e.start,f=!0,j=b.length;for(d=b.length-1;d>=0;d--)a=b[d]-b[d-1],!f&&b[d]>m&&b[d]<n&&j++,a>0&&(g===r||a<g)?g=a:a<0&&this.requireSorting&&qa(15);this.cropped=f;this.cropStart=e;this.processedXData=
|
||||
b;this.processedYData=c;this.activePointCount=j;if(i.pointRange===null)this.pointRange=g||1;this.closestPointRange=g},cropData:function(a,b,c,d){var e=a.length,f=0,g=e,h=o(this.cropShoulder,1),i;for(i=0;i<e;i++)if(a[i]>=c){f=w(0,i-h);break}for(;i<e;i++)if(a[i]>d){g=i+h;break}return{xData:a.slice(f,g),yData:b.slice(f,g),start:f,end:g}},generatePoints:function(){var a=this.options.data,b=this.data,c,d=this.processedXData,e=this.processedYData,f=this.pointClass,g=d.length,h=this.cropStart||0,i,k=this.hasGroupedData,
|
||||
j,l=[],m;if(!b&&!k)b=[],b.length=a.length,b=this.data=b;for(m=0;m<g;m++)i=h+m,k?l[m]=(new f).init(this,[d[m]].concat(ma(e[m]))):(b[i]?j=b[i]:a[i]!==r&&(b[i]=j=(new f).init(this,a[i],d[m])),l[m]=j);if(b&&(g!==(c=b.length)||k))for(m=0;m<c;m++)if(m===h&&!k&&(m+=g),b[m])b[m].destroyElements(),b[m].plotX=r;this.data=b;this.points=l},getExtremes:function(a){var b=this.yAxis,c=this.processedXData,d,e=[],f=0;d=this.xAxis.getExtremes();var g=d.min,h=d.max,i,k,j,l,a=a||this.stackedYData||this.processedYData;
|
||||
d=a.length;for(l=0;l<d;l++)if(k=c[l],j=a[l],i=j!==null&&j!==r&&(!b.isLog||j.length||j>0),k=this.getExtremesFromAll||this.cropped||(c[l+1]||k)>=g&&(c[l-1]||k)<=h,i&&k)if(i=j.length)for(;i--;)j[i]!==null&&(e[f++]=j[i]);else e[f++]=j;this.dataMin=o(void 0,Ra(e));this.dataMax=o(void 0,Ba(e))},translate:function(){this.processedXData||this.processData();this.generatePoints();for(var a=this.options,b=a.stacking,c=this.xAxis,d=c.categories,e=this.yAxis,f=this.points,g=f.length,h=!!this.modifyValue,i=a.pointPlacement,
|
||||
k=i==="between"||la(i),j=a.threshold,a=0;a<g;a++){var l=f[a],m=l.x,n=l.y,p=l.low,u=b&&e.stacks[(this.negStacks&&n<j?"-":"")+this.stackKey];if(e.isLog&&n<=0)l.y=n=null;l.plotX=c.translate(m,0,0,0,1,i,this.type==="flags");if(b&&this.visible&&u&&u[m])u=u[m],n=u.points[this.index+","+a],p=n[0],n=n[1],p===0&&(p=o(j,e.min)),e.isLog&&p<=0&&(p=null),l.total=l.stackTotal=u.total,l.percentage=u.total&&l.y/u.total*100,l.stackY=n,u.setOffset(this.pointXOffset||0,this.barW||0);l.yBottom=t(p)?e.translate(p,0,1,
|
||||
0,1):null;h&&(n=this.modifyValue(n,l));l.plotY=typeof n==="number"&&n!==Infinity?e.translate(n,0,1,0,1):r;l.clientX=k?c.translate(m,0,0,0,1):l.plotX;l.negative=l.y<(j||0);l.category=d&&d[l.x]!==r?d[l.x]:l.x}this.getSegments()},animate:function(a){var b=this.chart,c=b.renderer,d;d=this.options.animation;var e=this.clipBox||b.clipBox,f=b.inverted,g;if(d&&!fa(d))d=T[this.type].animation;g=["_sharedClip",d.duration,d.easing,e.height].join(",");a?(a=b[g],d=b[g+"m"],a||(b[g]=a=c.clipRect(v(e,{width:0})),
|
||||
b[g+"m"]=d=c.clipRect(-99,f?-b.plotLeft:-b.plotTop,99,f?b.chartWidth:b.chartHeight)),this.group.clip(a),this.markerGroup.clip(d),this.sharedClipKey=g):((a=b[g])&&a.animate({width:b.plotSizeX},d),b[g+"m"]&&b[g+"m"].animate({width:b.plotSizeX+99},d),this.animate=null)},afterAnimate:function(){var a=this.chart,b=this.sharedClipKey,c=this.group,d=this.clipBox;if(c&&this.options.clip!==!1){if(!b||!d)c.clip(d?a.renderer.clipRect(d):a.clipRect);this.markerGroup.clip()}N(this,"afterAnimate");setTimeout(function(){b&&
|
||||
a[b]&&(d||(a[b]=a[b].destroy()),a[b+"m"]&&(a[b+"m"]=a[b+"m"].destroy()))},100)},drawPoints:function(){var a,b=this.points,c=this.chart,d,e,f,g,h,i,k,j;d=this.options.marker;var l=this.pointAttr[""],m,n=this.markerGroup,p=o(d.enabled,this.activePointCount<0.5*this.xAxis.len/d.radius);if(d.enabled!==!1||this._hasPointMarkers)for(f=b.length;f--;)if(g=b[f],d=S(g.plotX),e=g.plotY,j=g.graphic,i=g.marker||{},a=p&&i.enabled===r||i.enabled,m=c.isInsidePlot(s(d),e,c.inverted),a&&e!==r&&!isNaN(e)&&g.y!==null)if(a=
|
||||
g.pointAttr[g.selected?"select":""]||l,h=a.r,i=o(i.symbol,this.symbol),k=i.indexOf("url")===0,j)j[m?"show":"hide"](!0).animate(v({x:d-h,y:e-h},j.symbolName?{width:2*h,height:2*h}:{}));else{if(m&&(h>0||k))g.graphic=c.renderer.symbol(i,d-h,e-h,2*h,2*h).attr(a).add(n)}else if(j)g.graphic=j.destroy()},convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={},a=a||{},b=b||{},c=c||{},d=d||{};for(f in e)g=e[f],h[f]=o(a[g],b[f],c[f],d[f]);return h},getAttribs:function(){var a=this,b=a.options,
|
||||
c=T[a.type].marker?b.marker:b,d=c.states,e=d.hover,f,g=a.color;f={stroke:g,fill:g};var h=a.points||[],i,k=[],j,l=a.pointAttrToOptions;j=a.hasPointSpecificOptions;var m=b.negativeColor,n=c.lineColor,p=c.fillColor;i=b.turboThreshold;var u;b.marker?(e.radius=e.radius||c.radius+2,e.lineWidth=e.lineWidth||c.lineWidth+1):e.color=e.color||Fa(e.color||g).brighten(e.brightness).get();k[""]=a.convertAttribs(c,f);q(["hover","select"],function(b){k[b]=a.convertAttribs(d[b],k[""])});a.pointAttr=k;g=h.length;if(!i||
|
||||
g<i||j)for(;g--;){i=h[g];if((c=i.options&&i.options.marker||i.options)&&c.enabled===!1)c.radius=0;if(i.negative&&m)i.color=i.fillColor=m;j=b.colorByPoint||i.color;if(i.options)for(u in l)t(c[l[u]])&&(j=!0);if(j){c=c||{};j=[];d=c.states||{};f=d.hover=d.hover||{};if(!b.marker)f.color=f.color||!i.options.color&&e.color||Fa(i.color).brighten(f.brightness||e.brightness).get();f={color:i.color};if(!p)f.fillColor=i.color;if(!n)f.lineColor=i.color;j[""]=a.convertAttribs(v(f,c),k[""]);j.hover=a.convertAttribs(d.hover,
|
||||
k.hover,j[""]);j.select=a.convertAttribs(d.select,k.select,j[""])}else j=k;i.pointAttr=j}},destroy:function(){var a=this,b=a.chart,c=/AppleWebKit\/533/.test(Da),d,e,f=a.data||[],g,h,i;N(a,"destroy");R(a);q(a.axisTypes||[],function(b){if(i=a[b])pa(i.series,a),i.isDirty=i.forceRedraw=!0});a.legendItem&&a.chart.legend.destroyItem(a);for(e=f.length;e--;)(g=f[e])&&g.destroy&&g.destroy();a.points=null;clearTimeout(a.animationTimeout);q("area,graph,dataLabelsGroup,group,markerGroup,tracker,graphNeg,areaNeg,posClip,negClip".split(","),
|
||||
function(b){a[b]&&(d=c&&b==="group"?"hide":"destroy",a[b][d]())});if(b.hoverSeries===a)b.hoverSeries=null;pa(b.series,a);for(h in a)delete a[h]},getSegmentPath:function(a){var b=this,c=[],d=b.options.step;q(a,function(e,f){var g=e.plotX,h=e.plotY,i;b.getPointSpline?c.push.apply(c,b.getPointSpline(a,e,f)):(c.push(f?"L":"M"),d&&f&&(i=a[f-1],d==="right"?c.push(i.plotX,h):d==="center"?c.push((i.plotX+g)/2,i.plotY,(i.plotX+g)/2,h):c.push(g,i.plotY)),c.push(e.plotX,e.plotY))});return c},getGraphPath:function(){var a=
|
||||
this,b=[],c,d=[];q(a.segments,function(e){c=a.getSegmentPath(e);e.length>1?b=b.concat(c):d.push(e[0])});a.singlePoints=d;return a.graphPath=b},drawGraph:function(){var a=this,b=this.options,c=[["graph",b.lineColor||this.color]],d=b.lineWidth,e=b.dashStyle,f=b.linecap!=="square",g=this.getGraphPath(),h=b.negativeColor;h&&c.push(["graphNeg",h]);q(c,function(c,h){var j=c[0],l=a[j];if(l)eb(l),l.animate({d:g});else if(d&&g.length)l={stroke:c[1],"stroke-width":d,fill:Y,zIndex:1},e?l.dashstyle=e:f&&(l["stroke-linecap"]=
|
||||
l["stroke-linejoin"]="round"),a[j]=a.chart.renderer.path(g).attr(l).add(a.group).shadow(!h&&b.shadow)})},clipNeg:function(){var a=this.options,b=this.chart,c=b.renderer,d=a.negativeColor||a.negativeFillColor,e,f=this.graph,g=this.area,h=this.posClip,i=this.negClip;e=b.chartWidth;var k=b.chartHeight,j=w(e,k),l=this.yAxis;if(d&&(f||g)){d=s(l.toPixels(a.threshold||0,!0));d<0&&(j-=d);a={x:0,y:0,width:j,height:d};j={x:0,y:d,width:j,height:j};if(b.inverted)a.height=j.y=b.plotWidth-d,c.isVML&&(a={x:b.plotWidth-
|
||||
d-b.plotLeft,y:0,width:e,height:k},j={x:d+b.plotLeft-e,y:0,width:b.plotLeft+d,height:e});l.reversed?(b=j,e=a):(b=a,e=j);h?(h.animate(b),i.animate(e)):(this.posClip=h=c.clipRect(b),this.negClip=i=c.clipRect(e),f&&this.graphNeg&&(f.clip(h),this.graphNeg.clip(i)),g&&(g.clip(h),this.areaNeg.clip(i)))}},invertGroups:function(){function a(){var a={width:b.yAxis.len,height:b.xAxis.len};q(["group","markerGroup"],function(c){b[c]&&b[c].attr(a).invert()})}var b=this,c=b.chart;if(b.xAxis)A(c,"resize",a),A(b,
|
||||
"destroy",function(){R(c,"resize",a)}),a(),b.invertGroups=a},plotGroup:function(a,b,c,d,e){var f=this[a],g=!f;g&&(this[a]=f=this.chart.renderer.g(b).attr({visibility:c,zIndex:d||0.1}).add(e));f[g?"attr":"animate"](this.getPlotBox());return f},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;if(a.inverted)b=c,c=this.xAxis;return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var a=this,b=a.chart,c,d=a.options,e=(c=d.animation)&&!!a.animate&&
|
||||
b.renderer.isSVG&&o(c.duration,500)||0,f=a.visible?"visible":"hidden",g=d.zIndex,h=a.hasRendered,i=b.seriesGroup;c=a.plotGroup("group","series",f,g,i);a.markerGroup=a.plotGroup("markerGroup","markers",f,g,i);e&&a.animate(!0);a.getAttribs();c.inverted=a.isCartesian?b.inverted:!1;a.drawGraph&&(a.drawGraph(),a.clipNeg());a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&&a.options.enableMouseTracking!==!1&&a.drawTracker();b.inverted&&a.invertGroups();d.clip!==!1&&!a.sharedClipKey&&
|
||||
!h&&c.clip(b.clipRect);e&&a.animate();if(!h)e?a.animationTimeout=setTimeout(function(){a.afterAnimate()},e):a.afterAnimate();a.isDirty=a.isDirtyData=!1;a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirtyData,c=this.group,d=this.xAxis,e=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:o(d&&d.left,a.plotLeft),translateY:o(e&&e.top,a.plotTop)}));this.translate();this.setTooltipPoints&&this.setTooltipPoints(!0);this.render();b&&N(this,"updatedData")}};
|
||||
Rb.prototype={destroy:function(){Ka(this,this.axis)},render:function(a){var b=this.options,c=b.format,c=c?Ja(c,this):b.formatter.call(this);this.label?this.label.attr({text:c,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(c,null,null,b.useHTML).css(b.style).attr({align:this.textAlign,rotation:b.rotation,visibility:"hidden"}).add(a)},setOffset:function(a,b){var c=this.axis,d=c.chart,e=d.inverted,f=this.isNegative,g=c.translate(c.usePercentage?100:this.total,0,0,0,1),c=c.translate(0),
|
||||
c=M(g-c),h=d.xAxis[0].translate(this.x)+a,i=d.plotHeight,f={x:e?f?g:g-c:h,y:e?i-h-b:f?i-g-c:i-g,width:e?c:b,height:e?b:c};if(e=this.label)e.align(this.alignOptions,null,f),f=e.alignAttr,e[this.options.crop===!1||d.isInsidePlot(f.x,f.y)?"show":"hide"](!0)}};L.prototype.buildStacks=function(){var a=this.series,b=o(this.options.reversedStacks,!0),c=a.length;if(!this.isXAxis){for(this.usePercentage=!1;c--;)a[b?c:a.length-c-1].setStackedPoints();if(this.usePercentage)for(c=0;c<a.length;c++)a[c].setPercentStacks()}};
|
||||
L.prototype.renderStackTotals=function(){var a=this.chart,b=a.renderer,c=this.stacks,d,e,f=this.stackTotalGroup;if(!f)this.stackTotalGroup=f=b.g("stack-labels").attr({visibility:"visible",zIndex:6}).add();f.translate(a.plotLeft,a.plotTop);for(d in c)for(e in a=c[d],a)a[e].render(f)};K.prototype.setStackedPoints=function(){if(this.options.stacking&&!(this.visible!==!0&&this.chart.options.chart.ignoreHiddenSeries!==!1)){var a=this.processedXData,b=this.processedYData,c=[],d=b.length,e=this.options,
|
||||
f=e.threshold,g=e.stack,e=e.stacking,h=this.stackKey,i="-"+h,k=this.negStacks,j=this.yAxis,l=j.stacks,m=j.oldStacks,n,p,u,o,q,x;for(o=0;o<d;o++){q=a[o];x=b[o];u=this.index+","+o;p=(n=k&&x<f)?i:h;l[p]||(l[p]={});if(!l[p][q])m[p]&&m[p][q]?(l[p][q]=m[p][q],l[p][q].total=null):l[p][q]=new Rb(j,j.options.stackLabels,n,q,g);p=l[p][q];p.points[u]=[p.cum||0];e==="percent"?(n=n?h:i,k&&l[n]&&l[n][q]?(n=l[n][q],p.total=n.total=w(n.total,p.total)+M(x)||0):p.total=ha(p.total+(M(x)||0))):p.total=ha(p.total+(x||
|
||||
0));p.cum=(p.cum||0)+(x||0);p.points[u].push(p.cum);c[o]=p.cum}if(e==="percent")j.usePercentage=!0;this.stackedYData=c;j.oldStacks={}}};K.prototype.setPercentStacks=function(){var a=this,b=a.stackKey,c=a.yAxis.stacks,d=a.processedXData;q([b,"-"+b],function(b){var e;for(var f=d.length,g,h;f--;)if(g=d[f],e=(h=c[b]&&c[b][g])&&h.points[a.index+","+f],g=e)h=h.total?100/h.total:0,g[0]=ha(g[0]*h),g[1]=ha(g[1]*h),a.stackedYData[f]=g[1]})};v(va.prototype,{addSeries:function(a,b,c){var d,e=this;a&&(b=o(b,!0),
|
||||
N(e,"addSeries",{options:a},function(){d=e.initSeries(a);e.isDirtyLegend=!0;e.linkSeries();b&&e.redraw(c)}));return d},addAxis:function(a,b,c,d){var e=b?"xAxis":"yAxis",f=this.options;new L(this,y(a,{index:this[e].length,isX:b}));f[e]=ma(f[e]||{});f[e].push(a);o(c,!0)&&this.redraw(d)},showLoading:function(a){var b=this.options,c=this.loadingDiv,d=b.loading;if(!c)this.loadingDiv=c=$(Ta,{className:"highcharts-loading"},v(d.style,{zIndex:10,display:Y}),this.container),this.loadingSpan=$("span",null,
|
||||
d.labelStyle,c);this.loadingSpan.innerHTML=a||b.lang.loading;if(!this.loadingShown)E(c,{opacity:0,display:"",left:this.plotLeft+"px",top:this.plotTop+"px",width:this.plotWidth+"px",height:this.plotHeight+"px"}),ob(c,{opacity:d.style.opacity},{duration:d.showDuration||0}),this.loadingShown=!0},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&ob(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){E(b,{display:Y})}});this.loadingShown=!1}});v(za.prototype,{update:function(a,
|
||||
b,c){var d=this,e=d.series,f=d.graphic,g,h=e.data,i=e.chart,k=e.options,b=o(b,!0);d.firePointEvent("update",{options:a},function(){d.applyOptions(a);if(fa(a)){e.getAttribs();if(f)a&&a.marker&&a.marker.symbol?d.graphic=f.destroy():f.attr(d.pointAttr[d.state||""]);if(a&&a.dataLabels&&d.dataLabel)d.dataLabel=d.dataLabel.destroy()}g=wa(d,h);e.updateParallelArrays(d,g);k.data[g]=d.options;e.isDirty=e.isDirtyData=!0;if(!e.fixedBox&&e.hasCartesianSeries)i.isDirtyBox=!0;k.legendType==="point"&&i.legend.destroyItem(d);
|
||||
b&&i.redraw(c)})},remove:function(a,b){var c=this,d=c.series,e=d.points,f=d.chart,g,h=d.data;Ya(b,f);a=o(a,!0);c.firePointEvent("remove",null,function(){g=wa(c,h);h.length===e.length&&e.splice(g,1);h.splice(g,1);d.options.data.splice(g,1);d.updateParallelArrays(c,"splice",g,1);c.destroy();d.isDirty=!0;d.isDirtyData=!0;a&&f.redraw()})}});v(K.prototype,{addPoint:function(a,b,c,d){var e=this.options,f=this.data,g=this.graph,h=this.area,i=this.chart,k=this.xAxis&&this.xAxis.names,j=g&&g.shift||0,l=e.data,
|
||||
m,n=this.xData;Ya(d,i);c&&q([g,h,this.graphNeg,this.areaNeg],function(a){if(a)a.shift=j+1});if(h)h.isArea=!0;b=o(b,!0);d={series:this};this.pointClass.prototype.applyOptions.apply(d,[a]);g=d.x;h=n.length;if(this.requireSorting&&g<n[h-1])for(m=!0;h&&n[h-1]>g;)h--;this.updateParallelArrays(d,"splice",h,0,0);this.updateParallelArrays(d,h);if(k)k[g]=d.name;l.splice(h,0,a);m&&(this.data.splice(h,0,null),this.processData());e.legendType==="point"&&this.generatePoints();c&&(f[0]&&f[0].remove?f[0].remove(!1):
|
||||
(f.shift(),this.updateParallelArrays(d,"shift"),l.shift()));this.isDirtyData=this.isDirty=!0;b&&(this.getAttribs(),i.redraw())},remove:function(a,b){var c=this,d=c.chart,a=o(a,!0);if(!c.isRemoving)c.isRemoving=!0,N(c,"remove",null,function(){c.destroy();d.isDirtyLegend=d.isDirtyBox=!0;d.linkSeries();a&&d.redraw(b)});c.isRemoving=!1},update:function(a,b){var c=this.chart,d=this.type,e=C[d].prototype,f,a=y(this.userOptions,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},
|
||||
a);this.remove(!1);for(f in e)e.hasOwnProperty(f)&&(this[f]=r);v(this,C[a.type||d].prototype);this.init(c,a);o(b,!0)&&c.redraw(!1)}});v(L.prototype,{update:function(a,b){var c=this.chart,a=c.options[this.coll][this.options.index]=y(this.userOptions,a);this.destroy(!0);this._addedPlotLB=r;this.init(c,v(a,{events:r}));c.isDirtyBox=!0;o(b,!0)&&c.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,d=this.series,e=d.length;e--;)d[e]&&d[e].remove(!1);pa(b.axes,this);pa(b[c],this);b.options[c].splice(this.options.index,
|
||||
1);q(b[c],function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;o(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},b)}});var Aa=ga(K);C.line=Aa;T.area=y(J,{threshold:0});var ta=ga(K,{type:"area",getSegments:function(){var a=[],b=[],c=[],d=this.xAxis,e=this.yAxis,f=e.stacks[this.stackKey],g={},h,i,k=this.points,j=this.options.connectNulls,l,m,n;if(this.options.stacking&&!this.cropped){for(m=0;m<k.length;m++)g[k[m].x]=
|
||||
k[m];for(n in f)f[n].total!==null&&c.push(+n);c.sort(function(a,b){return a-b});q(c,function(a){if(!j||g[a]&&g[a].y!==null)g[a]?b.push(g[a]):(h=d.translate(a),l=f[a].percent?f[a].total?f[a].cum*100/f[a].total:0:f[a].cum,i=e.toPixels(l,!0),b.push({y:null,plotX:h,clientX:h,plotY:i,yBottom:i,onMouseOver:na}))});b.length&&a.push(b)}else K.prototype.getSegments.call(this),a=this.segments;this.segments=a},getSegmentPath:function(a){var b=K.prototype.getSegmentPath.call(this,a),c=[].concat(b),d,e=this.options;
|
||||
d=b.length;var f=this.yAxis.getThreshold(e.threshold),g;d===3&&c.push("L",b[1],b[2]);if(e.stacking&&!this.closedStacks)for(d=a.length-1;d>=0;d--)g=o(a[d].yBottom,f),d<a.length-1&&e.step&&c.push(a[d+1].plotX,g),c.push(a[d].plotX,g);else this.closeSegment(c,a,f);this.areaPath=this.areaPath.concat(c);return b},closeSegment:function(a,b,c){a.push("L",b[b.length-1].plotX,c,"L",b[0].plotX,c)},drawGraph:function(){this.areaPath=[];K.prototype.drawGraph.apply(this);var a=this,b=this.areaPath,c=this.options,
|
||||
d=c.negativeColor,e=c.negativeFillColor,f=[["area",this.color,c.fillColor]];(d||e)&&f.push(["areaNeg",d,e]);q(f,function(d){var e=d[0],f=a[e];f?f.animate({d:b}):a[e]=a.chart.renderer.path(b).attr({fill:o(d[2],Fa(d[1]).setOpacity(o(c.fillOpacity,0.75)).get()),zIndex:0}).add(a.group)})},drawLegendSymbol:Q.drawRectangle});C.area=ta;T.spline=y(J);Aa=ga(K,{type:"spline",getPointSpline:function(a,b,c){var d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1],h,i,k,j;if(f&&g){a=f.plotY;k=g.plotX;var g=g.plotY,l;h=(1.5*
|
||||
d+f.plotX)/2.5;i=(1.5*e+a)/2.5;k=(1.5*d+k)/2.5;j=(1.5*e+g)/2.5;l=(j-i)*(k-d)/(k-h)+e-j;i+=l;j+=l;i>a&&i>e?(i=w(a,e),j=2*e-i):i<a&&i<e&&(i=z(a,e),j=2*e-i);j>g&&j>e?(j=w(g,e),i=2*e-j):j<g&&j<e&&(j=z(g,e),i=2*e-j);b.rightContX=k;b.rightContY=j}c?(b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,i||e,d,e],f.rightContX=f.rightContY=null):b=["M",d,e];return b}});C.spline=Aa;T.areaspline=y(T.area);ta=ta.prototype;Aa=ga(Aa,{type:"areaspline",closedStacks:!0,getSegmentPath:ta.getSegmentPath,closeSegment:ta.closeSegment,
|
||||
drawGraph:ta.drawGraph,drawLegendSymbol:Q.drawRectangle});C.areaspline=Aa;T.column=y(J,{borderColor:"#FFFFFF",borderRadius:0,groupPadding:0.2,marker:null,pointPadding:0.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{brightness:0.1,shadow:!1,halo:!1},select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}},dataLabels:{align:null,verticalAlign:null,y:null},stickyTracking:!1,tooltip:{distance:6},threshold:0});Aa=ga(K,{type:"column",pointAttrToOptions:{stroke:"borderColor",fill:"color",
|
||||
r:"borderRadius"},cropShoulder:0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){K.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasRendered&&q(b.series,function(b){if(b.type===a.type)b.isDirty=!0})},getColumnMetrics:function(){var a=this,b=a.options,c=a.xAxis,d=a.yAxis,e=c.reversed,f,g={},h,i=0;b.grouping===!1?i=1:q(a.chart.series,function(b){var c=b.options,e=b.yAxis;if(b.type===a.type&&b.visible&&d.len===e.len&&d.pos===e.pos)c.stacking?(f=b.stackKey,g[f]===
|
||||
r&&(g[f]=i++),h=g[f]):c.grouping!==!1&&(h=i++),b.columnIndex=h});var c=z(M(c.transA)*(c.ordinalSlope||b.pointRange||c.closestPointRange||c.tickInterval||1),c.len),k=c*b.groupPadding,j=(c-2*k)/i,l=b.pointWidth,b=t(l)?(j-l)/2:j*b.pointPadding,l=o(l,j-2*b);return a.columnMetrics={width:l,offset:b+(k+((e?i-(a.columnIndex||0):a.columnIndex)||0)*j-c/2)*(e?-1:1)}},translate:function(){var a=this,b=a.chart,c=a.options,d=a.borderWidth=o(c.borderWidth,a.activePointCount>0.5*a.xAxis.len?0:1),e=a.yAxis,f=a.translatedThreshold=
|
||||
e.getThreshold(c.threshold),g=o(c.minPointLength,5),c=a.getColumnMetrics(),h=c.width,i=a.barW=Va(w(h,1+2*d)),k=a.pointXOffset=c.offset,j=-(d%2?0.5:0),l=d%2?0.5:1;b.renderer.isVML&&b.inverted&&(l+=1);K.prototype.translate.apply(a);q(a.points,function(c){var d=o(c.yBottom,f),p=z(w(-999-d,c.plotY),e.len+999+d),u=c.plotX+k,q=i,r=z(p,d),x;x=w(p,d)-r;M(x)<g&&g&&(x=g,r=s(M(r-f)>g?d-g:f-(e.translate(c.y,0,1,0,1)<=f?g:0)));c.barX=u;c.pointWidth=h;c.tooltipPos=b.inverted?[e.len-p,a.xAxis.len-u-q/2]:[u+q/2,
|
||||
p];d=M(u)<0.5;q=s(u+q)+j;u=s(u)+j;q-=u;p=M(r)<0.5;x=s(r+x)+l;r=s(r)+l;x-=r;d&&(u+=1,q-=1);p&&(r-=1,x+=1);c.shapeType="rect";c.shapeArgs={x:u,y:r,width:q,height:x}})},getSymbol:na,drawLegendSymbol:Q.drawRectangle,drawGraph:na,drawPoints:function(){var a=this,b=this.chart,c=a.options,d=b.renderer,e=c.animationLimit||250,f,g,h;q(a.points,function(i){var k=i.plotY,j=i.graphic;if(k!==r&&!isNaN(k)&&i.y!==null)f=i.shapeArgs,h=t(a.borderWidth)?{"stroke-width":a.borderWidth}:{},g=i.pointAttr[i.selected?"select":
|
||||
""]||a.pointAttr[""],j?(eb(j),j.attr(h)[b.pointCount<e?"animate":"attr"](y(f))):i.graphic=d[i.shapeType](f).attr(g).attr(h).add(a.group).shadow(c.shadow,null,c.stacking&&!c.borderRadius);else if(j)i.graphic=j.destroy()})},animate:function(a){var b=this.yAxis,c=this.options,d=this.chart.inverted,e={};if(ca)a?(e.scaleY=0.001,a=z(b.pos+b.len,w(b.pos,b.toPixels(c.threshold))),d?e.translateX=a-b.len:e.translateY=a,this.group.attr(e)):(e.scaleY=1,e[d?"translateX":"translateY"]=b.pos,this.group.animate(e,
|
||||
this.options.animation),this.animate=null)},remove:function(){var a=this,b=a.chart;b.hasRendered&&q(b.series,function(b){if(b.type===a.type)b.isDirty=!0});K.prototype.remove.apply(a,arguments)}});C.column=Aa;T.bar=y(T.column);ta=ga(Aa,{type:"bar",inverted:!0});C.bar=ta;T.scatter=y(J,{lineWidth:0,tooltip:{headerFormat:'<span style="color:{series.color}">●</span> <span style="font-size: 10px;"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"},stickyTracking:!1});
|
||||
ta=ga(K,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["markerGroup"],takeOrdinalPosition:!1,singularTooltips:!0,drawGraph:function(){this.options.lineWidth&&K.prototype.drawGraph.call(this)}});C.scatter=ta;T.pie=y(J,{borderColor:"#FFFFFF",borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.point.name}},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,
|
||||
states:{hover:{brightness:0.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}});J={type:"pie",isCartesian:!1,pointClass:ga(za,{init:function(){za.prototype.init.apply(this,arguments);var a=this,b;if(a.y<0)a.y=null;v(a,{visible:a.visible!==!1,name:o(a.name,"Slice")});b=function(b){a.slice(b.type==="select")};A(a,"select",b);A(a,"unselect",b);return a},setVisible:function(a){var b=this,c=b.series,d=c.chart;b.visible=b.options.visible=a=a===r?!b.visible:a;c.options.data[wa(b,c.data)]=b.options;
|
||||
q(["graphic","dataLabel","connector","shadowGroup"],function(c){if(b[c])b[c][a?"show":"hide"](!0)});b.legendItem&&d.legend.colorizeItem(b,a);if(!c.isDirty&&c.options.ignoreHiddenPoint)c.isDirty=!0,d.redraw()},slice:function(a,b,c){var d=this.series;Ya(c,d.chart);o(b,!0);this.sliced=this.options.sliced=a=t(a)?a:!this.sliced;d.options.data[wa(this,d.data)]=this.options;a=a?this.slicedTranslation:{translateX:0,translateY:0};this.graphic.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)},haloPath:function(a){var b=
|
||||
this.shapeArgs,c=this.series.chart;return this.series.chart.renderer.symbols.arc(c.plotLeft+b.x,c.plotTop+b.y,b.r+a,b.r+a,{innerR:this.shapeArgs.r,start:b.start,end:b.end})}}),requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},singularTooltips:!0,getColor:na,animate:function(a){var b=this,c=b.points,d=b.startAngleRad;if(!a)q(c,function(a){var c=a.graphic,a=a.shapeArgs;c&&(c.attr({r:b.center[3]/
|
||||
2,start:d,end:d}),c.animate({r:a.r,start:a.start,end:a.end},b.options.animation))}),b.animate=null},setData:function(a,b,c,d){K.prototype.setData.call(this,a,!1,c,d);this.processData();this.generatePoints();o(b,!0)&&this.chart.redraw(c)},generatePoints:function(){var a,b=0,c,d,e,f=this.options.ignoreHiddenPoint;K.prototype.generatePoints.call(this);c=this.points;d=c.length;for(a=0;a<d;a++)e=c[a],b+=f&&!e.visible?0:e.y;this.total=b;for(a=0;a<d;a++)e=c[a],e.percentage=b>0?e.y/b*100:0,e.total=b},translate:function(a){this.generatePoints();
|
||||
var b=0,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f,g,h,i=c.startAngle||0,k=this.startAngleRad=ra/180*(i-90),i=(this.endAngleRad=ra/180*(o(c.endAngle,i+360)-90))-k,j=this.points,l=c.dataLabels.distance,c=c.ignoreHiddenPoint,m,n=j.length,p;if(!a)this.center=a=this.getCenter();this.getX=function(b,c){h=V.asin(z((b-a[1])/(a[2]/2+l),1));return a[0]+(c?-1:1)*da(h)*(a[2]/2+l)};for(m=0;m<n;m++){p=j[m];f=k+b*i;if(!c||p.visible)b+=p.percentage/100;g=k+b*i;p.shapeType="arc";p.shapeArgs={x:a[0],y:a[1],
|
||||
r:a[2]/2,innerR:a[3]/2,start:s(f*1E3)/1E3,end:s(g*1E3)/1E3};h=(g+f)/2;h>1.5*ra?h-=2*ra:h<-ra/2&&(h+=2*ra);p.slicedTranslation={translateX:s(da(h)*d),translateY:s(ia(h)*d)};f=da(h)*a[2]/2;g=ia(h)*a[2]/2;p.tooltipPos=[a[0]+f*0.7,a[1]+g*0.7];p.half=h<-ra/2||h>ra/2?1:0;p.angle=h;e=z(e,l/2);p.labelPos=[a[0]+f+da(h)*l,a[1]+g+ia(h)*l,a[0]+f+da(h)*e,a[1]+g+ia(h)*e,a[0]+f,a[1]+g,l<0?"center":p.half?"right":"left",h]}},drawGraph:null,drawPoints:function(){var a=this,b=a.chart.renderer,c,d,e=a.options.shadow,
|
||||
f,g;if(e&&!a.shadowGroup)a.shadowGroup=b.g("shadow").add(a.group);q(a.points,function(h){d=h.graphic;g=h.shapeArgs;f=h.shadowGroup;if(e&&!f)f=h.shadowGroup=b.g("shadow").add(a.shadowGroup);c=h.sliced?h.slicedTranslation:{translateX:0,translateY:0};f&&f.attr(c);d?d.animate(v(g,c)):h.graphic=d=b[h.shapeType](g).setRadialReference(a.center).attr(h.pointAttr[h.selected?"select":""]).attr({"stroke-linejoin":"round"}).attr(c).add(a.group).shadow(e,f);h.visible!==void 0&&h.setVisible(h.visible)})},sortByAngle:function(a,
|
||||
b){a.sort(function(a,d){return a.angle!==void 0&&(d.angle-a.angle)*b})},drawLegendSymbol:Q.drawRectangle,getCenter:ea.getCenter,getSymbol:na};J=ga(K,J);C.pie=J;K.prototype.drawDataLabels=function(){var a=this,b=a.options,c=b.cursor,d=b.dataLabels,e=a.points,f,g,h,i;if(d.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(d),i=a.plotGroup("dataLabelsGroup","data-labels","hidden",d.zIndex||6),!a.hasRendered&&o(d.defer,!0)&&(i.attr({opacity:0}),A(a,"afterAnimate",function(){a.dataLabelsGroup.show()[b.animation?
|
||||
"animate":"attr"]({opacity:1},{duration:200})})),g=d,q(e,function(b){var e,l=b.dataLabel,m,n,p=b.connector,u=!0;f=b.options&&b.options.dataLabels;e=o(f&&f.enabled,g.enabled);if(l&&!e)b.dataLabel=l.destroy();else if(e){d=y(g,f);e=d.rotation;m=b.getLabelConfig();h=d.format?Ja(d.format,m):d.formatter.call(m,d);d.style.color=o(d.color,d.style.color,a.color,"black");if(l)if(t(h))l.attr({text:h}),u=!1;else{if(b.dataLabel=l=l.destroy(),p)b.connector=p.destroy()}else if(t(h)){l={fill:d.backgroundColor,stroke:d.borderColor,
|
||||
"stroke-width":d.borderWidth,r:d.borderRadius||0,rotation:e,padding:d.padding,zIndex:1};for(n in l)l[n]===r&&delete l[n];l=b.dataLabel=a.chart.renderer[e?"text":"label"](h,0,-999,null,null,null,d.useHTML).attr(l).css(v(d.style,c&&{cursor:c})).add(i).shadow(d.shadow)}l&&a.alignDataLabel(b,l,d,null,u)}})};K.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=o(a.plotX,-999),i=o(a.plotY,-999),k=b.getBBox();if(a=this.visible&&(a.series.forceDL||f.isInsidePlot(h,s(i),g)||d&&f.isInsidePlot(h,
|
||||
g?d.x+1:d.y+d.height-1,g)))d=v({x:g?f.plotWidth-i:h,y:s(g?f.plotHeight-h:i),width:0,height:0},d),v(c,{width:k.width,height:k.height}),c.rotation?(g={align:c.align,x:d.x+c.x+d.width/2,y:d.y+c.y+d.height/2},b[e?"attr":"animate"](g)):(b.align(c,null,d),g=b.alignAttr,o(c.overflow,"justify")==="justify"?this.justifyDataLabel(b,c,g,k,d,e):o(c.crop,!0)&&(a=f.isInsidePlot(g.x,g.y)&&f.isInsidePlot(g.x+k.width,g.y+k.height)));if(!a)b.attr({y:-999}),b.placed=!1};K.prototype.justifyDataLabel=function(a,b,c,d,
|
||||
e,f){var g=this.chart,h=b.align,i=b.verticalAlign,k,j;k=c.x;if(k<0)h==="right"?b.align="left":b.x=-k,j=!0;k=c.x+d.width;if(k>g.plotWidth)h==="left"?b.align="right":b.x=g.plotWidth-k,j=!0;k=c.y;if(k<0)i==="bottom"?b.verticalAlign="top":b.y=-k,j=!0;k=c.y+d.height;if(k>g.plotHeight)i==="top"?b.verticalAlign="bottom":b.y=g.plotHeight-k,j=!0;if(j)a.placed=!f,a.align(b,null,e)};if(C.pie)C.pie.prototype.drawDataLabels=function(){var a=this,b=a.data,c,d=a.chart,e=a.options.dataLabels,f=o(e.connectorPadding,
|
||||
10),g=o(e.connectorWidth,1),h=d.plotWidth,d=d.plotHeight,i,k,j=o(e.softConnector,!0),l=e.distance,m=a.center,n=m[2]/2,p=m[1],u=l>0,r,G,x,t,v=[[],[]],y,z,A,B,D,U=[0,0,0,0],I=function(a,b){return b.y-a.y};if(a.visible&&(e.enabled||a._hasPointLabels)){K.prototype.drawDataLabels.apply(a);q(b,function(a){a.dataLabel&&a.visible&&v[a.half].push(a)});for(B=0;!t&&b[B];)t=b[B]&&b[B].dataLabel&&(b[B].dataLabel.getBBox().height||21),B++;for(B=2;B--;){var b=[],H=[],C=v[B],E=C.length,F;a.sortByAngle(C,B-0.5);if(l>
|
||||
0){for(D=p-n-l;D<=p+n+l;D+=t)b.push(D);G=b.length;if(E>G){c=[].concat(C);c.sort(I);for(D=E;D--;)c[D].rank=D;for(D=E;D--;)C[D].rank>=G&&C.splice(D,1);E=C.length}for(D=0;D<E;D++){c=C[D];x=c.labelPos;c=9999;var L,J;for(J=0;J<G;J++)L=M(b[J]-x[1]),L<c&&(c=L,F=J);if(F<D&&b[D]!==null)F=D;else for(G<E-D+F&&b[D]!==null&&(F=G-E+D);b[F]===null;)F++;H.push({i:F,y:b[F]});b[F]=null}H.sort(I)}for(D=0;D<E;D++){c=C[D];x=c.labelPos;r=c.dataLabel;A=c.visible===!1?"hidden":"visible";c=x[1];if(l>0){if(G=H.pop(),F=G.i,
|
||||
z=G.y,c>z&&b[F+1]!==null||c<z&&b[F-1]!==null)z=c}else z=c;y=e.justify?m[0]+(B?-1:1)*(n+l):a.getX(F===0||F===b.length-1?c:z,B);r._attr={visibility:A,align:x[6]};r._pos={x:y+e.x+({left:f,right:-f}[x[6]]||0),y:z+e.y-10};r.connX=y;r.connY=z;if(this.options.size===null)G=r.width,y-G<f?U[3]=w(s(G-y+f),U[3]):y+G>h-f&&(U[1]=w(s(y+G-h+f),U[1])),z-t/2<0?U[0]=w(s(-z+t/2),U[0]):z+t/2>d&&(U[2]=w(s(z+t/2-d),U[2]))}}if(Ba(U)===0||this.verifyDataLabelOverflow(U))this.placeDataLabels(),u&&g&&q(this.points,function(b){i=
|
||||
b.connector;x=b.labelPos;if((r=b.dataLabel)&&r._pos)A=r._attr.visibility,y=r.connX,z=r.connY,k=j?["M",y+(x[6]==="left"?5:-5),z,"C",y,z,2*x[2]-x[4],2*x[3]-x[5],x[2],x[3],"L",x[4],x[5]]:["M",y+(x[6]==="left"?5:-5),z,"L",x[2],x[3],"L",x[4],x[5]],i?(i.animate({d:k}),i.attr("visibility",A)):b.connector=i=a.chart.renderer.path(k).attr({"stroke-width":g,stroke:e.connectorColor||b.color||"#606060",visibility:A}).add(a.dataLabelsGroup);else if(i)b.connector=i.destroy()})}},C.pie.prototype.placeDataLabels=
|
||||
function(){q(this.points,function(a){var a=a.dataLabel,b;if(a)(b=a._pos)?(a.attr(a._attr),a[a.moved?"animate":"attr"](b),a.moved=!0):a&&a.attr({y:-999})})},C.pie.prototype.alignDataLabel=na,C.pie.prototype.verifyDataLabelOverflow=function(a){var b=this.center,c=this.options,d=c.center,e=c=c.minSize||80,f;d[0]!==null?e=w(b[2]-w(a[1],a[3]),c):(e=w(b[2]-a[1]-a[3],c),b[0]+=(a[3]-a[1])/2);d[1]!==null?e=w(z(e,b[2]-w(a[0],a[2])),c):(e=w(z(e,b[2]-a[0]-a[2]),c),b[1]+=(a[0]-a[2])/2);e<b[2]?(b[2]=e,this.translate(b),
|
||||
q(this.points,function(a){if(a.dataLabel)a.dataLabel._pos=null}),this.drawDataLabels&&this.drawDataLabels()):f=!0;return f};if(C.column)C.column.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=a.dlBox||a.shapeArgs,i=a.below||a.plotY>o(this.translatedThreshold,f.plotSizeY),k=o(c.inside,!!this.options.stacking);if(h&&(d=y(h),g&&(d={x:f.plotWidth-d.y-d.height,y:f.plotHeight-d.x-d.width,width:d.height,height:d.width}),!k))g?(d.x+=i?0:d.width,d.width=0):(d.y+=i?d.height:0,
|
||||
d.height=0);c.align=o(c.align,!g||k?"center":i?"right":"left");c.verticalAlign=o(c.verticalAlign,g||k?"middle":i?"top":"bottom");K.prototype.alignDataLabel.call(this,a,b,c,d,e)};var gb=P.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,d=a.options.cursor,e=d&&{cursor:d},f=function(c){var d=c.target,e;if(b.hoverSeries!==a)a.onMouseOver();for(;d&&!e;)e=d.point,d=d.parentNode;if(e!==r&&e!==b.hoverPoint)e.onMouseOver(c)};q(a.points,function(a){if(a.graphic)a.graphic.element.point=
|
||||
a;if(a.dataLabel)a.dataLabel.element.point=a});if(!a._hasTracking)q(a.trackerGroups,function(b){if(a[b]&&(a[b].addClass("highcharts-tracker").on("mouseover",f).on("mouseout",function(a){c.onTrackerMouseOut(a)}).css(e),ab))a[b].on("touchstart",f)}),a._hasTracking=!0},drawTrackerGraph:function(){var a=this,b=a.options,c=b.trackByArea,d=[].concat(c?a.areaPath:a.graphPath),e=d.length,f=a.chart,g=f.pointer,h=f.renderer,i=f.options.tooltip.snap,k=a.tracker,j=b.cursor,l=j&&{cursor:j},j=a.singlePoints,m,
|
||||
n=function(){if(f.hoverSeries!==a)a.onMouseOver()},p="rgba(192,192,192,"+(ca?1.0E-4:0.002)+")";if(e&&!c)for(m=e+1;m--;)d[m]==="M"&&d.splice(m+1,0,d[m+1]-i,d[m+2],"L"),(m&&d[m]==="M"||m===e)&&d.splice(m,0,"L",d[m-2]+i,d[m-1]);for(m=0;m<j.length;m++)e=j[m],d.push("M",e.plotX-i,e.plotY,"L",e.plotX+i,e.plotY);k?k.attr({d:d}):(a.tracker=h.path(d).attr({"stroke-linejoin":"round",visibility:a.visible?"visible":"hidden",stroke:p,fill:c?p:Y,"stroke-width":b.lineWidth+(c?0:2*i),zIndex:2}).add(a.group),q([a.tracker,
|
||||
a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",n).on("mouseout",function(a){g.onTrackerMouseOut(a)}).css(l);if(ab)a.on("touchstart",n)}))}};if(C.column)Aa.prototype.drawTracker=gb.drawTrackerPoint;if(C.pie)C.pie.prototype.drawTracker=gb.drawTrackerPoint;if(C.scatter)ta.prototype.drawTracker=gb.drawTrackerPoint;v(pb.prototype,{setItemEvents:function(a,b,c,d,e){var f=this;(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover");b.css(f.options.itemHoverStyle)}).on("mouseout",
|
||||
function(){b.css(a.visible?d:e);a.setState()}).on("click",function(b){var c=function(){a.setVisible()},b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):N(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=$("input",{type:"checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);A(a.checkbox,"click",function(b){N(a,"checkboxClick",{checked:b.target.checked},function(){a.select()})})}});F.legend.itemStyle.cursor=
|
||||
"pointer";v(va.prototype,{showResetZoom:function(){var a=this,b=F.lang,c=a.options.chart.resetZoomButton,d=c.theme,e=d.states,f=c.relativeTo==="chart"?null:"plotBox";this.resetZoomButton=a.renderer.button(b.resetZoom,null,null,function(){a.zoomOut()},d,e&&e.hover).attr({align:c.position.align,title:b.resetZoomTitle}).add().align(c.position,!1,f)},zoomOut:function(){var a=this;N(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var b,c=this.pointer,d=!1,e;!a||a.resetSelection?
|
||||
q(this.axes,function(a){b=a.zoom()}):q(a.xAxis.concat(a.yAxis),function(a){var e=a.axis,h=e.isXAxis;if(c[h?"zoomX":"zoomY"]||c[h?"pinchX":"pinchY"])b=e.zoom(a.min,a.max),e.displayBtn&&(d=!0)});e=this.resetZoomButton;if(d&&!e)this.showResetZoom();else if(!d&&fa(e))this.resetZoomButton=e.destroy();b&&this.redraw(o(this.options.chart.animation,a&&a.animation,this.pointCount<100))},pan:function(a,b){var c=this,d=c.hoverPoints,e;d&&q(d,function(a){a.setState()});q(b==="xy"?[1,0]:[1],function(b){var d=
|
||||
a[b?"chartX":"chartY"],h=c[b?"xAxis":"yAxis"][0],i=c[b?"mouseDownX":"mouseDownY"],k=(h.pointRange||0)/2,j=h.getExtremes(),l=h.toValue(i-d,!0)+k,i=h.toValue(i+c[b?"plotWidth":"plotHeight"]-d,!0)-k;h.series.length&&l>z(j.dataMin,j.min)&&i<w(j.dataMax,j.max)&&(h.setExtremes(l,i,!1,!1,{trigger:"pan"}),e=!0);c[b?"mouseDownX":"mouseDownY"]=d});e&&c.redraw(!1);E(c.container,{cursor:"move"})}});v(za.prototype,{select:function(a,b){var c=this,d=c.series,e=d.chart,a=o(a,!c.selected);c.firePointEvent(a?"select":
|
||||
"unselect",{accumulate:b},function(){c.selected=c.options.selected=a;d.options.data[wa(c,d.data)]=c.options;c.setState(a&&"select");b||q(e.getSelectedPoints(),function(a){if(a.selected&&a!==c)a.selected=a.options.selected=!1,d.options.data[wa(a,d.data)]=a.options,a.setState(""),a.firePointEvent("unselect")})})},onMouseOver:function(a){var b=this.series,c=b.chart,d=c.tooltip,e=c.hoverPoint;if(e&&e!==this)e.onMouseOut();this.firePointEvent("mouseOver");d&&(!d.shared||b.noSharedTooltip)&&d.refresh(this,
|
||||
a);this.setState("hover");c.hoverPoint=this},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints;if(!b||wa(this,b)===-1)this.firePointEvent("mouseOut"),this.setState(),a.hoverPoint=null},importEvents:function(){if(!this.hasImportedEvents){var a=y(this.series.options.point,this.options).events,b;this.events=a;for(b in a)A(this,b,a[b]);this.hasImportedEvents=!0}},setState:function(a,b){var c=this.plotX,d=this.plotY,e=this.series,f=e.options.states,g=T[e.type].marker&&e.options.marker,h=g&&
|
||||
!g.enabled,i=g&&g.states[a],k=i&&i.enabled===!1,j=e.stateMarkerGraphic,l=this.marker||{},m=e.chart,n=e.halo,p,a=a||"";p=this.pointAttr[a]||e.pointAttr[a];if(!(a===this.state&&!b||this.selected&&a!=="select"||f[a]&&f[a].enabled===!1||a&&(k||h&&i.enabled===!1)||a&&l.states&&l.states[a]&&l.states[a].enabled===!1)){if(this.graphic)g=g&&this.graphic.symbolName&&p.r,this.graphic.attr(y(p,g?{x:c-g,y:d-g,width:2*g,height:2*g}:{})),j&&j.hide();else{if(a&&i)if(g=i.radius,l=l.symbol||e.symbol,j&&j.currentSymbol!==
|
||||
l&&(j=j.destroy()),j)j[b?"animate":"attr"]({x:c-g,y:d-g});else if(l)e.stateMarkerGraphic=j=m.renderer.symbol(l,c-g,d-g,2*g,2*g).attr(p).add(e.markerGroup),j.currentSymbol=l;if(j)j[a&&m.isInsidePlot(c,d,m.inverted)?"show":"hide"]()}if((c=f[a]&&f[a].halo)&&c.size){if(!n)e.halo=n=m.renderer.path().add(e.seriesGroup);n.attr(v({fill:Fa(this.color||e.color).setOpacity(c.opacity).get()},c.attributes))[b?"animate":"attr"]({d:this.haloPath(c.size)})}else n&&n.attr({d:[]});this.state=a}},haloPath:function(a){var b=
|
||||
this.series,c=b.chart,d=b.getPlotBox(),e=c.inverted;return c.renderer.symbols.circle(d.translateX+(e?b.yAxis.len-this.plotY:this.plotX)-a,d.translateY+(e?b.xAxis.len-this.plotX:this.plotY)-a,a*2,a*2)}});v(K.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(b&&b!==this)b.onMouseOut();this.options.events.mouseOver&&N(this,"mouseOver");this.setState("hover");a.hoverSeries=this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;if(d)d.onMouseOut();this&&
|
||||
a.events.mouseOut&&N(this,"mouseOut");c&&!a.stickyTracking&&(!c.shared||this.noSharedTooltip)&&c.hide();this.setState();b.hoverSeries=null},setState:function(a){var b=this.options,c=this.graph,d=this.graphNeg,e=b.states,b=b.lineWidth,a=a||"";if(this.state!==a)this.state=a,e[a]&&e[a].enabled===!1||(a&&(b=e[a].lineWidth||b+1),c&&!c.dashstyle&&(a={"stroke-width":b},c.attr(a),d&&d.attr(a)))},setVisible:function(a,b){var c=this,d=c.chart,e=c.legendItem,f,g=d.options.chart.ignoreHiddenSeries,h=c.visible;
|
||||
f=(c.visible=a=c.userOptions.visible=a===r?!h:a)?"show":"hide";q(["group","dataLabelsGroup","markerGroup","tracker"],function(a){if(c[a])c[a][f]()});if(d.hoverSeries===c)c.onMouseOut();e&&d.legend.colorizeItem(c,a);c.isDirty=!0;c.options.stacking&&q(d.series,function(a){if(a.options.stacking&&a.visible)a.isDirty=!0});q(c.linkedSeries,function(b){b.setVisible(a,!1)});if(g)d.isDirtyBox=!0;b!==!1&&d.redraw();N(c,f)},setTooltipPoints:function(a){var b=[],c,d,e=this.xAxis,f=e&&e.getExtremes(),g=e?e.tooltipLen||
|
||||
e.len:this.chart.plotSizeX,h,i,k=[];if(!(this.options.enableMouseTracking===!1||this.singularTooltips)){if(a)this.tooltipPoints=null;q(this.segments||this.points,function(a){b=b.concat(a)});e&&e.reversed&&(b=b.reverse());this.orderTooltipPoints&&this.orderTooltipPoints(b);a=b.length;for(i=0;i<a;i++)if(e=b[i],c=e.x,c>=f.min&&c<=f.max){h=b[i+1];c=d===r?0:d+1;for(d=b[i+1]?z(w(0,S((e.clientX+(h?h.wrappedClientX||h.clientX:g))/2)),g):g;c>=0&&c<=d;)k[c++]=e}this.tooltipPoints=k}},show:function(){this.setVisible(!0)},
|
||||
hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=a===r?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;N(this,a?"select":"unselect")},drawTracker:gb.drawTrackerGraph});O(K.prototype,"init",function(a){var b;a.apply(this,Array.prototype.slice.call(arguments,1));(b=this.xAxis)&&b.options.ordinal&&A(this,"updatedData",function(){delete b.ordinalIndex})});O(L.prototype,"getTimeTicks",function(a,b,c,d,e,f,g,h){var i=0,k=0,j,l={},m,n,p,o=[],q=-Number.MAX_VALUE,s=this.options.tickPixelInterval;
|
||||
if(!this.options.ordinal||!f||f.length<3||c===r)return a.call(this,b,c,d,e);for(n=f.length;k<n;k++){p=k&&f[k-1]>d;f[k]<c&&(i=k);if(k===n-1||f[k+1]-f[k]>g*5||p){if(f[k]>q){for(j=a.call(this,b,f[i],f[k],e);j.length&&j[0]<=q;)j.shift();j.length&&(q=j[j.length-1]);o=o.concat(j)}i=k+1}if(p)break}a=j.info;if(h&&a.unitRange<=H.hour){k=o.length-1;for(i=1;i<k;i++)(new Date(o[i]-La))[Ua]()!==(new Date(o[i-1]-La))[Ua]()&&(l[o[i]]="day",m=!0);m&&(l[o[0]]="day");a.higherRanks=l}o.info=a;if(h&&t(s)){var h=a=o.length,
|
||||
k=[],x;for(m=[];h--;)i=this.translate(o[h]),x&&(m[h]=x-i),k[h]=x=i;m.sort();m=m[S(m.length/2)];m<s*0.6&&(m=null);h=o[a-1]>d?a-1:a;for(x=void 0;h--;)i=k[h],d=x-i,x&&d<s*0.8&&(m===null||d<m*0.8)?(l[o[h]]&&!l[o[h+1]]?(d=h+1,x=i):d=h,o.splice(d,1)):x=i}return o});v(L.prototype,{beforeSetTickPositions:function(){var a,b=[],c=!1,d,e=this.getExtremes(),f=e.min,e=e.max,g;if(this.options.ordinal){q(this.series,function(c,d){if(c.visible!==!1&&c.takeOrdinalPosition!==!1&&(b=b.concat(c.processedXData),a=b.length,
|
||||
b.sort(function(a,b){return a-b}),a))for(d=a-1;d--;)b[d]===b[d+1]&&b.splice(d,1)});a=b.length;if(a>2){d=b[1]-b[0];for(g=a-1;g--&&!c;)b[g+1]-b[g]!==d&&(c=!0);if(!this.options.keepOrdinalPadding&&(b[0]-f>d||e-b[b.length-1]>d))c=!0}c?(this.ordinalPositions=b,c=this.val2lin(w(f,b[0]),!0),d=this.val2lin(z(e,b[b.length-1]),!0),this.ordinalSlope=e=(e-f)/(d-c),this.ordinalOffset=f-c*e):this.ordinalPositions=this.ordinalSlope=this.ordinalOffset=r}this.groupIntervalFactor=null},val2lin:function(a,b){var c=
|
||||
this.ordinalPositions;if(c){var d=c.length,e,f;for(e=d;e--;)if(c[e]===a){f=e;break}for(e=d-1;e--;)if(a>c[e]||e===0){c=(a-c[e])/(c[e+1]-c[e]);f=e+c;break}return b?f:this.ordinalSlope*(f||0)+this.ordinalOffset}else return a},lin2val:function(a,b){var c=this.ordinalPositions;if(c){var d=this.ordinalSlope,e=this.ordinalOffset,f=c.length-1,g,h;if(b)a<0?a=c[0]:a>f?a=c[f]:(f=S(a),h=a-f);else for(;f--;)if(g=d*f+e,a>=g){d=d*(f+1)+e;h=(a-g)/(d-g);break}return h!==r&&c[f]!==r?c[f]+(h?h*(c[f+1]-c[f]):0):a}else return a},
|
||||
getExtendedPositions:function(){var a=this.chart,b=this.series[0].currentDataGrouping,c=this.ordinalIndex,d=b?b.count+b.unitName:"raw",e=this.getExtremes(),f,g;if(!c)c=this.ordinalIndex={};if(!c[d])f={series:[],getExtremes:function(){return{min:e.dataMin,max:e.dataMax}},options:{ordinal:!0},val2lin:L.prototype.val2lin},q(this.series,function(c){g={xAxis:f,xData:c.xData,chart:a,destroyGroupedData:na};g.options={dataGrouping:b?{enabled:!0,forced:!0,approximation:"open",units:[[b.unitName,[b.count]]]}:
|
||||
{enabled:!1}};c.processData.apply(g);f.series.push(g)}),this.beforeSetTickPositions.apply(f),c[d]=f.ordinalPositions;return c[d]},getGroupIntervalFactor:function(a,b,c){var d=0,c=c.processedXData,e=c.length,f=[],g=this.groupIntervalFactor;if(!g){for(;d<e-1;d++)f[d]=c[d+1]-c[d];f.sort(function(a,b){return a-b});d=f[S(e/2)];a=w(a,c[0]);b=z(b,c[e-1]);this.groupIntervalFactor=g=e*d/(b-a)}return g},postProcessTickInterval:function(a){var b=this.ordinalSlope;return b?a/(b/this.closestPointRange):a}});O(va.prototype,
|
||||
"pan",function(a,b){var c=this.xAxis[0],d=b.chartX,e=!1;if(c.options.ordinal&&c.series.length){var f=this.mouseDownX,g=c.getExtremes(),h=g.dataMax,i=g.min,k=g.max,j=this.hoverPoints,l=c.closestPointRange,f=(f-d)/(c.translationSlope*(c.ordinalSlope||l)),m={ordinalPositions:c.getExtendedPositions()},l=c.lin2val,n=c.val2lin,p;if(m.ordinalPositions){if(M(f)>1)j&&q(j,function(a){a.setState()}),f<0?(j=m,p=c.ordinalPositions?c:m):(j=c.ordinalPositions?c:m,p=m),m=p.ordinalPositions,h>m[m.length-1]&&m.push(h),
|
||||
this.fixedRange=k-i,f=c.toFixedRange(null,null,l.apply(j,[n.apply(j,[i,!0])+f,!0]),l.apply(p,[n.apply(p,[k,!0])+f,!0])),f.min>=z(g.dataMin,i)&&f.max<=w(h,k)&&c.setExtremes(f.min,f.max,!0,!1,{trigger:"pan"}),this.mouseDownX=d,E(this.container,{cursor:"move"})}else e=!0}else e=!0;e&&a.apply(this,Array.prototype.slice.call(arguments,1))});O(K.prototype,"getSegments",function(a){var b,c=this.options.gapSize,d=this.xAxis;a.apply(this,Array.prototype.slice.call(arguments,1));if(c)b=this.segments,q(b,function(a,
|
||||
f){for(var g=a.length-1;g--;)a[g+1].x-a[g].x>d.closestPointRange*c&&b.splice(f+1,0,a.splice(g+1,a.length-g))})});var ba=K.prototype,J=Hb.prototype,hc=ba.processData,ic=ba.generatePoints,jc=ba.destroy,kc=J.tooltipHeaderFormatter,lc={approximation:"average",groupPixelWidth:2,dateTimeLabelFormats:Kb("millisecond",["%A, %b %e, %H:%M:%S.%L","%A, %b %e, %H:%M:%S.%L","-%H:%M:%S.%L"],"second",["%A, %b %e, %H:%M:%S","%A, %b %e, %H:%M:%S","-%H:%M:%S"],"minute",["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],
|
||||
"hour",["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],"day",["%A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],"week",["Week from %A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],"month",["%B %Y","%B","-%B %Y"],"year",["%Y","%Y","-%Y"])},Wb={line:{},spline:{},area:{},areaspline:{},column:{approximation:"sum",groupPixelWidth:10},arearange:{approximation:"range"},areasplinerange:{approximation:"range"},columnrange:{approximation:"range",groupPixelWidth:10},candlestick:{approximation:"ohlc",groupPixelWidth:10},
|
||||
ohlc:{approximation:"ohlc",groupPixelWidth:5}},Xb=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]],Na={sum:function(a){var b=a.length,c;if(!b&&a.hasNulls)c=null;else if(b)for(c=0;b--;)c+=a[b];return c},average:function(a){var b=a.length,a=Na.sum(a);typeof a==="number"&&b&&(a/=b);return a},open:function(a){return a.length?a[0]:a.hasNulls?null:r},high:function(a){return a.length?
|
||||
Ba(a):a.hasNulls?null:r},low:function(a){return a.length?Ra(a):a.hasNulls?null:r},close:function(a){return a.length?a[a.length-1]:a.hasNulls?null:r},ohlc:function(a,b,c,d){a=Na.open(a);b=Na.high(b);c=Na.low(c);d=Na.close(d);if(typeof a==="number"||typeof b==="number"||typeof c==="number"||typeof d==="number")return[a,b,c,d]},range:function(a,b){a=Na.low(a);b=Na.high(b);if(typeof a==="number"||typeof b==="number")return[a,b]}};ba.groupData=function(a,b,c,d){var e=this.data,f=this.options.data,g=[],
|
||||
h=[],i=a.length,k,j,l=!!b,m=[[],[],[],[]],d=typeof d==="function"?d:Na[d],n=this.pointArrayMap,p=n&&n.length,o;for(o=0;o<=i;o++)if(a[o]>=c[0])break;for(;o<=i;o++){for(;c[1]!==r&&a[o]>=c[1]||o===i;)if(k=c.shift(),j=d.apply(0,m),j!==r&&(g.push(k),h.push(j)),m[0]=[],m[1]=[],m[2]=[],m[3]=[],o===i)break;if(o===i)break;if(n){k=this.cropStart+o;k=e&&e[k]||this.pointClass.prototype.applyOptions.apply({series:this},[f[k]]);var q;for(j=0;j<p;j++)if(q=k[n[j]],typeof q==="number")m[j].push(q);else if(q===null)m[j].hasNulls=
|
||||
!0}else if(k=l?b[o]:null,typeof k==="number")m[0].push(k);else if(k===null)m[0].hasNulls=!0}return[g,h]};ba.processData=function(){var a=this.chart,b=this.options,c=b.dataGrouping,d=c&&o(c.enabled,a.options._stock),e;this.forceCrop=d;this.groupPixelWidth=null;this.hasProcessed=!0;if(hc.apply(this,arguments)!==!1&&d){this.destroyGroupedData();var f=this.processedXData,g=this.processedYData,h=a.plotSizeX,a=this.xAxis,i=a.options.ordinal,k=this.groupPixelWidth=a.getGroupPixelWidth&&a.getGroupPixelWidth(),
|
||||
d=this.pointRange;if(k){e=!0;this.points=null;var j=a.getExtremes(),d=j.min,j=j.max,i=i&&a.getGroupIntervalFactor(d,j,this)||1,h=k*(j-d)/h*i,k=a.getTimeTicks(a.normalizeTimeTickInterval(h,c.units||Xb),d,j,null,f,this.closestPointRange),g=ba.groupData.apply(this,[f,g,k,c.approximation]),f=g[0],g=g[1];if(c.smoothed){c=f.length-1;for(f[c]=j;c--&&c>0;)f[c]+=h/2;f[0]=d}this.currentDataGrouping=k.info;if(b.pointRange===null)this.pointRange=k.info.totalRange;this.closestPointRange=k.info.totalRange;if(t(f[0])&&
|
||||
f[0]<a.dataMin)a.dataMin=f[0];this.processedXData=f;this.processedYData=g}else this.currentDataGrouping=null,this.pointRange=d;this.hasGroupedData=e}};ba.destroyGroupedData=function(){var a=this.groupedData;q(a||[],function(b,c){b&&(a[c]=b.destroy?b.destroy():null)});this.groupedData=null};ba.generatePoints=function(){ic.apply(this);this.destroyGroupedData();this.groupedData=this.hasGroupedData?this.points:null};J.tooltipHeaderFormatter=function(a){var b=a.series,c=b.tooltipOptions,d=b.options.dataGrouping,
|
||||
e=c.xDateFormat,f,g=b.xAxis,h;if(g&&g.options.type==="datetime"&&d&&la(a.key)){b=b.currentDataGrouping;d=d.dateTimeLabelFormats;if(b)g=d[b.unitName],b.count===1?e=g[0]:(e=g[1],f=g[2]);else if(!e&&d)for(h in H)if(H[h]>=g.closestPointRange||H[h]<=H.day&&a.key%H[h]>0){e=d[h][0];break}e=ua(e,a.key);f&&(e+=ua(f,a.key+b.totalRange-1));a=c.headerFormat.replace("{point.key}",e)}else a=kc.call(this,a);return a};ba.destroy=function(){for(var a=this.groupedData||[],b=a.length;b--;)a[b]&&a[b].destroy();jc.apply(this)};
|
||||
O(ba,"setOptions",function(a,b){var c=a.call(this,b),d=this.type,e=this.chart.options.plotOptions,f=T[d].dataGrouping;if(Wb[d])f||(f=y(lc,Wb[d])),c.dataGrouping=y(f,e.series&&e.series.dataGrouping,e[d].dataGrouping,b.dataGrouping);if(this.chart.options._stock)this.requireSorting=!0;return c});O(L.prototype,"setScale",function(a){a.call(this);q(this.series,function(a){a.hasProcessed=!1})});L.prototype.getGroupPixelWidth=function(){var a=this.series,b=a.length,c,d=0,e=!1,f;for(c=b;c--;)(f=a[c].options.dataGrouping)&&
|
||||
(d=w(d,f.groupPixelWidth));for(c=b;c--;)if((f=a[c].options.dataGrouping)&&a[c].hasProcessed)if(b=(a[c].processedXData||a[c].data).length,a[c].groupPixelWidth||b>this.chart.plotSizeX/d||b&&f.forced)e=!0;return e?d:0};T.ohlc=y(T.column,{lineWidth:1,tooltip:{pointFormat:'<span style="color:{series.color}">●</span> <b> {series.name}</b><br/>Open: {point.open}<br/>High: {point.high}<br/>Low: {point.low}<br/>Close: {point.close}<br/>'},states:{hover:{lineWidth:3}},threshold:null});J=ga(C.column,{type:"ohlc",
|
||||
pointArrayMap:["open","high","low","close"],toYData:function(a){return[a.open,a.high,a.low,a.close]},pointValKey:"high",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth"},upColorProp:"stroke",getAttribs:function(){C.column.prototype.getAttribs.apply(this,arguments);var a=this.options,b=a.states,a=a.upColor||this.color,c=y(this.pointAttr),d=this.upColorProp;c[""][d]=a;c.hover[d]=b.hover.upColor||a;c.select[d]=b.select.upColor||a;q(this.points,function(a){if(a.open<a.close)a.pointAttr=c})},
|
||||
translate:function(){var a=this.yAxis;C.column.prototype.translate.apply(this);q(this.points,function(b){if(b.open!==null)b.plotOpen=a.translate(b.open,0,1,0,1);if(b.close!==null)b.plotClose=a.translate(b.close,0,1,0,1)})},drawPoints:function(){var a=this,b=a.chart,c,d,e,f,g,h,i,k;q(a.points,function(j){if(j.plotY!==r)i=j.graphic,c=j.pointAttr[j.selected?"selected":""]||a.pointAttr[""],f=c["stroke-width"]%2/2,k=s(j.plotX)-f,g=s(j.shapeArgs.width/2),h=["M",k,s(j.yBottom),"L",k,s(j.plotY)],j.open!==
|
||||
null&&(d=s(j.plotOpen)+f,h.push("M",k,d,"L",k-g,d)),j.close!==null&&(e=s(j.plotClose)+f,h.push("M",k,e,"L",k+g,e)),i?i.animate({d:h}):j.graphic=b.renderer.path(h).attr(c).add(a.group)})},animate:null});C.ohlc=J;T.candlestick=y(T.column,{lineColor:"black",lineWidth:1,states:{hover:{lineWidth:2}},tooltip:T.ohlc.tooltip,threshold:null,upColor:"white"});J=ga(J,{type:"candlestick",pointAttrToOptions:{fill:"color",stroke:"lineColor","stroke-width":"lineWidth"},upColorProp:"fill",getAttribs:function(){C.ohlc.prototype.getAttribs.apply(this,
|
||||
arguments);var a=this.options,b=a.states,c=a.upLineColor||a.lineColor,d=b.hover.upLineColor||c,e=b.select.upLineColor||c;q(this.points,function(a){if(a.open<a.close)a.pointAttr[""].stroke=c,a.pointAttr.hover.stroke=d,a.pointAttr.select.stroke=e})},drawPoints:function(){var a=this,b=a.chart,c,d=a.pointAttr[""],e,f,g,h,i,k,j,l,m,n,p;q(a.points,function(o){m=o.graphic;if(o.plotY!==r)c=o.pointAttr[o.selected?"selected":""]||d,j=c["stroke-width"]%2/2,l=s(o.plotX)-j,e=o.plotOpen,f=o.plotClose,g=V.min(e,
|
||||
f),h=V.max(e,f),p=s(o.shapeArgs.width/2),i=s(g)!==s(o.plotY),k=h!==o.yBottom,g=s(g)+j,h=s(h)+j,n=["M",l-p,h,"L",l-p,g,"L",l+p,g,"L",l+p,h,"Z","M",l,g,"L",l,i?s(o.plotY):g,"M",l,h,"L",l,k?s(o.yBottom):h,"Z"],m?m.animate({d:n}):o.graphic=b.renderer.path(n).attr(c).add(a.group).shadow(a.options.shadow)})}});C.candlestick=J;var qb=ka.prototype.symbols;T.flags=y(T.column,{dataGrouping:null,fillColor:"white",lineWidth:1,pointRange:0,shape:"flag",stackDistance:12,states:{hover:{lineColor:"black",fillColor:"#FCFFC5"}},
|
||||
style:{fontSize:"11px",fontWeight:"bold",textAlign:"center"},tooltip:{pointFormat:"{point.text}<br/>"},threshold:null,y:-30});C.flags=ga(C.column,{type:"flags",sorted:!1,noSharedTooltip:!0,takeOrdinalPosition:!1,trackerGroups:["markerGroup"],forceCrop:!0,init:K.prototype.init,pointAttrToOptions:{fill:"fillColor",stroke:"color","stroke-width":"lineWidth",r:"radius"},translate:function(){C.column.prototype.translate.apply(this);var a=this.chart,b=this.points,c=b.length-1,d,e,f=this.options.onSeries,
|
||||
f=(d=f&&a.get(f))&&d.options.step,g=d&&d.points,h=g&&g.length,i=this.xAxis,k=i.getExtremes(),j,l,m;if(d&&d.visible&&h){d=d.currentDataGrouping;l=g[h-1].x+(d?d.totalRange:0);for(b.sort(function(a,b){return a.x-b.x});h--&&b[c];)if(d=b[c],j=g[h],j.x<=d.x&&j.plotY!==r){if(d.x<=l)d.plotY=j.plotY,j.x<d.x&&!f&&(m=g[h+1])&&m.plotY!==r&&(d.plotY+=(d.x-j.x)/(m.x-j.x)*(m.plotY-j.plotY));c--;h++;if(c<0)break}}q(b,function(c,d){if(c.plotY===r)c.x>=k.min&&c.x<=k.max?c.plotY=a.chartHeight-i.bottom-(i.opposite?i.height:
|
||||
0)+i.offset-a.plotTop:c.shapeArgs={};if((e=b[d-1])&&e.plotX===c.plotX){if(e.stackIndex===r)e.stackIndex=0;c.stackIndex=e.stackIndex+1}})},drawPoints:function(){var a,b=this.pointAttr[""],c=this.points,d=this.chart.renderer,e,f,g=this.options,h=g.y,i,k,j,l,m=g.lineWidth%2/2,n,o;for(k=c.length;k--;)if(j=c[k],a=j.plotX>this.xAxis.len,e=j.plotX+(a?m:-m),l=j.stackIndex,i=j.options.shape||g.shape,f=j.plotY,f!==r&&(f=j.plotY+h+m-(l!==r&&l*g.stackDistance)),n=l?r:j.plotX+m,o=l?r:j.plotY,l=j.graphic,f!==r&&
|
||||
e>=0&&!a)a=j.pointAttr[j.selected?"select":""]||b,l?l.attr({x:e,y:f,r:a.r,anchorX:n,anchorY:o}):j.graphic=d.label(j.options.title||g.title||"A",e,f,i,n,o,g.useHTML).css(y(g.style,j.style)).attr(a).attr({align:i==="flag"?"left":"center",width:g.width,height:g.height}).add(this.markerGroup).shadow(g.shadow),j.tooltipPos=[e,f];else if(l)j.graphic=l.destroy()},drawTracker:function(){var a=this.points;gb.drawTrackerPoint.apply(this);q(a,function(b){var c=b.graphic;c&&A(c.element,"mouseover",function(){if(b.stackIndex>
|
||||
0&&!b.raised)b._y=c.y,c.attr({y:b._y-8}),b.raised=!0;q(a,function(a){if(a!==b&&a.raised&&a.graphic)a.graphic.attr({y:a._y}),a.raised=!1})})})},animate:na});qb.flag=function(a,b,c,d,e){var f=e&&e.anchorX||a,e=e&&e.anchorY||b;return["M",f,e,"L",a,b+d,a,b,a+c,b,a+c,b+d,a,b+d,"M",f,e,"Z"]};q(["circle","square"],function(a){qb[a+"pin"]=function(b,c,d,e,f){var g=f&&f.anchorX,f=f&&f.anchorY,b=qb[a](b,c,d,e);g&&f&&b.push("M",g,c>f?c:c+e,"L",g,f);return b}});Wa===P.VMLRenderer&&q(["flag","circlepin","squarepin"],
|
||||
function(a){fb.prototype.symbols[a]=qb[a]});J=[].concat(Xb);J[4]=["day",[1,2,3,4]];J[5]=["week",[1,2,3]];v(F,{navigator:{handles:{backgroundColor:"#ebe7e8",borderColor:"#b2b1b6"},height:40,margin:25,maskFill:"rgba(128,179,236,0.3)",maskInside:!0,outlineColor:"#b2b1b6",outlineWidth:1,series:{type:C.areaspline===r?"line":"areaspline",color:"#4572A7",compare:null,fillOpacity:0.05,dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,smoothed:!0,units:J},dataLabels:{enabled:!1,zIndex:2},
|
||||
id:"highcharts-navigator-series",lineColor:"#4572A7",lineWidth:1,marker:{enabled:!1},pointRange:0,shadow:!1,threshold:null},xAxis:{tickWidth:0,lineWidth:0,gridLineColor:"#EEE",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left",style:{color:"#888"},x:3,y:-4},crosshair:!1},yAxis:{gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:0.1,maxPadding:0.1,labels:{enabled:!1},crosshair:!1,title:{text:null},tickWidth:0}},scrollbar:{height:cb?20:14,barBackgroundColor:"#bfc8d1",barBorderRadius:0,barBorderWidth:1,
|
||||
barBorderColor:"#bfc8d1",buttonArrowColor:"#666",buttonBackgroundColor:"#ebe7e8",buttonBorderColor:"#bbb",buttonBorderRadius:0,buttonBorderWidth:1,minWidth:6,rifleColor:"#666",trackBackgroundColor:"#eeeeee",trackBorderColor:"#eeeeee",trackBorderWidth:1,liveRedraw:ca&&!cb}});yb.prototype={drawHandle:function(a,b){var c=this.chart,d=c.renderer,e=this.elementsToDestroy,f=this.handles,g=this.navigatorOptions.handles,g={fill:g.backgroundColor,stroke:g.borderColor,"stroke-width":1},h;this.rendered||(f[b]=
|
||||
d.g("navigator-handle-"+["left","right"][b]).css({cursor:"e-resize"}).attr({zIndex:4-b}).add(),h=d.rect(-4.5,0,9,16,0,1).attr(g).add(f[b]),e.push(h),h=d.path(["M",-1.5,4,"L",-1.5,12,"M",0.5,4,"L",0.5,12]).attr(g).add(f[b]),e.push(h));f[b][c.isResizing?"animate":"attr"]({translateX:this.scrollerLeft+this.scrollbarHeight+parseInt(a,10),translateY:this.top+this.height/2-8})},drawScrollbarButton:function(a){var b=this.chart.renderer,c=this.elementsToDestroy,d=this.scrollbarButtons,e=this.scrollbarHeight,
|
||||
f=this.scrollbarOptions,g;this.rendered||(d[a]=b.g().add(this.scrollbarGroup),g=b.rect(-0.5,-0.5,e+1,e+1,f.buttonBorderRadius,f.buttonBorderWidth).attr({stroke:f.buttonBorderColor,"stroke-width":f.buttonBorderWidth,fill:f.buttonBackgroundColor}).add(d[a]),c.push(g),g=b.path(["M",e/2+(a?-1:1),e/2-3,"L",e/2+(a?-1:1),e/2+3,e/2+(a?2:-2),e/2]).attr({fill:f.buttonArrowColor}).add(d[a]),c.push(g));a&&d[a].attr({translateX:this.scrollerWidth-e})},render:function(a,b,c,d){var e=this.chart,f=e.renderer,g,h,
|
||||
i,k,j=this.scrollbarGroup,l=this.navigatorGroup,m=this.scrollbar,l=this.xAxis,n=this.scrollbarTrack,p=this.scrollbarHeight,q=this.scrollbarEnabled,r=this.navigatorOptions,t=this.scrollbarOptions,x=t.minWidth,v=this.height,y=this.top,A=this.navigatorEnabled,B=r.outlineWidth,C=B/2,F=0,D=this.outlineHeight,I=t.barBorderRadius,H=t.barBorderWidth,E=y+C,J;if(!isNaN(a)){this.navigatorLeft=g=o(l.left,e.plotLeft+p);this.navigatorWidth=h=o(l.len,e.plotWidth-2*p);this.scrollerLeft=i=g-p;this.scrollerWidth=k=
|
||||
k=h+2*p;l.getExtremes&&(J=this.getUnionExtremes(!0))&&(J.dataMin!==l.min||J.dataMax!==l.max)&&l.setExtremes(J.dataMin,J.dataMax,!0,!1);c=o(c,l.translate(a));d=o(d,l.translate(b));if(isNaN(c)||M(c)===Infinity)c=0,d=k;if(!(l.translate(d,!0)-l.translate(c,!0)<e.xAxis[0].minRange)){this.zoomedMax=z(w(c,d),h);this.zoomedMin=w(this.fixedWidth?this.zoomedMax-this.fixedWidth:z(c,d),0);this.range=this.zoomedMax-this.zoomedMin;c=s(this.zoomedMax);b=s(this.zoomedMin);a=c-b;if(!this.rendered){if(A){this.navigatorGroup=
|
||||
l=f.g("navigator").attr({zIndex:3}).add();this.leftShade=f.rect().attr({fill:r.maskFill}).add(l);if(!r.maskInside)this.rightShade=f.rect().attr({fill:r.maskFill}).add(l);this.outline=f.path().attr({"stroke-width":B,stroke:r.outlineColor}).add(l)}if(q)this.scrollbarGroup=j=f.g("scrollbar").add(),m=t.trackBorderWidth,this.scrollbarTrack=n=f.rect().attr({x:0,y:-m%2/2,fill:t.trackBackgroundColor,stroke:t.trackBorderColor,"stroke-width":m,r:t.trackBorderRadius||0,height:p}).add(j),this.scrollbar=m=f.rect().attr({y:-H%
|
||||
2/2,height:p,fill:t.barBackgroundColor,stroke:t.barBorderColor,"stroke-width":H,r:I}).add(j),this.scrollbarRifles=f.path().attr({stroke:t.rifleColor,"stroke-width":1}).add(j)}e=e.isResizing?"animate":"attr";if(A){this.leftShade[e](r.maskInside?{x:g+b,y:y,width:c-b,height:v}:{x:g,y:y,width:b,height:v});if(this.rightShade)this.rightShade[e]({x:g+c,y:y,width:h-c,height:v});this.outline[e]({d:["M",i,E,"L",g+b+C,E,g+b+C,E+D,"L",g+c-C,E+D,"L",g+c-C,E,i+k,E].concat(r.maskInside?["M",g+b+C,E,"L",g+c-C,E]:
|
||||
[])});this.drawHandle(b+C,0);this.drawHandle(c+C,1)}if(q&&j)this.drawScrollbarButton(0),this.drawScrollbarButton(1),j[e]({translateX:i,translateY:s(E+v)}),n[e]({width:k}),g=p+b,h=a-H,h<x&&(F=(x-h)/2,h=x,g-=F),this.scrollbarPad=F,m[e]({x:S(g)+H%2/2,width:h}),x=p+b+a/2-0.5,this.scrollbarRifles.attr({visibility:a>12?"visible":"hidden"})[e]({d:["M",x-3,p/4,"L",x-3,2*p/3,"M",x,p/4,"L",x,2*p/3,"M",x+3,p/4,"L",x+3,2*p/3]});this.scrollbarPad=F;this.rendered=!0}}},addEvents:function(){var a=this.chart.container,
|
||||
b=this.mouseDownHandler,c=this.mouseMoveHandler,d=this.mouseUpHandler,e;e=[[a,"mousedown",b],[a,"mousemove",c],[document,"mouseup",d]];ab&&e.push([a,"touchstart",b],[a,"touchmove",c],[document,"touchend",d]);q(e,function(a){A.apply(null,a)});this._events=e},removeEvents:function(){q(this._events,function(a){R.apply(null,a)});this._events=r;this.navigatorEnabled&&this.baseSeries&&R(this.baseSeries,"updatedData",this.updatedDataHandler)},init:function(){var a=this,b=a.chart,c,d,e=a.scrollbarHeight,
|
||||
f=a.navigatorOptions,g=a.height,h=a.top,i,k,j=document.body.style,l,m=a.baseSeries;a.mouseDownHandler=function(d){var d=b.pointer.normalize(d),e=a.zoomedMin,f=a.zoomedMax,h=a.top,k=a.scrollbarHeight,m=a.scrollerLeft,n=a.scrollerWidth,o=a.navigatorLeft,p=a.navigatorWidth,q=a.scrollbarPad,r=a.range,s=d.chartX,t=d.chartY,d=b.xAxis[0],v,w=cb?10:7;if(t>h&&t<h+g+k)if((h=!a.scrollbarEnabled||t<h+g)&&V.abs(s-e-o)<w)a.grabbedLeft=!0,a.otherHandlePos=f,a.fixedExtreme=d.max,b.fixedRange=null;else if(h&&V.abs(s-
|
||||
f-o)<w)a.grabbedRight=!0,a.otherHandlePos=e,a.fixedExtreme=d.min,b.fixedRange=null;else if(s>o+e-q&&s<o+f+q){a.grabbedCenter=s;a.fixedWidth=r;if(b.renderer.isSVG)l=j.cursor,j.cursor="ew-resize";i=s-e}else if(s>m&&s<m+n){f=h?s-o-r/2:s<o?e-r*0.2:s>m+n-k?e+r*0.2:s<o+e?e-r:f;if(f<0)f=0;else if(f+r>=p)f=p-r,v=c.dataMax;if(f!==e)a.fixedWidth=r,e=c.toFixedRange(f,f+r,null,v),d.setExtremes(e.min,e.max,!0,!1,{trigger:"navigator"})}};a.mouseMoveHandler=function(c){var d=a.scrollbarHeight,e=a.navigatorLeft,
|
||||
f=a.navigatorWidth,g=a.scrollerLeft,h=a.scrollerWidth,j=a.range,l;if(c.pageX!==0)c=b.pointer.normalize(c),l=c.chartX,l<e?l=e:l>g+h-d&&(l=g+h-d),a.grabbedLeft?(k=!0,a.render(0,0,l-e,a.otherHandlePos)):a.grabbedRight?(k=!0,a.render(0,0,a.otherHandlePos,l-e)):a.grabbedCenter&&(k=!0,l<i?l=i:l>f+i-j&&(l=f+i-j),a.render(0,0,l-i,l-i+j)),k&&a.scrollbarOptions.liveRedraw&&setTimeout(function(){a.mouseUpHandler(c)},0)};a.mouseUpHandler=function(d){var e,f;if(k){if(a.zoomedMin===a.otherHandlePos)e=a.fixedExtreme;
|
||||
else if(a.zoomedMax===a.otherHandlePos)f=a.fixedExtreme;e=c.toFixedRange(a.zoomedMin,a.zoomedMax,e,f);b.xAxis[0].setExtremes(e.min,e.max,!0,!1,{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:d})}if(d.type!=="mousemove")a.grabbedLeft=a.grabbedRight=a.grabbedCenter=a.fixedWidth=a.fixedExtreme=a.otherHandlePos=k=i=null,j.cursor=l||""};var n=b.xAxis.length,p=b.yAxis.length;b.extraBottomMargin=a.outlineHeight+f.margin;a.navigatorEnabled?(a.xAxis=c=new L(b,y({ordinal:m&&m.xAxis.options.ordinal},
|
||||
f.xAxis,{id:"navigator-x-axis",isX:!0,type:"datetime",index:n,height:g,offset:0,offsetLeft:e,offsetRight:-e,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:0,maxPadding:0,zoomEnabled:!1})),a.yAxis=d=new L(b,y(f.yAxis,{id:"navigator-y-axis",alignTicks:!1,height:g,offset:0,index:p,zoomEnabled:!1})),m||f.series.data?a.addBaseSeries():b.series.length===0&&O(b,"redraw",function(c,d){if(b.series.length>0&&!a.series)a.setBaseSeries(),b.redraw=c;c.call(b,d)})):a.xAxis=c={translate:function(a,
|
||||
c){var d=b.xAxis[0].getExtremes(),f=b.plotWidth-2*e,g=d.dataMin,d=d.dataMax-g;return c?a*d/f+g:f*(a-g)/d},toFixedRange:L.prototype.toFixedRange};O(b,"getMargins",function(b){var e=this.legend,f=e.options;b.call(this);a.top=h=a.navigatorOptions.top||this.chartHeight-a.height-a.scrollbarHeight-this.spacing[2]-(f.verticalAlign==="bottom"&&f.enabled&&!f.floating?e.legendHeight+o(f.margin,10):0);if(c&&d)c.options.top=d.options.top=h,c.setAxisSize(),d.setAxisSize()});a.addEvents()},getUnionExtremes:function(a){var b=
|
||||
this.chart.xAxis[0],c=this.xAxis,d=c.options;if(!a||b.dataMin!==null)return{dataMin:o(d&&d.min,(t(b.dataMin)&&t(c.dataMin)?z:o)(b.dataMin,c.dataMin)),dataMax:o(d&&d.max,(t(b.dataMax)&&t(c.dataMax)?w:o)(b.dataMax,c.dataMax))}},setBaseSeries:function(a){var b=this.chart,a=a||b.options.navigator.baseSeries;this.series&&this.series.remove();this.baseSeries=b.series[a]||typeof a==="string"&&b.get(a)||b.series[0];this.xAxis&&this.addBaseSeries()},addBaseSeries:function(){var a=this.baseSeries,b=a?a.options:
|
||||
{},c=b.data,d=this.navigatorOptions.series,e;e=d.data;this.hasNavigatorData=!!e;b=y(b,d,{enableMouseTracking:!1,group:"nav",padXAxis:!1,xAxis:"navigator-x-axis",yAxis:"navigator-y-axis",name:"Navigator",showInLegend:!1,isInternal:!0,visible:!0});b.data=e||c;this.series=this.chart.initSeries(b);if(a&&this.navigatorOptions.adaptToUpdatedData!==!1)A(a,"updatedData",this.updatedDataHandler),a.userOptions.events=v(a.userOptions.event,{updatedData:this.updatedDataHandler})},updatedDataHandler:function(){var a=
|
||||
this.chart.scroller,b=a.baseSeries,c=b.xAxis,d=c.getExtremes(),e=d.min,f=d.max,g=d.dataMin,d=d.dataMax,h=f-e,i,k,j,l,m,n=a.series;i=n.xData;var o=!!c.setExtremes;k=f>=i[i.length-1]-(this.closestPointRange||0);i=e<=g;if(!a.hasNavigatorData)n.options.pointStart=b.xData[0],n.setData(b.options.data,!1),m=!0;i&&(l=g,j=l+h);k&&(j=d,i||(l=w(j-h,n.xData[0])));o&&(i||k)?isNaN(l)||c.setExtremes(l,j,!0,!1,{trigger:"updatedData"}):(m&&this.chart.redraw(!1),a.render(w(e,g),z(f,d)))},destroy:function(){this.removeEvents();
|
||||
q([this.xAxis,this.yAxis,this.leftShade,this.rightShade,this.outline,this.scrollbarTrack,this.scrollbarRifles,this.scrollbarGroup,this.scrollbar],function(a){a&&a.destroy&&a.destroy()});this.xAxis=this.yAxis=this.leftShade=this.rightShade=this.outline=this.scrollbarTrack=this.scrollbarRifles=this.scrollbarGroup=this.scrollbar=null;q([this.scrollbarButtons,this.handles,this.elementsToDestroy],function(a){Ka(a)})}};P.Scroller=yb;O(L.prototype,"zoom",function(a,b,c){var d=this.chart,e=d.options,f=e.chart.zoomType,
|
||||
g=e.navigator,e=e.rangeSelector,h;if(this.isXAxis&&(g&&g.enabled||e&&e.enabled))if(f==="x")d.resetZoomButton="blocked";else if(f==="y")h=!1;else if(f==="xy")d=this.previousZoom,t(b)?this.previousZoom=[this.min,this.max]:d&&(b=d[0],c=d[1],delete this.previousZoom);return h!==r?h:a.call(this,b,c)});O(va.prototype,"init",function(a,b,c){A(this,"beforeRender",function(){var a=this.options;if(a.navigator.enabled||a.scrollbar.enabled)this.scroller=new yb(this)});a.call(this,b,c)});O(K.prototype,"addPoint",
|
||||
function(a,b,c,d,e){var f=this.options.turboThreshold;f&&this.xData.length>f&&fa(b)&&!Pa(b)&&this.chart.scroller&&qa(20,!0);a.call(this,b,c,d,e)});v(F,{rangeSelector:{buttonTheme:{width:28,height:18,fill:"#f7f7f7",padding:2,r:0,"stroke-width":0,style:{color:"#444",cursor:"pointer",fontWeight:"normal"},zIndex:7,states:{hover:{fill:"#e7e7e7"},select:{fill:"#e7f0f9",style:{color:"black",fontWeight:"bold"}}}},inputPosition:{align:"right"},labelStyle:{color:"#666"}}});F.lang=y(F.lang,{rangeSelectorZoom:"Zoom",
|
||||
rangeSelectorFrom:"From",rangeSelectorTo:"To"});zb.prototype={clickButton:function(a,b){var c=this,d=c.selected,e=c.chart,f=c.buttons,g=c.buttonOptions[a],h=e.xAxis[0],i=e.scroller&&e.scroller.getUnionExtremes()||h||{},k=i.dataMin,j=i.dataMax,l,m=h&&s(z(h.max,o(j,h.max))),n=new Date(m),p=g.type,u=g.count,i=g._range,t;if(!(k===null||j===null||a===c.selected)){if(p==="month"||p==="year")l={month:"Month",year:"FullYear"}[p],n["set"+l](n["get"+l]()-u),l=n.getTime(),k=o(k,Number.MIN_VALUE),isNaN(l)||l<
|
||||
k?(l=k,m=z(l+i,j)):i=m-l;else if(i)l=w(m-i,k),m=z(l+i,j);else if(p==="ytd")if(h){if(j===r)k=Number.MAX_VALUE,j=Number.MIN_VALUE,q(e.series,function(a){a=a.xData;k=z(a[0],k);j=w(a[a.length-1],j)}),b=!1;m=new Date(j);t=m.getFullYear();l=t=w(k||0,Date.UTC(t,0,1));m=m.getTime();m=z(j||m,m)}else{A(e,"beforeRender",function(){c.clickButton(a)});return}else p==="all"&&h&&(l=k,m=j);f[d]&&f[d].setState(0);f[a]&&f[a].setState(2);e.fixedRange=i;h?h.setExtremes(l,m,o(b,1),0,{trigger:"rangeSelectorButton",rangeSelectorButton:g}):
|
||||
(d=e.options.xAxis,d[0]=y(d[0],{range:i,min:t}));c.setSelected(a)}},setSelected:function(a){this.selected=this.options.selected=a},defaultButtons:[{type:"month",count:1,text:"1m"},{type:"month",count:3,text:"3m"},{type:"month",count:6,text:"6m"},{type:"ytd",text:"YTD"},{type:"year",count:1,text:"1y"},{type:"all",text:"All"}],init:function(a){var b=this,c=a.options.rangeSelector,d=c.buttons||[].concat(b.defaultButtons),e=c.selected,f=b.blurInputs=function(){var a=b.minInput,c=b.maxInput;a&&a.blur();
|
||||
c&&c.blur()};b.chart=a;b.options=c;b.buttons=[];a.extraTopMargin=35;b.buttonOptions=d;A(a.container,"mousedown",f);A(a,"resize",f);q(d,b.computeButtonRange);e!==r&&d[e]&&this.clickButton(e,!1);A(a,"load",function(){A(a.xAxis[0],"afterSetExtremes",function(){b.updateButtonStates(!0)})})},updateButtonStates:function(a){var b=this,c=this.chart,d=c.xAxis[0],e=c.scroller&&c.scroller.getUnionExtremes()||d,f=e.dataMin,g=e.dataMax,h=b.selected,i=b.buttons;a&&c.fixedRange!==s(d.max-d.min)&&(i[h]&&i[h].setState(0),
|
||||
b.setSelected(null));q(b.buttonOptions,function(a,c){var e=a._range,m=e>g-f,n=e<d.minRange,o=a.type==="all"&&d.max-d.min>=g-f&&i[c].state!==2,q=a.type==="ytd"&&ua("%Y",f)===ua("%Y",g);e===s(d.max-d.min)&&c!==h?(b.setSelected(c),i[c].setState(2)):m||n||o||q?i[c].setState(3):i[c].state===3&&i[c].setState(0)})},computeButtonRange:function(a){var b=a.type,c=a.count||1,d={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5};if(d[b])a._range=d[b]*c;else if(b==="month"||b==="year")a._range=
|
||||
{month:30,year:365}[b]*864E5*c},setInputValue:function(a,b){var c=this.chart.options.rangeSelector;if(t(b))this[a+"Input"].HCTime=b;this[a+"Input"].value=ua(c.inputEditDateFormat||"%Y-%m-%d",this[a+"Input"].HCTime);this[a+"DateBox"].attr({text:ua(c.inputDateFormat||"%b %e, %Y",this[a+"Input"].HCTime)})},drawInput:function(a){var b=this,c=b.chart,d=c.renderer.style,e=c.renderer,f=c.options.rangeSelector,g=b.div,h=a==="min",i,k,j,l=this.inputGroup;this[a+"Label"]=k=e.label(F.lang[h?"rangeSelectorFrom":
|
||||
"rangeSelectorTo"],this.inputGroup.offset).attr({padding:2}).css(y(d,f.labelStyle)).add(l);l.offset+=k.width+5;this[a+"DateBox"]=j=e.label("",l.offset).attr({padding:2,width:f.inputBoxWidth||90,height:f.inputBoxHeight||17,stroke:f.inputBoxBorderColor||"silver","stroke-width":1}).css(y({textAlign:"center",color:"#444"},d,f.inputStyle)).on("click",function(){b[a+"Input"].focus()}).add(l);l.offset+=j.width+(h?10:0);this[a+"Input"]=i=$("input",{name:a,className:"highcharts-range-selector",type:"text"},
|
||||
v({position:"absolute",border:0,width:"1px",height:"1px",padding:0,textAlign:"center",fontSize:d.fontSize,fontFamily:d.fontFamily,top:c.plotTop+"px"},f.inputStyle),g);i.onfocus=function(){E(this,{left:l.translateX+j.x+"px",top:l.translateY+"px",width:j.width-2+"px",height:j.height-2+"px",border:"2px solid silver"})};i.onblur=function(){E(this,{border:0,width:"1px",height:"1px"});b.setInputValue(a)};i.onchange=function(){var a=i.value,d=(f.inputDateParser||Date.parse)(a),e=c.xAxis[0],g=e.dataMin,j=
|
||||
e.dataMax;isNaN(d)&&(d=a.split("-"),d=Date.UTC(I(d[0]),I(d[1])-1,I(d[2])));isNaN(d)||(F.global.useUTC||(d+=(new Date).getTimezoneOffset()*6E4),h?d>b.maxInput.HCTime?d=r:d<g&&(d=g):d<b.minInput.HCTime?d=r:d>j&&(d=j),d!==r&&c.xAxis[0].setExtremes(h?d:e.min,h?e.max:d,r,r,{trigger:"rangeSelectorInput"}))}},render:function(a,b){var c=this,d=c.chart,e=d.renderer,f=d.container,g=d.options,h=g.exporting&&g.navigation&&g.navigation.buttonOptions,i=g.rangeSelector,k=c.buttons,g=F.lang,j=c.div,j=c.inputGroup,
|
||||
l=i.buttonTheme,m=i.inputEnabled!==!1,n=l&&l.states,p=d.plotLeft,r;if(!c.rendered&&(c.zoomText=e.text(g.rangeSelectorZoom,p,d.plotTop-20).css(i.labelStyle).add(),r=p+c.zoomText.getBBox().width+5,q(c.buttonOptions,function(a,b){k[b]=e.button(a.text,r,d.plotTop-35,function(){c.clickButton(b);c.isActive=!0},l,n&&n.hover,n&&n.select).css({textAlign:"center"}).add();r+=k[b].width+o(i.buttonSpacing,5);c.selected===b&&k[b].setState(2)}),c.updateButtonStates(),m))c.div=j=$("div",null,{position:"relative",
|
||||
height:0,zIndex:1}),f.parentNode.insertBefore(j,f),c.inputGroup=j=e.g("input-group").add(),j.offset=0,c.drawInput("min"),c.drawInput("max");m&&(f=d.plotTop-45,j.align(v({y:f,width:j.offset,x:h&&f<(h.y||0)+h.height-d.spacing[0]?-40:0},i.inputPosition),!0,d.spacingBox),c.setInputValue("min",a),c.setInputValue("max",b));c.rendered=!0},destroy:function(){var a=this.minInput,b=this.maxInput,c=this.chart,d=this.blurInputs,e;R(c.container,"mousedown",d);R(c,"resize",d);Ka(this.buttons);if(a)a.onfocus=a.onblur=
|
||||
a.onchange=null;if(b)b.onfocus=b.onblur=b.onchange=null;for(e in this)this[e]&&e!=="chart"&&(this[e].destroy?this[e].destroy():this[e].nodeType&&Sa(this[e])),this[e]=null}};L.prototype.toFixedRange=function(a,b,c,d){var e=this.chart&&this.chart.fixedRange,a=o(c,this.translate(a,!0)),b=o(d,this.translate(b,!0)),c=e&&(b-a)/e;c>0.7&&c<1.3&&(d?a=b-e:b=a+e);return{min:a,max:b}};O(va.prototype,"init",function(a,b,c){A(this,"init",function(){if(this.options.rangeSelector.enabled)this.rangeSelector=new zb(this)});
|
||||
a.call(this,b,c)});P.RangeSelector=zb;va.prototype.callbacks.push(function(a){function b(){f=a.xAxis[0].getExtremes();g.render(f.min,f.max)}function c(){f=a.xAxis[0].getExtremes();isNaN(f.min)||h.render(f.min,f.max)}function d(a){a.triggerOp!=="navigator-drag"&&g.render(a.min,a.max)}function e(a){h.render(a.min,a.max)}var f,g=a.scroller,h=a.rangeSelector;g&&(A(a.xAxis[0],"afterSetExtremes",d),O(a,"drawChartBox",function(a){var c=this.isDirtyBox;a.call(this);c&&b()}),b());h&&(A(a.xAxis[0],"afterSetExtremes",
|
||||
e),A(a,"resize",c),c());A(a,"destroy",function(){g&&R(a.xAxis[0],"afterSetExtremes",d);h&&(R(a,"resize",c),R(a.xAxis[0],"afterSetExtremes",e))})});P.StockChart=function(a,b){var c=a.series,d,e=o(a.navigator&&a.navigator.enabled,!0)?{startOnTick:!1,endOnTick:!1}:null,f={marker:{enabled:!1,radius:2},states:{hover:{lineWidth:2}}},g={shadow:!1,borderWidth:0};a.xAxis=xa(ma(a.xAxis||{}),function(a){return y({minPadding:0,maxPadding:0,ordinal:!0,title:{text:null},labels:{overflow:"justify"},showLastLabel:!0},
|
||||
a,{type:"datetime",categories:null},e)});a.yAxis=xa(ma(a.yAxis||{}),function(a){d=o(a.opposite,!0);return y({labels:{y:-2},opposite:d,showLastLabel:!1,title:{text:null}},a)});a.series=null;a=y({chart:{panning:!0,pinchType:"x"},navigator:{enabled:!0},scrollbar:{enabled:!0},rangeSelector:{enabled:!0},title:{text:null,style:{fontSize:"16px"}},tooltip:{shared:!0,crosshairs:!0},legend:{enabled:!1},plotOptions:{line:f,spline:f,area:f,areaspline:f,arearange:f,areasplinerange:f,column:g,columnrange:g,candlestick:g,
|
||||
ohlc:g}},a,{_stock:!0,chart:{inverted:!1}});a.series=c;return new va(a,b)};O(Xa.prototype,"init",function(a,b,c){var d=c.chart.pinchType||"";a.call(this,b,c);this.pinchX=this.pinchHor=d.indexOf("x")!==-1;this.pinchY=this.pinchVert=d.indexOf("y")!==-1;this.hasZoom=this.hasZoom||this.pinchHor||this.pinchVert});O(L.prototype,"autoLabelAlign",function(a){if(this.chart.options._stock&&this.coll==="yAxis"&&wa(this,this.chart.yAxis)===0){if(this.options.labels.x===15)this.options.labels.x=0;return"right"}return a.call(this)});
|
||||
L.prototype.getPlotLinePath=function(a,b,c,d,e){var f=this,g=this.isLinked&&!this.series?this.linkedParent.series:this.series,h=f.chart,i=h.renderer,k=f.left,j=f.top,l,m,n,p,r=[],v,w;v=f.isXAxis?t(f.options.yAxis)?[h.yAxis[f.options.yAxis]]:xa(g,function(a){return a.yAxis}):t(f.options.xAxis)?[h.xAxis[f.options.xAxis]]:xa(g,function(a){return a.xAxis});q(f.isXAxis?h.yAxis:h.xAxis,function(a){if(t(a.options.id)?a.options.id.indexOf("navigator")===-1:1){var b=a.isXAxis?"yAxis":"xAxis",b=t(a.options[b])?
|
||||
h[b][a.options[b]]:h[b][0];f===b&&v.push(a)}});w=v.length?[]:[f];q(v,function(a){wa(a,w)===-1&&w.push(a)});e=o(e,f.translate(a,null,null,c));isNaN(e)||(f.horiz?q(w,function(a){m=a.top;p=m+a.len;l=n=s(e+f.transB);(l>=k&&l<=k+f.width||d)&&r.push("M",l,m,"L",n,p)}):q(w,function(a){l=a.left;n=l+a.width;m=p=s(j+f.height-e);(m>=j&&m<=j+f.height||d)&&r.push("M",l,m,"L",n,p)}));if(r.length>0)return i.crispPolyLine(r,b||1)};L.prototype.getPlotBandPath=function(a,b){var c=this.getPlotLinePath(b),d=this.getPlotLinePath(a),
|
||||
e=[],f;if(d&&c)for(f=0;f<d.length;f+=6)e.push("M",d[f+1],d[f+2],"L",d[f+4],d[f+5],c[f+4],c[f+5],c[f+1],c[f+2]);else e=null;return e};ka.prototype.crispPolyLine=function(a,b){var c;for(c=0;c<a.length;c+=6)a[c+1]===a[c+4]&&(a[c+1]=a[c+4]=s(a[c+1])-b%2/2),a[c+2]===a[c+5]&&(a[c+2]=a[c+5]=s(a[c+2])+b%2/2);return a};if(Wa===P.VMLRenderer)fb.prototype.crispPolyLine=ka.prototype.crispPolyLine;O(L.prototype,"hideCrosshair",function(a,b){a.call(this,b);t(this.crossLabelArray)&&(t(b)?this.crossLabelArray[b]&&
|
||||
this.crossLabelArray[b].hide():q(this.crossLabelArray,function(a){a.hide()}))});O(L.prototype,"drawCrosshair",function(a,b,c){var d,e;a.call(this,b,c);if(t(this.crosshair.label)&&this.crosshair.label.enabled&&t(c)){var a=this.chart,f=this.options.crosshair.label,g=this.isXAxis?"x":"y",b=this.horiz,h=this.opposite,i=this.left,k=this.top,j=this.crossLabel,l,m,n=f.format,p="";if(!j)j=this.crossLabel=a.renderer.label().attr({align:f.align||(b?"center":h?this.labelAlign==="right"?"right":"left":this.labelAlign===
|
||||
"left"?"left":"center"),zIndex:12,height:b?16:r,fill:f.backgroundColor||this.series[0]&&this.series[0].color||"gray",padding:o(f.padding,2),stroke:f.borderColor||null,"stroke-width":f.borderWidth||0}).css(v({color:"white",fontWeight:"normal",fontSize:"11px",textAlign:"center"},f.style)).add();b?(l=c.plotX+i,m=k+(h?0:this.height)):(l=h?this.width+i:0,m=c.plotY+k);if(m<k||m>k+this.height)this.hideCrosshair();else{!n&&!f.formatter&&(this.isDatetimeAxis&&(p="%b %d, %Y"),n="{value"+(p?":"+p:"")+"}");j.attr({text:n?
|
||||
Ja(n,{value:c[g]}):f.formatter.call(this,c[g]),x:l,y:m,visibility:"visible"});c=j.getBBox();if(b){if(this.options.tickPosition==="inside"&&!h||this.options.tickPosition!=="inside"&&h)m=j.y-c.height}else m=j.y-c.height/2;b?(d=i-c.x,e=i+this.width-c.x):(d=this.labelAlign==="left"?i:0,e=this.labelAlign==="right"?i+this.width:a.chartWidth);j.translateX<d&&(l+=d-j.translateX);j.translateX+c.width>=e&&(l-=j.translateX+c.width-e);j.attr({x:l,y:m,visibility:"visible"})}}});var mc=ba.init,nc=ba.processData,
|
||||
oc=za.prototype.tooltipFormatter;ba.init=function(){mc.apply(this,arguments);this.setCompare(this.options.compare)};ba.setCompare=function(a){this.modifyValue=a==="value"||a==="percent"?function(b,c){var d=this.compareValue;if(b!==r&&(b=a==="value"?b-d:b=100*(b/d)-100,c))c.change=b;return b}:null;if(this.chart.hasRendered)this.isDirty=!0};ba.processData=function(){var a=0,b,c,d;nc.apply(this,arguments);if(this.xAxis&&this.processedYData){b=this.processedXData;c=this.processedYData;for(d=c.length;a<
|
||||
d;a++)if(typeof c[a]==="number"&&b[a]>=this.xAxis.min){this.compareValue=c[a];break}}};O(ba,"getExtremes",function(a){a.call(this);if(this.modifyValue)this.dataMax=this.modifyValue(this.dataMax),this.dataMin=this.modifyValue(this.dataMin)});L.prototype.setCompare=function(a,b){this.isXAxis||(q(this.series,function(b){b.setCompare(a)}),o(b,!0)&&this.chart.redraw())};za.prototype.tooltipFormatter=function(a){a=a.replace("{point.change}",(this.change>0?"+":"")+Ia(this.change,o(this.series.tooltipOptions.changeDecimals,
|
||||
2)));return oc.apply(this,[a])};O(K.prototype,"render",function(a){if(this.isCartesian&&this.chart.options._stock)this.clipBox?this.chart[this.sharedClipKey]&&this.chart[this.sharedClipKey].attr({width:this.xAxis.len,height:this.yAxis.len}):(this.clipBox=y(this.chart.clipBox),this.clipBox.width=this.xAxis.len,this.clipBox.height=this.yAxis.len);a.call(this)});v(P,{Axis:L,Chart:va,Color:Fa,Point:za,Tick:Za,Renderer:Wa,Series:K,SVGElement:Z,SVGRenderer:ka,arrayMin:Ra,arrayMax:Ba,charts:aa,dateFormat:ua,
|
||||
format:Ja,pathAnim:Bb,getOptions:function(){return F},hasBidiBug:Yb,isTouchDevice:cb,numberFormat:Ia,seriesTypes:C,setOptions:function(a){F=y(!0,F,a);Mb();return F},addEvent:A,removeEvent:R,createElement:$,discardElement:Sa,css:E,each:q,extend:v,map:xa,merge:y,pick:o,splat:ma,extendClass:ga,pInt:I,wrap:O,svg:ca,canvas:ja,vml:!ca&&!ja,product:"Highstock",version:"2.0.1"})})();
|
|
@ -0,0 +1,133 @@
|
|||
/*
|
||||
A class to parse color values
|
||||
@author Stoyan Stefanov <sstoo@gmail.com>
|
||||
@link http://www.phpied.com/rgb-color-parser-in-javascript/
|
||||
Use it if you like it
|
||||
|
||||
canvg.js - Javascript SVG parser and renderer on Canvas
|
||||
MIT Licensed
|
||||
Gabe Lerner (gabelerner@gmail.com)
|
||||
http://code.google.com/p/canvg/
|
||||
|
||||
Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/
|
||||
|
||||
Highstock JS v2.0.1 (2014-04-24)
|
||||
CanVGRenderer Extension module
|
||||
|
||||
(c) 2011-2012 Torstein Honsi, Erik Olsson
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
function RGBColor(m){this.ok=!1;m.charAt(0)=="#"&&(m=m.substr(1,6));var m=m.replace(/ /g,""),m=m.toLowerCase(),a={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",
|
||||
darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",
|
||||
gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",
|
||||
lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",
|
||||
oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",
|
||||
slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},c;for(c in a)m==c&&(m=a[c]);var d=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(b){return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,
|
||||
example:["#00ff00","336699"],process:function(b){return[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(b){return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]}}];for(c=0;c<d.length;c++){var b=d[c].process,k=d[c].re.exec(m);if(k)channels=b(k),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r;this.g=this.g<0||isNaN(this.g)?0:
|
||||
this.g>255?255:this.g;this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b;this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};this.toHex=function(){var b=this.r.toString(16),a=this.g.toString(16),d=this.b.toString(16);b.length==1&&(b="0"+b);a.length==1&&(a="0"+a);d.length==1&&(d="0"+d);return"#"+b+a+d};this.getHelpXML=function(){for(var b=[],k=0;k<d.length;k++)for(var c=d[k].example,j=0;j<c.length;j++)b[b.length]=c[j];for(var h in a)b[b.length]=h;c=document.createElement("ul");
|
||||
c.setAttribute("id","rgbcolor-examples");for(k=0;k<b.length;k++)try{var l=document.createElement("li"),o=new RGBColor(b[k]),n=document.createElement("div");n.style.cssText="margin: 3px; border: 1px solid black; background:"+o.toHex()+"; color:"+o.toHex();n.appendChild(document.createTextNode("test"));var q=document.createTextNode(" "+b[k]+" -> "+o.toRGB()+" -> "+o.toHex());l.appendChild(n);l.appendChild(q);c.appendChild(l)}catch(p){}return c}}
|
||||
if(!window.console)window.console={},window.console.log=function(){},window.console.dir=function(){};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(m){for(var a=0;a<this.length;a++)if(this[a]==m)return a;return-1};
|
||||
(function(){function m(){var a={FRAMERATE:30,MAX_VIRTUAL_PIXELS:3E4};a.init=function(c){a.Definitions={};a.Styles={};a.Animations=[];a.Images=[];a.ctx=c;a.ViewPort=new function(){this.viewPorts=[];this.Clear=function(){this.viewPorts=[]};this.SetCurrent=function(a,b){this.viewPorts.push({width:a,height:b})};this.RemoveCurrent=function(){this.viewPorts.pop()};this.Current=function(){return this.viewPorts[this.viewPorts.length-1]};this.width=function(){return this.Current().width};this.height=function(){return this.Current().height};
|
||||
this.ComputeSize=function(a){return a!=null&&typeof a=="number"?a:a=="x"?this.width():a=="y"?this.height():Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2)}}};a.init();a.ImagesLoaded=function(){for(var c=0;c<a.Images.length;c++)if(!a.Images[c].loaded)return!1;return!0};a.trim=function(a){return a.replace(/^\s+|\s+$/g,"")};a.compressSpaces=function(a){return a.replace(/[\s\r\t\n]+/gm," ")};a.ajax=function(a){var d;return(d=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"))?
|
||||
(d.open("GET",a,!1),d.send(null),d.responseText):null};a.parseXml=function(a){if(window.DOMParser)return(new DOMParser).parseFromString(a,"text/xml");else{var a=a.replace(/<!DOCTYPE svg[^>]*>/,""),d=new ActiveXObject("Microsoft.XMLDOM");d.async="false";d.loadXML(a);return d}};a.Property=function(c,d){this.name=c;this.value=d;this.hasValue=function(){return this.value!=null&&this.value!==""};this.numValue=function(){if(!this.hasValue())return 0;var b=parseFloat(this.value);(this.value+"").match(/%$/)&&
|
||||
(b/=100);return b};this.valueOrDefault=function(b){return this.hasValue()?this.value:b};this.numValueOrDefault=function(b){return this.hasValue()?this.numValue():b};var b=this;this.Color={addOpacity:function(d){var c=b.value;if(d!=null&&d!=""){var f=new RGBColor(b.value);f.ok&&(c="rgba("+f.r+", "+f.g+", "+f.b+", "+d+")")}return new a.Property(b.name,c)}};this.Definition={getDefinition:function(){var d=b.value.replace(/^(url\()?#([^\)]+)\)?$/,"$2");return a.Definitions[d]},isUrl:function(){return b.value.indexOf("url(")==
|
||||
0},getFillStyle:function(b){var d=this.getDefinition();return d!=null&&d.createGradient?d.createGradient(a.ctx,b):d!=null&&d.createPattern?d.createPattern(a.ctx,b):null}};this.Length={DPI:function(){return 96},EM:function(b){var d=12,c=new a.Property("fontSize",a.Font.Parse(a.ctx.font).fontSize);c.hasValue()&&(d=c.Length.toPixels(b));return d},toPixels:function(d){if(!b.hasValue())return 0;var c=b.value+"";return c.match(/em$/)?b.numValue()*this.EM(d):c.match(/ex$/)?b.numValue()*this.EM(d)/2:c.match(/px$/)?
|
||||
b.numValue():c.match(/pt$/)?b.numValue()*1.25:c.match(/pc$/)?b.numValue()*15:c.match(/cm$/)?b.numValue()*this.DPI(d)/2.54:c.match(/mm$/)?b.numValue()*this.DPI(d)/25.4:c.match(/in$/)?b.numValue()*this.DPI(d):c.match(/%$/)?b.numValue()*a.ViewPort.ComputeSize(d):b.numValue()}};this.Time={toMilliseconds:function(){if(!b.hasValue())return 0;var a=b.value+"";if(a.match(/s$/))return b.numValue()*1E3;a.match(/ms$/);return b.numValue()}};this.Angle={toRadians:function(){if(!b.hasValue())return 0;var a=b.value+
|
||||
"";return a.match(/deg$/)?b.numValue()*(Math.PI/180):a.match(/grad$/)?b.numValue()*(Math.PI/200):a.match(/rad$/)?b.numValue():b.numValue()*(Math.PI/180)}}};a.Font=new function(){this.Styles=["normal","italic","oblique","inherit"];this.Variants=["normal","small-caps","inherit"];this.Weights="normal,bold,bolder,lighter,100,200,300,400,500,600,700,800,900,inherit".split(",");this.CreateFont=function(d,b,c,e,f,g){g=g!=null?this.Parse(g):this.CreateFont("","","","","",a.ctx.font);return{fontFamily:f||
|
||||
g.fontFamily,fontSize:e||g.fontSize,fontStyle:d||g.fontStyle,fontWeight:c||g.fontWeight,fontVariant:b||g.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var c=this;this.Parse=function(d){for(var b={},d=a.trim(a.compressSpaces(d||"")).split(" "),k=!1,e=!1,f=!1,g=!1,j="",h=0;h<d.length;h++)if(!e&&c.Styles.indexOf(d[h])!=-1){if(d[h]!="inherit")b.fontStyle=d[h];e=!0}else if(!g&&c.Variants.indexOf(d[h])!=-1){if(d[h]!="inherit")b.fontVariant=
|
||||
d[h];e=g=!0}else if(!f&&c.Weights.indexOf(d[h])!=-1){if(d[h]!="inherit")b.fontWeight=d[h];e=g=f=!0}else if(k)d[h]!="inherit"&&(j+=d[h]);else{if(d[h]!="inherit")b.fontSize=d[h].split("/")[0];e=g=f=k=!0}if(j!="")b.fontFamily=j;return b}};a.ToNumberArray=function(c){for(var c=a.trim(a.compressSpaces((c||"").replace(/,/g," "))).split(" "),d=0;d<c.length;d++)c[d]=parseFloat(c[d]);return c};a.Point=function(a,d){this.x=a;this.y=d;this.angleTo=function(b){return Math.atan2(b.y-this.y,b.x-this.x)};this.applyTransform=
|
||||
function(b){var a=this.x*b[1]+this.y*b[3]+b[5];this.x=this.x*b[0]+this.y*b[2]+b[4];this.y=a}};a.CreatePoint=function(c){c=a.ToNumberArray(c);return new a.Point(c[0],c[1])};a.CreatePath=function(c){for(var c=a.ToNumberArray(c),d=[],b=0;b<c.length;b+=2)d.push(new a.Point(c[b],c[b+1]));return d};a.BoundingBox=function(a,d,b,k){this.y2=this.x2=this.y1=this.x1=Number.NaN;this.x=function(){return this.x1};this.y=function(){return this.y1};this.width=function(){return this.x2-this.x1};this.height=function(){return this.y2-
|
||||
this.y1};this.addPoint=function(b,a){if(b!=null){if(isNaN(this.x1)||isNaN(this.x2))this.x2=this.x1=b;if(b<this.x1)this.x1=b;if(b>this.x2)this.x2=b}if(a!=null){if(isNaN(this.y1)||isNaN(this.y2))this.y2=this.y1=a;if(a<this.y1)this.y1=a;if(a>this.y2)this.y2=a}};this.addX=function(b){this.addPoint(b,null)};this.addY=function(b){this.addPoint(null,b)};this.addBoundingBox=function(b){this.addPoint(b.x1,b.y1);this.addPoint(b.x2,b.y2)};this.addQuadraticCurve=function(b,a,d,c,k,l){d=b+2/3*(d-b);c=a+2/3*(c-
|
||||
a);this.addBezierCurve(b,a,d,d+1/3*(k-b),c,c+1/3*(l-a),k,l)};this.addBezierCurve=function(b,a,d,c,k,l,o,n){var q=[b,a],p=[d,c],t=[k,l],m=[o,n];this.addPoint(q[0],q[1]);this.addPoint(m[0],m[1]);for(i=0;i<=1;i++)b=function(b){return Math.pow(1-b,3)*q[i]+3*Math.pow(1-b,2)*b*p[i]+3*(1-b)*Math.pow(b,2)*t[i]+Math.pow(b,3)*m[i]},a=6*q[i]-12*p[i]+6*t[i],d=-3*q[i]+9*p[i]-9*t[i]+3*m[i],c=3*p[i]-3*q[i],d==0?a!=0&&(a=-c/a,0<a&&a<1&&(i==0&&this.addX(b(a)),i==1&&this.addY(b(a)))):(c=Math.pow(a,2)-4*c*d,c<0||(k=
|
||||
(-a+Math.sqrt(c))/(2*d),0<k&&k<1&&(i==0&&this.addX(b(k)),i==1&&this.addY(b(k))),a=(-a-Math.sqrt(c))/(2*d),0<a&&a<1&&(i==0&&this.addX(b(a)),i==1&&this.addY(b(a)))))};this.isPointInBox=function(b,a){return this.x1<=b&&b<=this.x2&&this.y1<=a&&a<=this.y2};this.addPoint(a,d);this.addPoint(b,k)};a.Transform=function(c){var d=this;this.Type={};this.Type.translate=function(b){this.p=a.CreatePoint(b);this.apply=function(b){b.translate(this.p.x||0,this.p.y||0)};this.applyToPoint=function(b){b.applyTransform([1,
|
||||
0,0,1,this.p.x||0,this.p.y||0])}};this.Type.rotate=function(b){b=a.ToNumberArray(b);this.angle=new a.Property("angle",b[0]);this.cx=b[1]||0;this.cy=b[2]||0;this.apply=function(b){b.translate(this.cx,this.cy);b.rotate(this.angle.Angle.toRadians());b.translate(-this.cx,-this.cy)};this.applyToPoint=function(b){var a=this.angle.Angle.toRadians();b.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]);b.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]);b.applyTransform([1,0,0,1,-this.p.x||
|
||||
0,-this.p.y||0])}};this.Type.scale=function(b){this.p=a.CreatePoint(b);this.apply=function(b){b.scale(this.p.x||1,this.p.y||this.p.x||1)};this.applyToPoint=function(b){b.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}};this.Type.matrix=function(b){this.m=a.ToNumberArray(b);this.apply=function(b){b.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])};this.applyToPoint=function(b){b.applyTransform(this.m)}};this.Type.SkewBase=function(b){this.base=d.Type.matrix;this.base(b);this.angle=
|
||||
new a.Property("angle",b)};this.Type.SkewBase.prototype=new this.Type.matrix;this.Type.skewX=function(b){this.base=d.Type.SkewBase;this.base(b);this.m=[1,0,Math.tan(this.angle.Angle.toRadians()),1,0,0]};this.Type.skewX.prototype=new this.Type.SkewBase;this.Type.skewY=function(b){this.base=d.Type.SkewBase;this.base(b);this.m=[1,Math.tan(this.angle.Angle.toRadians()),0,1,0,0]};this.Type.skewY.prototype=new this.Type.SkewBase;this.transforms=[];this.apply=function(b){for(var a=0;a<this.transforms.length;a++)this.transforms[a].apply(b)};
|
||||
this.applyToPoint=function(b){for(var a=0;a<this.transforms.length;a++)this.transforms[a].applyToPoint(b)};for(var c=a.trim(a.compressSpaces(c)).split(/\s(?=[a-z])/),b=0;b<c.length;b++){var k=c[b].split("(")[0],e=c[b].split("(")[1].replace(")","");this.transforms.push(new this.Type[k](e))}};a.AspectRatio=function(c,d,b,k,e,f,g,j,h,l){var d=a.compressSpaces(d),d=d.replace(/^defer\s/,""),o=d.split(" ")[0]||"xMidYMid",d=d.split(" ")[1]||"meet",n=b/k,q=e/f,p=Math.min(n,q),m=Math.max(n,q);d=="meet"&&(k*=
|
||||
p,f*=p);d=="slice"&&(k*=m,f*=m);h=new a.Property("refX",h);l=new a.Property("refY",l);h.hasValue()&&l.hasValue()?c.translate(-p*h.Length.toPixels("x"),-p*l.Length.toPixels("y")):(o.match(/^xMid/)&&(d=="meet"&&p==q||d=="slice"&&m==q)&&c.translate(b/2-k/2,0),o.match(/YMid$/)&&(d=="meet"&&p==n||d=="slice"&&m==n)&&c.translate(0,e/2-f/2),o.match(/^xMax/)&&(d=="meet"&&p==q||d=="slice"&&m==q)&&c.translate(b-k,0),o.match(/YMax$/)&&(d=="meet"&&p==n||d=="slice"&&m==n)&&c.translate(0,e-f));o=="none"?c.scale(n,
|
||||
q):d=="meet"?c.scale(p,p):d=="slice"&&c.scale(m,m);c.translate(g==null?0:-g,j==null?0:-j)};a.Element={};a.Element.ElementBase=function(c){this.attributes={};this.styles={};this.children=[];this.attribute=function(b,d){var c=this.attributes[b];if(c!=null)return c;c=new a.Property(b,"");d==!0&&(this.attributes[b]=c);return c};this.style=function(b,d){var c=this.styles[b];if(c!=null)return c;c=this.attribute(b);if(c!=null&&c.hasValue())return c;c=this.parent;if(c!=null&&(c=c.style(b),c!=null&&c.hasValue()))return c;
|
||||
c=new a.Property(b,"");d==!0&&(this.styles[b]=c);return c};this.render=function(b){if(this.style("display").value!="none"&&this.attribute("visibility").value!="hidden"){b.save();this.setContext(b);if(this.attribute("mask").hasValue()){var a=this.attribute("mask").Definition.getDefinition();a!=null&&a.apply(b,this)}else this.style("filter").hasValue()?(a=this.style("filter").Definition.getDefinition(),a!=null&&a.apply(b,this)):this.renderChildren(b);this.clearContext(b);b.restore()}};this.setContext=
|
||||
function(){};this.clearContext=function(){};this.renderChildren=function(b){for(var a=0;a<this.children.length;a++)this.children[a].render(b)};this.addChild=function(b,d){var c=b;d&&(c=a.CreateElement(b));c.parent=this;this.children.push(c)};if(c!=null&&c.nodeType==1){for(var d=0;d<c.childNodes.length;d++){var b=c.childNodes[d];b.nodeType==1&&this.addChild(b,!0)}for(d=0;d<c.attributes.length;d++)b=c.attributes[d],this.attributes[b.nodeName]=new a.Property(b.nodeName,b.nodeValue);b=a.Styles[c.nodeName];
|
||||
if(b!=null)for(var k in b)this.styles[k]=b[k];if(this.attribute("class").hasValue())for(var d=a.compressSpaces(this.attribute("class").value).split(" "),e=0;e<d.length;e++){b=a.Styles["."+d[e]];if(b!=null)for(k in b)this.styles[k]=b[k];b=a.Styles[c.nodeName+"."+d[e]];if(b!=null)for(k in b)this.styles[k]=b[k]}if(this.attribute("style").hasValue()){b=this.attribute("style").value.split(";");for(d=0;d<b.length;d++)a.trim(b[d])!=""&&(c=b[d].split(":"),k=a.trim(c[0]),c=a.trim(c[1]),this.styles[k]=new a.Property(k,
|
||||
c))}this.attribute("id").hasValue()&&a.Definitions[this.attribute("id").value]==null&&(a.Definitions[this.attribute("id").value]=this)}};a.Element.RenderedElementBase=function(c){this.base=a.Element.ElementBase;this.base(c);this.setContext=function(d){if(this.style("fill").Definition.isUrl()){var b=this.style("fill").Definition.getFillStyle(this);if(b!=null)d.fillStyle=b}else if(this.style("fill").hasValue())b=this.style("fill"),this.style("fill-opacity").hasValue()&&(b=b.Color.addOpacity(this.style("fill-opacity").value)),
|
||||
d.fillStyle=b.value=="none"?"rgba(0,0,0,0)":b.value;if(this.style("stroke").Definition.isUrl()){if(b=this.style("stroke").Definition.getFillStyle(this),b!=null)d.strokeStyle=b}else if(this.style("stroke").hasValue())b=this.style("stroke"),this.style("stroke-opacity").hasValue()&&(b=b.Color.addOpacity(this.style("stroke-opacity").value)),d.strokeStyle=b.value=="none"?"rgba(0,0,0,0)":b.value;if(this.style("stroke-width").hasValue())d.lineWidth=this.style("stroke-width").Length.toPixels();if(this.style("stroke-linecap").hasValue())d.lineCap=
|
||||
this.style("stroke-linecap").value;if(this.style("stroke-linejoin").hasValue())d.lineJoin=this.style("stroke-linejoin").value;if(this.style("stroke-miterlimit").hasValue())d.miterLimit=this.style("stroke-miterlimit").value;if(typeof d.font!="undefined")d.font=a.Font.CreateFont(this.style("font-style").value,this.style("font-variant").value,this.style("font-weight").value,this.style("font-size").hasValue()?this.style("font-size").Length.toPixels()+"px":"",this.style("font-family").value).toString();
|
||||
this.attribute("transform").hasValue()&&(new a.Transform(this.attribute("transform").value)).apply(d);this.attribute("clip-path").hasValue()&&(b=this.attribute("clip-path").Definition.getDefinition(),b!=null&&b.apply(d));if(this.style("opacity").hasValue())d.globalAlpha=this.style("opacity").numValue()}};a.Element.RenderedElementBase.prototype=new a.Element.ElementBase;a.Element.PathElementBase=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.path=function(d){d!=null&&d.beginPath();
|
||||
return new a.BoundingBox};this.renderChildren=function(d){this.path(d);a.Mouse.checkPath(this,d);d.fillStyle!=""&&d.fill();d.strokeStyle!=""&&d.stroke();var b=this.getMarkers();if(b!=null){if(this.style("marker-start").Definition.isUrl()){var c=this.style("marker-start").Definition.getDefinition();c.render(d,b[0][0],b[0][1])}if(this.style("marker-mid").Definition.isUrl())for(var c=this.style("marker-mid").Definition.getDefinition(),e=1;e<b.length-1;e++)c.render(d,b[e][0],b[e][1]);this.style("marker-end").Definition.isUrl()&&
|
||||
(c=this.style("marker-end").Definition.getDefinition(),c.render(d,b[b.length-1][0],b[b.length-1][1]))}};this.getBoundingBox=function(){return this.path()};this.getMarkers=function(){return null}};a.Element.PathElementBase.prototype=new a.Element.RenderedElementBase;a.Element.svg=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.baseClearContext=this.clearContext;this.clearContext=function(d){this.baseClearContext(d);a.ViewPort.RemoveCurrent()};this.baseSetContext=this.setContext;
|
||||
this.setContext=function(d){d.strokeStyle="rgba(0,0,0,0)";d.lineCap="butt";d.lineJoin="miter";d.miterLimit=4;this.baseSetContext(d);this.attribute("x").hasValue()&&this.attribute("y").hasValue()&&d.translate(this.attribute("x").Length.toPixels("x"),this.attribute("y").Length.toPixels("y"));var b=a.ViewPort.width(),c=a.ViewPort.height();if(typeof this.root=="undefined"&&this.attribute("width").hasValue()&&this.attribute("height").hasValue()){var b=this.attribute("width").Length.toPixels("x"),c=this.attribute("height").Length.toPixels("y"),
|
||||
e=0,f=0;this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()&&(e=-this.attribute("refX").Length.toPixels("x"),f=-this.attribute("refY").Length.toPixels("y"));d.beginPath();d.moveTo(e,f);d.lineTo(b,f);d.lineTo(b,c);d.lineTo(e,c);d.closePath();d.clip()}a.ViewPort.SetCurrent(b,c);if(this.attribute("viewBox").hasValue()){var e=a.ToNumberArray(this.attribute("viewBox").value),f=e[0],g=e[1],b=e[2],c=e[3];a.AspectRatio(d,this.attribute("preserveAspectRatio").value,a.ViewPort.width(),b,a.ViewPort.height(),
|
||||
c,f,g,this.attribute("refX").value,this.attribute("refY").value);a.ViewPort.RemoveCurrent();a.ViewPort.SetCurrent(e[2],e[3])}}};a.Element.svg.prototype=new a.Element.RenderedElementBase;a.Element.rect=function(c){this.base=a.Element.PathElementBase;this.base(c);this.path=function(d){var b=this.attribute("x").Length.toPixels("x"),c=this.attribute("y").Length.toPixels("y"),e=this.attribute("width").Length.toPixels("x"),f=this.attribute("height").Length.toPixels("y"),g=this.attribute("rx").Length.toPixels("x"),
|
||||
j=this.attribute("ry").Length.toPixels("y");this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()&&(j=g);this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()&&(g=j);d!=null&&(d.beginPath(),d.moveTo(b+g,c),d.lineTo(b+e-g,c),d.quadraticCurveTo(b+e,c,b+e,c+j),d.lineTo(b+e,c+f-j),d.quadraticCurveTo(b+e,c+f,b+e-g,c+f),d.lineTo(b+g,c+f),d.quadraticCurveTo(b,c+f,b,c+f-j),d.lineTo(b,c+j),d.quadraticCurveTo(b,c,b+g,c),d.closePath());return new a.BoundingBox(b,c,b+e,c+f)}};a.Element.rect.prototype=
|
||||
new a.Element.PathElementBase;a.Element.circle=function(c){this.base=a.Element.PathElementBase;this.base(c);this.path=function(d){var b=this.attribute("cx").Length.toPixels("x"),c=this.attribute("cy").Length.toPixels("y"),e=this.attribute("r").Length.toPixels();d!=null&&(d.beginPath(),d.arc(b,c,e,0,Math.PI*2,!0),d.closePath());return new a.BoundingBox(b-e,c-e,b+e,c+e)}};a.Element.circle.prototype=new a.Element.PathElementBase;a.Element.ellipse=function(c){this.base=a.Element.PathElementBase;this.base(c);
|
||||
this.path=function(d){var b=4*((Math.sqrt(2)-1)/3),c=this.attribute("rx").Length.toPixels("x"),e=this.attribute("ry").Length.toPixels("y"),f=this.attribute("cx").Length.toPixels("x"),g=this.attribute("cy").Length.toPixels("y");d!=null&&(d.beginPath(),d.moveTo(f,g-e),d.bezierCurveTo(f+b*c,g-e,f+c,g-b*e,f+c,g),d.bezierCurveTo(f+c,g+b*e,f+b*c,g+e,f,g+e),d.bezierCurveTo(f-b*c,g+e,f-c,g+b*e,f-c,g),d.bezierCurveTo(f-c,g-b*e,f-b*c,g-e,f,g-e),d.closePath());return new a.BoundingBox(f-c,g-e,f+c,g+e)}};a.Element.ellipse.prototype=
|
||||
new a.Element.PathElementBase;a.Element.line=function(c){this.base=a.Element.PathElementBase;this.base(c);this.getPoints=function(){return[new a.Point(this.attribute("x1").Length.toPixels("x"),this.attribute("y1").Length.toPixels("y")),new a.Point(this.attribute("x2").Length.toPixels("x"),this.attribute("y2").Length.toPixels("y"))]};this.path=function(d){var b=this.getPoints();d!=null&&(d.beginPath(),d.moveTo(b[0].x,b[0].y),d.lineTo(b[1].x,b[1].y));return new a.BoundingBox(b[0].x,b[0].y,b[1].x,b[1].y)};
|
||||
this.getMarkers=function(){var a=this.getPoints(),b=a[0].angleTo(a[1]);return[[a[0],b],[a[1],b]]}};a.Element.line.prototype=new a.Element.PathElementBase;a.Element.polyline=function(c){this.base=a.Element.PathElementBase;this.base(c);this.points=a.CreatePath(this.attribute("points").value);this.path=function(d){var b=new a.BoundingBox(this.points[0].x,this.points[0].y);d!=null&&(d.beginPath(),d.moveTo(this.points[0].x,this.points[0].y));for(var c=1;c<this.points.length;c++)b.addPoint(this.points[c].x,
|
||||
this.points[c].y),d!=null&&d.lineTo(this.points[c].x,this.points[c].y);return b};this.getMarkers=function(){for(var a=[],b=0;b<this.points.length-1;b++)a.push([this.points[b],this.points[b].angleTo(this.points[b+1])]);a.push([this.points[this.points.length-1],a[a.length-1][1]]);return a}};a.Element.polyline.prototype=new a.Element.PathElementBase;a.Element.polygon=function(c){this.base=a.Element.polyline;this.base(c);this.basePath=this.path;this.path=function(a){var b=this.basePath(a);a!=null&&(a.lineTo(this.points[0].x,
|
||||
this.points[0].y),a.closePath());return b}};a.Element.polygon.prototype=new a.Element.polyline;a.Element.path=function(c){this.base=a.Element.PathElementBase;this.base(c);c=this.attribute("d").value;c=c.replace(/,/gm," ");c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2");c=c.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([0-9])([+\-])/gm,
|
||||
"$1 $2");c=c.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");c=c.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");c=a.compressSpaces(c);c=a.trim(c);this.PathParser=new function(d){this.tokens=d.split(" ");this.reset=function(){this.i=-1;this.previousCommand=this.command="";this.start=new a.Point(0,0);this.control=new a.Point(0,0);this.current=new a.Point(0,0);this.points=[];this.angles=[]};this.isEnd=function(){return this.i>=this.tokens.length-1};this.isCommandOrEnd=function(){return this.isEnd()?
|
||||
!0:this.tokens[this.i+1].match(/^[A-Za-z]$/)!=null};this.isRelativeCommand=function(){return this.command==this.command.toLowerCase()};this.getToken=function(){this.i+=1;return this.tokens[this.i]};this.getScalar=function(){return parseFloat(this.getToken())};this.nextCommand=function(){this.previousCommand=this.command;this.command=this.getToken()};this.getPoint=function(){return this.makeAbsolute(new a.Point(this.getScalar(),this.getScalar()))};this.getAsControlPoint=function(){var b=this.getPoint();
|
||||
return this.control=b};this.getAsCurrentPoint=function(){var b=this.getPoint();return this.current=b};this.getReflectedControlPoint=function(){return this.previousCommand.toLowerCase()!="c"&&this.previousCommand.toLowerCase()!="s"?this.current:new a.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y)};this.makeAbsolute=function(b){if(this.isRelativeCommand())b.x=this.current.x+b.x,b.y=this.current.y+b.y;return b};this.addMarker=function(b,a,d){d!=null&&this.angles.length>0&&this.angles[this.angles.length-
|
||||
1]==null&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(d));this.addMarkerAngle(b,a==null?null:a.angleTo(b))};this.addMarkerAngle=function(b,a){this.points.push(b);this.angles.push(a)};this.getMarkerPoints=function(){return this.points};this.getMarkerAngles=function(){for(var b=0;b<this.angles.length;b++)if(this.angles[b]==null)for(var a=b+1;a<this.angles.length;a++)if(this.angles[a]!=null){this.angles[b]=this.angles[a];break}return this.angles}}(c);this.path=function(d){var b=
|
||||
this.PathParser;b.reset();var c=new a.BoundingBox;for(d!=null&&d.beginPath();!b.isEnd();)switch(b.nextCommand(),b.command.toUpperCase()){case "M":var e=b.getAsCurrentPoint();b.addMarker(e);c.addPoint(e.x,e.y);d!=null&&d.moveTo(e.x,e.y);for(b.start=b.current;!b.isCommandOrEnd();)e=b.getAsCurrentPoint(),b.addMarker(e,b.start),c.addPoint(e.x,e.y),d!=null&&d.lineTo(e.x,e.y);break;case "L":for(;!b.isCommandOrEnd();){var f=b.current,e=b.getAsCurrentPoint();b.addMarker(e,f);c.addPoint(e.x,e.y);d!=null&&
|
||||
d.lineTo(e.x,e.y)}break;case "H":for(;!b.isCommandOrEnd();)e=new a.Point((b.isRelativeCommand()?b.current.x:0)+b.getScalar(),b.current.y),b.addMarker(e,b.current),b.current=e,c.addPoint(b.current.x,b.current.y),d!=null&&d.lineTo(b.current.x,b.current.y);break;case "V":for(;!b.isCommandOrEnd();)e=new a.Point(b.current.x,(b.isRelativeCommand()?b.current.y:0)+b.getScalar()),b.addMarker(e,b.current),b.current=e,c.addPoint(b.current.x,b.current.y),d!=null&&d.lineTo(b.current.x,b.current.y);break;case "C":for(;!b.isCommandOrEnd();){var g=
|
||||
b.current,f=b.getPoint(),j=b.getAsControlPoint(),e=b.getAsCurrentPoint();b.addMarker(e,j,f);c.addBezierCurve(g.x,g.y,f.x,f.y,j.x,j.y,e.x,e.y);d!=null&&d.bezierCurveTo(f.x,f.y,j.x,j.y,e.x,e.y)}break;case "S":for(;!b.isCommandOrEnd();)g=b.current,f=b.getReflectedControlPoint(),j=b.getAsControlPoint(),e=b.getAsCurrentPoint(),b.addMarker(e,j,f),c.addBezierCurve(g.x,g.y,f.x,f.y,j.x,j.y,e.x,e.y),d!=null&&d.bezierCurveTo(f.x,f.y,j.x,j.y,e.x,e.y);break;case "Q":for(;!b.isCommandOrEnd();)g=b.current,j=b.getAsControlPoint(),
|
||||
e=b.getAsCurrentPoint(),b.addMarker(e,j,j),c.addQuadraticCurve(g.x,g.y,j.x,j.y,e.x,e.y),d!=null&&d.quadraticCurveTo(j.x,j.y,e.x,e.y);break;case "T":for(;!b.isCommandOrEnd();)g=b.current,j=b.getReflectedControlPoint(),b.control=j,e=b.getAsCurrentPoint(),b.addMarker(e,j,j),c.addQuadraticCurve(g.x,g.y,j.x,j.y,e.x,e.y),d!=null&&d.quadraticCurveTo(j.x,j.y,e.x,e.y);break;case "A":for(;!b.isCommandOrEnd();){var g=b.current,h=b.getScalar(),l=b.getScalar(),f=b.getScalar()*(Math.PI/180),o=b.getScalar(),j=b.getScalar(),
|
||||
e=b.getAsCurrentPoint(),n=new a.Point(Math.cos(f)*(g.x-e.x)/2+Math.sin(f)*(g.y-e.y)/2,-Math.sin(f)*(g.x-e.x)/2+Math.cos(f)*(g.y-e.y)/2),q=Math.pow(n.x,2)/Math.pow(h,2)+Math.pow(n.y,2)/Math.pow(l,2);q>1&&(h*=Math.sqrt(q),l*=Math.sqrt(q));o=(o==j?-1:1)*Math.sqrt((Math.pow(h,2)*Math.pow(l,2)-Math.pow(h,2)*Math.pow(n.y,2)-Math.pow(l,2)*Math.pow(n.x,2))/(Math.pow(h,2)*Math.pow(n.y,2)+Math.pow(l,2)*Math.pow(n.x,2)));isNaN(o)&&(o=0);var p=new a.Point(o*h*n.y/l,o*-l*n.x/h),g=new a.Point((g.x+e.x)/2+Math.cos(f)*
|
||||
p.x-Math.sin(f)*p.y,(g.y+e.y)/2+Math.sin(f)*p.x+Math.cos(f)*p.y),m=function(b,a){return(b[0]*a[0]+b[1]*a[1])/(Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2))*Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)))},s=function(b,a){return(b[0]*a[1]<b[1]*a[0]?-1:1)*Math.acos(m(b,a))},o=s([1,0],[(n.x-p.x)/h,(n.y-p.y)/l]),q=[(n.x-p.x)/h,(n.y-p.y)/l],p=[(-n.x-p.x)/h,(-n.y-p.y)/l],n=s(q,p);if(m(q,p)<=-1)n=Math.PI;m(q,p)>=1&&(n=0);j==0&&n>0&&(n-=2*Math.PI);j==1&&n<0&&(n+=2*Math.PI);q=new a.Point(g.x-h*Math.cos((o+n)/
|
||||
2),g.y-l*Math.sin((o+n)/2));b.addMarkerAngle(q,(o+n)/2+(j==0?1:-1)*Math.PI/2);b.addMarkerAngle(e,n+(j==0?1:-1)*Math.PI/2);c.addPoint(e.x,e.y);d!=null&&(m=h>l?h:l,e=h>l?1:h/l,h=h>l?l/h:1,d.translate(g.x,g.y),d.rotate(f),d.scale(e,h),d.arc(0,0,m,o,o+n,1-j),d.scale(1/e,1/h),d.rotate(-f),d.translate(-g.x,-g.y))}break;case "Z":d!=null&&d.closePath(),b.current=b.start}return c};this.getMarkers=function(){for(var a=this.PathParser.getMarkerPoints(),b=this.PathParser.getMarkerAngles(),c=[],e=0;e<a.length;e++)c.push([a[e],
|
||||
b[e]]);return c}};a.Element.path.prototype=new a.Element.PathElementBase;a.Element.pattern=function(c){this.base=a.Element.ElementBase;this.base(c);this.createPattern=function(d){var b=new a.Element.svg;b.attributes.viewBox=new a.Property("viewBox",this.attribute("viewBox").value);b.attributes.x=new a.Property("x",this.attribute("x").value);b.attributes.y=new a.Property("y",this.attribute("y").value);b.attributes.width=new a.Property("width",this.attribute("width").value);b.attributes.height=new a.Property("height",
|
||||
this.attribute("height").value);b.children=this.children;var c=document.createElement("canvas");c.width=this.attribute("width").Length.toPixels("x");c.height=this.attribute("height").Length.toPixels("y");b.render(c.getContext("2d"));return d.createPattern(c,"repeat")}};a.Element.pattern.prototype=new a.Element.ElementBase;a.Element.marker=function(c){this.base=a.Element.ElementBase;this.base(c);this.baseRender=this.render;this.render=function(d,b,c){d.translate(b.x,b.y);this.attribute("orient").valueOrDefault("auto")==
|
||||
"auto"&&d.rotate(c);this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"&&d.scale(d.lineWidth,d.lineWidth);d.save();var e=new a.Element.svg;e.attributes.viewBox=new a.Property("viewBox",this.attribute("viewBox").value);e.attributes.refX=new a.Property("refX",this.attribute("refX").value);e.attributes.refY=new a.Property("refY",this.attribute("refY").value);e.attributes.width=new a.Property("width",this.attribute("markerWidth").value);e.attributes.height=new a.Property("height",
|
||||
this.attribute("markerHeight").value);e.attributes.fill=new a.Property("fill",this.attribute("fill").valueOrDefault("black"));e.attributes.stroke=new a.Property("stroke",this.attribute("stroke").valueOrDefault("none"));e.children=this.children;e.render(d);d.restore();this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"&&d.scale(1/d.lineWidth,1/d.lineWidth);this.attribute("orient").valueOrDefault("auto")=="auto"&&d.rotate(-c);d.translate(-b.x,-b.y)}};a.Element.marker.prototype=
|
||||
new a.Element.ElementBase;a.Element.defs=function(c){this.base=a.Element.ElementBase;this.base(c);this.render=function(){}};a.Element.defs.prototype=new a.Element.ElementBase;a.Element.GradientBase=function(c){this.base=a.Element.ElementBase;this.base(c);this.gradientUnits=this.attribute("gradientUnits").valueOrDefault("objectBoundingBox");this.stops=[];for(c=0;c<this.children.length;c++)this.stops.push(this.children[c]);this.getGradient=function(){};this.createGradient=function(d,b){var c=this;this.attribute("xlink:href").hasValue()&&
|
||||
(c=this.attribute("xlink:href").Definition.getDefinition());for(var e=this.getGradient(d,b),f=0;f<c.stops.length;f++)e.addColorStop(c.stops[f].offset,c.stops[f].color);if(this.attribute("gradientTransform").hasValue()){c=a.ViewPort.viewPorts[0];f=new a.Element.rect;f.attributes.x=new a.Property("x",-a.MAX_VIRTUAL_PIXELS/3);f.attributes.y=new a.Property("y",-a.MAX_VIRTUAL_PIXELS/3);f.attributes.width=new a.Property("width",a.MAX_VIRTUAL_PIXELS);f.attributes.height=new a.Property("height",a.MAX_VIRTUAL_PIXELS);
|
||||
var g=new a.Element.g;g.attributes.transform=new a.Property("transform",this.attribute("gradientTransform").value);g.children=[f];f=new a.Element.svg;f.attributes.x=new a.Property("x",0);f.attributes.y=new a.Property("y",0);f.attributes.width=new a.Property("width",c.width);f.attributes.height=new a.Property("height",c.height);f.children=[g];g=document.createElement("canvas");g.width=c.width;g.height=c.height;c=g.getContext("2d");c.fillStyle=e;f.render(c);return c.createPattern(g,"no-repeat")}return e}};
|
||||
a.Element.GradientBase.prototype=new a.Element.ElementBase;a.Element.linearGradient=function(c){this.base=a.Element.GradientBase;this.base(c);this.getGradient=function(a,b){var c=b.getBoundingBox(),e=this.gradientUnits=="objectBoundingBox"?c.x()+c.width()*this.attribute("x1").numValue():this.attribute("x1").Length.toPixels("x"),f=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("y1").numValue():this.attribute("y1").Length.toPixels("y"),g=this.gradientUnits=="objectBoundingBox"?
|
||||
c.x()+c.width()*this.attribute("x2").numValue():this.attribute("x2").Length.toPixels("x"),c=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("y2").numValue():this.attribute("y2").Length.toPixels("y");return a.createLinearGradient(e,f,g,c)}};a.Element.linearGradient.prototype=new a.Element.GradientBase;a.Element.radialGradient=function(c){this.base=a.Element.GradientBase;this.base(c);this.getGradient=function(a,b){var c=b.getBoundingBox(),e=this.gradientUnits=="objectBoundingBox"?
|
||||
c.x()+c.width()*this.attribute("cx").numValue():this.attribute("cx").Length.toPixels("x"),f=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("cy").numValue():this.attribute("cy").Length.toPixels("y"),g=e,j=f;this.attribute("fx").hasValue()&&(g=this.gradientUnits=="objectBoundingBox"?c.x()+c.width()*this.attribute("fx").numValue():this.attribute("fx").Length.toPixels("x"));this.attribute("fy").hasValue()&&(j=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("fy").numValue():
|
||||
this.attribute("fy").Length.toPixels("y"));c=this.gradientUnits=="objectBoundingBox"?(c.width()+c.height())/2*this.attribute("r").numValue():this.attribute("r").Length.toPixels();return a.createRadialGradient(g,j,0,e,f,c)}};a.Element.radialGradient.prototype=new a.Element.GradientBase;a.Element.stop=function(c){this.base=a.Element.ElementBase;this.base(c);this.offset=this.attribute("offset").numValue();c=this.style("stop-color");this.style("stop-opacity").hasValue()&&(c=c.Color.addOpacity(this.style("stop-opacity").value));
|
||||
this.color=c.value};a.Element.stop.prototype=new a.Element.ElementBase;a.Element.AnimateBase=function(c){this.base=a.Element.ElementBase;this.base(c);a.Animations.push(this);this.duration=0;this.begin=this.attribute("begin").Time.toMilliseconds();this.maxDuration=this.begin+this.attribute("dur").Time.toMilliseconds();this.getProperty=function(){var a=this.attribute("attributeType").value,b=this.attribute("attributeName").value;return a=="CSS"?this.parent.style(b,!0):this.parent.attribute(b,!0)};this.initialValue=
|
||||
null;this.removed=!1;this.calcValue=function(){return""};this.update=function(a){if(this.initialValue==null)this.initialValue=this.getProperty().value;if(this.duration>this.maxDuration)if(this.attribute("repeatCount").value=="indefinite")this.duration=0;else return this.attribute("fill").valueOrDefault("remove")=="remove"&&!this.removed?(this.removed=!0,this.getProperty().value=this.initialValue,!0):!1;this.duration+=a;a=!1;if(this.begin<this.duration)a=this.calcValue(),this.attribute("type").hasValue()&&
|
||||
(a=this.attribute("type").value+"("+a+")"),this.getProperty().value=a,a=!0;return a};this.progress=function(){return(this.duration-this.begin)/(this.maxDuration-this.begin)}};a.Element.AnimateBase.prototype=new a.Element.ElementBase;a.Element.animate=function(c){this.base=a.Element.AnimateBase;this.base(c);this.calcValue=function(){var a=this.attribute("from").numValue(),b=this.attribute("to").numValue();return a+(b-a)*this.progress()}};a.Element.animate.prototype=new a.Element.AnimateBase;a.Element.animateColor=
|
||||
function(c){this.base=a.Element.AnimateBase;this.base(c);this.calcValue=function(){var a=new RGBColor(this.attribute("from").value),b=new RGBColor(this.attribute("to").value);if(a.ok&&b.ok){var c=a.r+(b.r-a.r)*this.progress(),e=a.g+(b.g-a.g)*this.progress(),a=a.b+(b.b-a.b)*this.progress();return"rgb("+parseInt(c,10)+","+parseInt(e,10)+","+parseInt(a,10)+")"}return this.attribute("from").value}};a.Element.animateColor.prototype=new a.Element.AnimateBase;a.Element.animateTransform=function(c){this.base=
|
||||
a.Element.animate;this.base(c)};a.Element.animateTransform.prototype=new a.Element.animate;a.Element.font=function(c){this.base=a.Element.ElementBase;this.base(c);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.isArabic=this.isRTL=!1;this.missingGlyph=this.fontFace=null;this.glyphs=[];for(c=0;c<this.children.length;c++){var d=this.children[c];if(d.type=="font-face")this.fontFace=d,d.style("font-family").hasValue()&&(a.Definitions[d.style("font-family").value]=this);else if(d.type=="missing-glyph")this.missingGlyph=
|
||||
d;else if(d.type=="glyph")d.arabicForm!=""?(this.isArabic=this.isRTL=!0,typeof this.glyphs[d.unicode]=="undefined"&&(this.glyphs[d.unicode]=[]),this.glyphs[d.unicode][d.arabicForm]=d):this.glyphs[d.unicode]=d}};a.Element.font.prototype=new a.Element.ElementBase;a.Element.fontface=function(c){this.base=a.Element.ElementBase;this.base(c);this.ascent=this.attribute("ascent").value;this.descent=this.attribute("descent").value;this.unitsPerEm=this.attribute("units-per-em").numValue()};a.Element.fontface.prototype=
|
||||
new a.Element.ElementBase;a.Element.missingglyph=function(c){this.base=a.Element.path;this.base(c);this.horizAdvX=0};a.Element.missingglyph.prototype=new a.Element.path;a.Element.glyph=function(c){this.base=a.Element.path;this.base(c);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.unicode=this.attribute("unicode").value;this.arabicForm=this.attribute("arabic-form").value};a.Element.glyph.prototype=new a.Element.path;a.Element.text=function(c){this.base=a.Element.RenderedElementBase;
|
||||
this.base(c);if(c!=null){this.children=[];for(var d=0;d<c.childNodes.length;d++){var b=c.childNodes[d];b.nodeType==1?this.addChild(b,!0):b.nodeType==3&&this.addChild(new a.Element.tspan(b),!1)}}this.baseSetContext=this.setContext;this.setContext=function(b){this.baseSetContext(b);if(this.style("dominant-baseline").hasValue())b.textBaseline=this.style("dominant-baseline").value;if(this.style("alignment-baseline").hasValue())b.textBaseline=this.style("alignment-baseline").value};this.renderChildren=
|
||||
function(b){for(var a=this.style("text-anchor").valueOrDefault("start"),c=this.attribute("x").Length.toPixels("x"),d=this.attribute("y").Length.toPixels("y"),j=0;j<this.children.length;j++){var h=this.children[j];h.attribute("x").hasValue()?h.x=h.attribute("x").Length.toPixels("x"):(h.attribute("dx").hasValue()&&(c+=h.attribute("dx").Length.toPixels("x")),h.x=c);c=h.measureText(b);if(a!="start"&&(j==0||h.attribute("x").hasValue())){for(var l=c,o=j+1;o<this.children.length;o++){var n=this.children[o];
|
||||
if(n.attribute("x").hasValue())break;l+=n.measureText(b)}h.x-=a=="end"?l:l/2}c=h.x+c;h.attribute("y").hasValue()?h.y=h.attribute("y").Length.toPixels("y"):(h.attribute("dy").hasValue()&&(d+=h.attribute("dy").Length.toPixels("y")),h.y=d);d=h.y;h.render(b)}}};a.Element.text.prototype=new a.Element.RenderedElementBase;a.Element.TextElementBase=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.getGlyph=function(a,b,c){var e=b[c],f=null;if(a.isArabic){var g="isolated";if((c==0||b[c-
|
||||
1]==" ")&&c<b.length-2&&b[c+1]!=" ")g="terminal";c>0&&b[c-1]!=" "&&c<b.length-2&&b[c+1]!=" "&&(g="medial");if(c>0&&b[c-1]!=" "&&(c==b.length-1||b[c+1]==" "))g="initial";typeof a.glyphs[e]!="undefined"&&(f=a.glyphs[e][g],f==null&&a.glyphs[e].type=="glyph"&&(f=a.glyphs[e]))}else f=a.glyphs[e];if(f==null)f=a.missingGlyph;return f};this.renderChildren=function(c){var b=this.parent.style("font-family").Definition.getDefinition();if(b!=null){var k=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize),
|
||||
e=this.parent.style("font-style").valueOrDefault(a.Font.Parse(a.ctx.font).fontStyle),f=this.getText();b.isRTL&&(f=f.split("").reverse().join(""));for(var g=a.ToNumberArray(this.parent.attribute("dx").value),j=0;j<f.length;j++){var h=this.getGlyph(b,f,j),l=k/b.fontFace.unitsPerEm;c.translate(this.x,this.y);c.scale(l,-l);var o=c.lineWidth;c.lineWidth=c.lineWidth*b.fontFace.unitsPerEm/k;e=="italic"&&c.transform(1,0,0.4,1,0,0);h.render(c);e=="italic"&&c.transform(1,0,-0.4,1,0,0);c.lineWidth=o;c.scale(1/
|
||||
l,-1/l);c.translate(-this.x,-this.y);this.x+=k*(h.horizAdvX||b.horizAdvX)/b.fontFace.unitsPerEm;typeof g[j]!="undefined"&&!isNaN(g[j])&&(this.x+=g[j])}}else c.strokeStyle!=""&&c.strokeText(a.compressSpaces(this.getText()),this.x,this.y),c.fillStyle!=""&&c.fillText(a.compressSpaces(this.getText()),this.x,this.y)};this.getText=function(){};this.measureText=function(c){var b=this.parent.style("font-family").Definition.getDefinition();if(b!=null){var c=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize),
|
||||
k=0,e=this.getText();b.isRTL&&(e=e.split("").reverse().join(""));for(var f=a.ToNumberArray(this.parent.attribute("dx").value),g=0;g<e.length;g++){var j=this.getGlyph(b,e,g);k+=(j.horizAdvX||b.horizAdvX)*c/b.fontFace.unitsPerEm;typeof f[g]!="undefined"&&!isNaN(f[g])&&(k+=f[g])}return k}b=a.compressSpaces(this.getText());if(!c.measureText)return b.length*10;c.save();this.setContext(c);b=c.measureText(b).width;c.restore();return b}};a.Element.TextElementBase.prototype=new a.Element.RenderedElementBase;
|
||||
a.Element.tspan=function(c){this.base=a.Element.TextElementBase;this.base(c);this.text=c.nodeType==3?c.nodeValue:c.childNodes.length>0?c.childNodes[0].nodeValue:c.text;this.getText=function(){return this.text}};a.Element.tspan.prototype=new a.Element.TextElementBase;a.Element.tref=function(c){this.base=a.Element.TextElementBase;this.base(c);this.getText=function(){var a=this.attribute("xlink:href").Definition.getDefinition();if(a!=null)return a.children[0].getText()}};a.Element.tref.prototype=new a.Element.TextElementBase;
|
||||
a.Element.a=function(c){this.base=a.Element.TextElementBase;this.base(c);this.hasText=!0;for(var d=0;d<c.childNodes.length;d++)if(c.childNodes[d].nodeType!=3)this.hasText=!1;this.text=this.hasText?c.childNodes[0].nodeValue:"";this.getText=function(){return this.text};this.baseRenderChildren=this.renderChildren;this.renderChildren=function(b){if(this.hasText){this.baseRenderChildren(b);var c=new a.Property("fontSize",a.Font.Parse(a.ctx.font).fontSize);a.Mouse.checkBoundingBox(this,new a.BoundingBox(this.x,
|
||||
this.y-c.Length.toPixels("y"),this.x+this.measureText(b),this.y))}else c=new a.Element.g,c.children=this.children,c.parent=this,c.render(b)};this.onclick=function(){window.open(this.attribute("xlink:href").value)};this.onmousemove=function(){a.ctx.canvas.style.cursor="pointer"}};a.Element.a.prototype=new a.Element.TextElementBase;a.Element.image=function(c){this.base=a.Element.RenderedElementBase;this.base(c);a.Images.push(this);this.img=document.createElement("img");this.loaded=!1;var d=this;this.img.onload=
|
||||
function(){d.loaded=!0};this.img.src=this.attribute("xlink:href").value;this.renderChildren=function(b){var c=this.attribute("x").Length.toPixels("x"),d=this.attribute("y").Length.toPixels("y"),f=this.attribute("width").Length.toPixels("x"),g=this.attribute("height").Length.toPixels("y");f==0||g==0||(b.save(),b.translate(c,d),a.AspectRatio(b,this.attribute("preserveAspectRatio").value,f,this.img.width,g,this.img.height,0,0),b.drawImage(this.img,0,0),b.restore())}};a.Element.image.prototype=new a.Element.RenderedElementBase;
|
||||
a.Element.g=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.getBoundingBox=function(){for(var c=new a.BoundingBox,b=0;b<this.children.length;b++)c.addBoundingBox(this.children[b].getBoundingBox());return c}};a.Element.g.prototype=new a.Element.RenderedElementBase;a.Element.symbol=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.baseSetContext=this.setContext;this.setContext=function(c){this.baseSetContext(c);if(this.attribute("viewBox").hasValue()){var b=
|
||||
a.ToNumberArray(this.attribute("viewBox").value),k=b[0],e=b[1];width=b[2];height=b[3];a.AspectRatio(c,this.attribute("preserveAspectRatio").value,this.attribute("width").Length.toPixels("x"),width,this.attribute("height").Length.toPixels("y"),height,k,e);a.ViewPort.SetCurrent(b[2],b[3])}}};a.Element.symbol.prototype=new a.Element.RenderedElementBase;a.Element.style=function(c){this.base=a.Element.ElementBase;this.base(c);for(var c=c.childNodes[0].nodeValue+(c.childNodes.length>1?c.childNodes[1].nodeValue:
|
||||
""),c=c.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,""),c=a.compressSpaces(c),c=c.split("}"),d=0;d<c.length;d++)if(a.trim(c[d])!="")for(var b=c[d].split("{"),k=b[0].split(","),b=b[1].split(";"),e=0;e<k.length;e++){var f=a.trim(k[e]);if(f!=""){for(var g={},j=0;j<b.length;j++){var h=b[j].indexOf(":"),l=b[j].substr(0,h),h=b[j].substr(h+1,b[j].length-h);l!=null&&h!=null&&(g[a.trim(l)]=new a.Property(a.trim(l),a.trim(h)))}a.Styles[f]=g;if(f=="@font-face"){f=g["font-family"].value.replace(/"/g,
|
||||
"");g=g.src.value.split(",");for(j=0;j<g.length;j++)if(g[j].indexOf('format("svg")')>0){l=g[j].indexOf("url");h=g[j].indexOf(")",l);l=g[j].substr(l+5,h-l-6);l=a.parseXml(a.ajax(l)).getElementsByTagName("font");for(h=0;h<l.length;h++){var o=a.CreateElement(l[h]);a.Definitions[f]=o}}}}}};a.Element.style.prototype=new a.Element.ElementBase;a.Element.use=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.baseSetContext=this.setContext;this.setContext=function(a){this.baseSetContext(a);
|
||||
this.attribute("x").hasValue()&&a.translate(this.attribute("x").Length.toPixels("x"),0);this.attribute("y").hasValue()&&a.translate(0,this.attribute("y").Length.toPixels("y"))};this.getDefinition=function(){var a=this.attribute("xlink:href").Definition.getDefinition();if(this.attribute("width").hasValue())a.attribute("width",!0).value=this.attribute("width").value;if(this.attribute("height").hasValue())a.attribute("height",!0).value=this.attribute("height").value;return a};this.path=function(a){var b=
|
||||
this.getDefinition();b!=null&&b.path(a)};this.renderChildren=function(a){var b=this.getDefinition();b!=null&&b.render(a)}};a.Element.use.prototype=new a.Element.RenderedElementBase;a.Element.mask=function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,b){var c=this.attribute("x").Length.toPixels("x"),e=this.attribute("y").Length.toPixels("y"),f=this.attribute("width").Length.toPixels("x"),g=this.attribute("height").Length.toPixels("y"),j=b.attribute("mask").value;b.attribute("mask").value=
|
||||
"";var h=document.createElement("canvas");h.width=c+f;h.height=e+g;var l=h.getContext("2d");this.renderChildren(l);var o=document.createElement("canvas");o.width=c+f;o.height=e+g;var n=o.getContext("2d");b.render(n);n.globalCompositeOperation="destination-in";n.fillStyle=l.createPattern(h,"no-repeat");n.fillRect(0,0,c+f,e+g);a.fillStyle=n.createPattern(o,"no-repeat");a.fillRect(0,0,c+f,e+g);b.attribute("mask").value=j};this.render=function(){}};a.Element.mask.prototype=new a.Element.ElementBase;a.Element.clipPath=
|
||||
function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a){for(var b=0;b<this.children.length;b++)this.children[b].path&&(this.children[b].path(a),a.clip())};this.render=function(){}};a.Element.clipPath.prototype=new a.Element.ElementBase;a.Element.filter=function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,b){var c=b.getBoundingBox(),e=this.attribute("x").Length.toPixels("x"),f=this.attribute("y").Length.toPixels("y");if(e==0||f==0)e=c.x1,f=c.y1;var g=
|
||||
this.attribute("width").Length.toPixels("x"),j=this.attribute("height").Length.toPixels("y");if(g==0||j==0)g=c.width(),j=c.height();c=b.style("filter").value;b.style("filter").value="";var h=0.2*g,l=0.2*j,o=document.createElement("canvas");o.width=g+2*h;o.height=j+2*l;var n=o.getContext("2d");n.translate(-e+h,-f+l);b.render(n);for(var q=0;q<this.children.length;q++)this.children[q].apply(n,0,0,g+2*h,j+2*l);a.drawImage(o,0,0,g+2*h,j+2*l,e-h,f-l,g+2*h,j+2*l);b.style("filter",!0).value=c};this.render=
|
||||
function(){}};a.Element.filter.prototype=new a.Element.ElementBase;a.Element.feGaussianBlur=function(c){function d(a,c,d,f,g){for(var j=0;j<g;j++)for(var h=0;h<f;h++)for(var l=a[j*f*4+h*4+3]/255,o=0;o<4;o++){for(var n=d[0]*(l==0?255:a[j*f*4+h*4+o])*(l==0||o==3?1:l),q=1;q<d.length;q++){var p=Math.max(h-q,0),m=a[j*f*4+p*4+3]/255,p=Math.min(h+q,f-1),p=a[j*f*4+p*4+3]/255,s=d[q],r;m==0?r=255:(r=Math.max(h-q,0),r=a[j*f*4+r*4+o]);m=r*(m==0||o==3?1:m);p==0?r=255:(r=Math.min(h+q,f-1),r=a[j*f*4+r*4+o]);n+=
|
||||
s*(m+r*(p==0||o==3?1:p))}c[h*g*4+j*4+o]=n}}this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,c,e,f,g){var e=this.attribute("stdDeviation").numValue(),c=a.getImageData(0,0,f,g),e=Math.max(e,0.01),j=Math.ceil(e*4)+1;mask=[];for(var h=0;h<j;h++)mask[h]=Math.exp(-0.5*(h/e)*(h/e));e=mask;j=0;for(h=1;h<e.length;h++)j+=Math.abs(e[h]);j=2*j+Math.abs(e[0]);for(h=0;h<e.length;h++)e[h]/=j;tmp=[];d(c.data,tmp,e,f,g);d(tmp,c.data,e,g,f);a.clearRect(0,0,f,g);a.putImageData(c,0,0)}};a.Element.filter.prototype=
|
||||
new a.Element.feGaussianBlur;a.Element.title=function(){};a.Element.title.prototype=new a.Element.ElementBase;a.Element.desc=function(){};a.Element.desc.prototype=new a.Element.ElementBase;a.Element.MISSING=function(a){console.log("ERROR: Element '"+a.nodeName+"' not yet implemented.")};a.Element.MISSING.prototype=new a.Element.ElementBase;a.CreateElement=function(c){var d=c.nodeName.replace(/^[^:]+:/,""),d=d.replace(/\-/g,""),b=null,b=typeof a.Element[d]!="undefined"?new a.Element[d](c):new a.Element.MISSING(c);
|
||||
b.type=c.nodeName;return b};a.load=function(c,d){a.loadXml(c,a.ajax(d))};a.loadXml=function(c,d){a.loadXmlDoc(c,a.parseXml(d))};a.loadXmlDoc=function(c,d){a.init(c);var b=function(a){for(var b=c.canvas;b;)a.x-=b.offsetLeft,a.y-=b.offsetTop,b=b.offsetParent;window.scrollX&&(a.x+=window.scrollX);window.scrollY&&(a.y+=window.scrollY);return a};if(a.opts.ignoreMouse!=!0)c.canvas.onclick=function(c){c=b(new a.Point(c!=null?c.clientX:event.clientX,c!=null?c.clientY:event.clientY));a.Mouse.onclick(c.x,c.y)},
|
||||
c.canvas.onmousemove=function(c){c=b(new a.Point(c!=null?c.clientX:event.clientX,c!=null?c.clientY:event.clientY));a.Mouse.onmousemove(c.x,c.y)};var k=a.CreateElement(d.documentElement),e=k.root=!0,f=function(){a.ViewPort.Clear();c.canvas.parentNode&&a.ViewPort.SetCurrent(c.canvas.parentNode.clientWidth,c.canvas.parentNode.clientHeight);if(a.opts.ignoreDimensions!=!0){if(k.style("width").hasValue())c.canvas.width=k.style("width").Length.toPixels("x"),c.canvas.style.width=c.canvas.width+"px";if(k.style("height").hasValue())c.canvas.height=
|
||||
k.style("height").Length.toPixels("y"),c.canvas.style.height=c.canvas.height+"px"}var b=c.canvas.clientWidth||c.canvas.width,d=c.canvas.clientHeight||c.canvas.height;a.ViewPort.SetCurrent(b,d);if(a.opts!=null&&a.opts.offsetX!=null)k.attribute("x",!0).value=a.opts.offsetX;if(a.opts!=null&&a.opts.offsetY!=null)k.attribute("y",!0).value=a.opts.offsetY;if(a.opts!=null&&a.opts.scaleWidth!=null&&a.opts.scaleHeight!=null){var f=1,g=1;k.attribute("width").hasValue()&&(f=k.attribute("width").Length.toPixels("x")/
|
||||
a.opts.scaleWidth);k.attribute("height").hasValue()&&(g=k.attribute("height").Length.toPixels("y")/a.opts.scaleHeight);k.attribute("width",!0).value=a.opts.scaleWidth;k.attribute("height",!0).value=a.opts.scaleHeight;k.attribute("viewBox",!0).value="0 0 "+b*f+" "+d*g;k.attribute("preserveAspectRatio",!0).value="none"}a.opts.ignoreClear!=!0&&c.clearRect(0,0,b,d);k.render(c);e&&(e=!1,a.opts!=null&&typeof a.opts.renderCallback=="function"&&a.opts.renderCallback())},g=!0;a.ImagesLoaded()&&(g=!1,f());
|
||||
a.intervalID=setInterval(function(){var b=!1;g&&a.ImagesLoaded()&&(g=!1,b=!0);a.opts.ignoreMouse!=!0&&(b|=a.Mouse.hasEvents());if(a.opts.ignoreAnimation!=!0)for(var c=0;c<a.Animations.length;c++)b|=a.Animations[c].update(1E3/a.FRAMERATE);a.opts!=null&&typeof a.opts.forceRedraw=="function"&&a.opts.forceRedraw()==!0&&(b=!0);b&&(f(),a.Mouse.runEvents())},1E3/a.FRAMERATE)};a.stop=function(){a.intervalID&&clearInterval(a.intervalID)};a.Mouse=new function(){this.events=[];this.hasEvents=function(){return this.events.length!=
|
||||
0};this.onclick=function(a,d){this.events.push({type:"onclick",x:a,y:d,run:function(a){if(a.onclick)a.onclick()}})};this.onmousemove=function(a,d){this.events.push({type:"onmousemove",x:a,y:d,run:function(a){if(a.onmousemove)a.onmousemove()}})};this.eventElements=[];this.checkPath=function(a,d){for(var b=0;b<this.events.length;b++){var k=this.events[b];d.isPointInPath&&d.isPointInPath(k.x,k.y)&&(this.eventElements[b]=a)}};this.checkBoundingBox=function(a,d){for(var b=0;b<this.events.length;b++){var k=
|
||||
this.events[b];d.isPointInBox(k.x,k.y)&&(this.eventElements[b]=a)}};this.runEvents=function(){a.ctx.canvas.style.cursor="";for(var c=0;c<this.events.length;c++)for(var d=this.events[c],b=this.eventElements[c];b;)d.run(b),b=b.parent;this.events=[];this.eventElements=[]}};return a}this.canvg=function(a,c,d){if(a==null&&c==null&&d==null)for(var c=document.getElementsByTagName("svg"),b=0;b<c.length;b++){a=c[b];d=document.createElement("canvas");d.width=a.clientWidth;d.height=a.clientHeight;a.parentNode.insertBefore(d,
|
||||
a);a.parentNode.removeChild(a);var k=document.createElement("div");k.appendChild(a);canvg(d,k.innerHTML)}else d=d||{},typeof a=="string"&&(a=document.getElementById(a)),a.svg==null?(b=m(),a.svg=b):(b=a.svg,b.stop()),b.opts=d,a=a.getContext("2d"),typeof c.documentElement!="undefined"?b.loadXmlDoc(a,c):c.substr(0,1)=="<"?b.loadXml(a,c):b.load(a,c)}})();
|
||||
if(CanvasRenderingContext2D)CanvasRenderingContext2D.prototype.drawSvg=function(m,a,c,d,b){canvg(this.canvas,m,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:a,offsetY:c,scaleWidth:d,scaleHeight:b})};
|
||||
(function(m){var a=m.css,c=m.CanVGRenderer,d=m.SVGRenderer,b=m.extend,k=m.merge,e=m.addEvent,f=m.createElement,g=m.discardElement;b(c.prototype,d.prototype);b(c.prototype,{create:function(a,b,c,d){this.setContainer(b,c,d);this.configure(a)},setContainer:function(a,b,c){var d=a.style,e=a.parentNode,g=d.left,d=d.top,k=a.offsetWidth,m=a.offsetHeight,s={visibility:"hidden",position:"absolute"};this.init.apply(this,[a,b,c]);this.canvas=f("canvas",{width:k,height:m},{position:"relative",left:g,top:d},a);
|
||||
this.ttLine=f("div",null,s,e);this.ttDiv=f("div",null,s,e);this.ttTimer=void 0;this.hiddenSvg=a=f("div",{width:k,height:m},{visibility:"hidden",left:g,top:d},e);a.appendChild(this.box)},configure:function(b){var c=this,d=b.options.tooltip,f=d.borderWidth,g=c.ttDiv,m=d.style,p=c.ttLine,t=parseInt(m.padding,10),m=k(m,{padding:t+"px","background-color":d.backgroundColor,"border-style":"solid","border-width":f+"px","border-radius":d.borderRadius+"px"});d.shadow&&(m=k(m,{"box-shadow":"1px 1px 3px gray",
|
||||
"-webkit-box-shadow":"1px 1px 3px gray"}));a(g,m);a(p,{"border-left":"1px solid darkgray"});e(b,"tooltipRefresh",function(d){var e=b.container,f=e.offsetLeft,e=e.offsetTop,k;g.innerHTML=d.text;k=b.tooltip.getPosition(g.offsetWidth,g.offsetHeight,{plotX:d.x,plotY:d.y});a(g,{visibility:"visible",left:k.x+"px",top:k.y+"px","border-color":d.borderColor});a(p,{visibility:"visible",left:f+d.x+"px",top:e+b.plotTop+"px",height:b.plotHeight+"px"});c.ttTimer!==void 0&&clearTimeout(c.ttTimer);c.ttTimer=setTimeout(function(){a(g,
|
||||
{visibility:"hidden"});a(p,{visibility:"hidden"})},3E3)})},destroy:function(){g(this.canvas);this.ttTimer!==void 0&&clearTimeout(this.ttTimer);g(this.ttLine);g(this.ttDiv);g(this.hiddenSvg);return d.prototype.destroy.apply(this)},color:function(a,b,c){a&&a.linearGradient&&(a=a.stops[a.stops.length-1][1]);return d.prototype.color.call(this,a,b,c)},draw:function(){window.canvg(this.canvas,this.hiddenSvg.innerHTML)}})})(Highcharts);
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
Data plugin for Highcharts
|
||||
|
||||
(c) 2012-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(j){var m=j.each,n=function(a,b){this.init(a,b)};j.extend(n.prototype,{init:function(a,b){this.options=a;this.chartOptions=b;this.columns=a.columns||this.rowsToColumns(a.rows)||[];this.columns.length?this.dataFound():(this.parseCSV(),this.parseTable(),this.parseGoogleSpreadsheet())},getColumnDistribution:function(){var a=this.chartOptions,b=a&&a.chart&&a.chart.type,c=[];m(a&&a.series||[],function(a){c.push((j.seriesTypes[a.type||b||"line"].prototype.pointArrayMap||[0]).length)});this.valueCount=
|
||||
{global:(j.seriesTypes[b||"line"].prototype.pointArrayMap||[0]).length,individual:c}},dataFound:function(){if(this.options.switchRowsAndColumns)this.columns=this.rowsToColumns(this.columns);this.parseTypes();this.findHeaderRow();this.parsed();this.complete()},parseCSV:function(){var a=this,b=this.options,c=b.csv,d=this.columns,e=b.startRow||0,h=b.endRow||Number.MAX_VALUE,i=b.startColumn||0,g=b.endColumn||Number.MAX_VALUE,f,k,o=0;c&&(k=c.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split(b.lineDelimiter||
|
||||
"\n"),f=b.itemDelimiter||(c.indexOf("\t")!==-1?"\t":","),m(k,function(b,c){var k=a.trim(b),j=k.indexOf("#")===0;c>=e&&c<=h&&!j&&k!==""&&(k=b.split(f),m(k,function(b,a){a>=i&&a<=g&&(d[a-i]||(d[a-i]=[]),d[a-i][o]=b)}),o+=1)}),this.dataFound())},parseTable:function(){var a=this.options,b=a.table,c=this.columns,d=a.startRow||0,e=a.endRow||Number.MAX_VALUE,h=a.startColumn||0,i=a.endColumn||Number.MAX_VALUE;b&&(typeof b==="string"&&(b=document.getElementById(b)),m(b.getElementsByTagName("tr"),function(a,
|
||||
b){b>=d&&b<=e&&m(a.children,function(a,e){if((a.tagName==="TD"||a.tagName==="TH")&&e>=h&&e<=i)c[e-h]||(c[e-h]=[]),c[e-h][b-d]=a.innerHTML})}),this.dataFound())},parseGoogleSpreadsheet:function(){var a=this,b=this.options,c=b.googleSpreadsheetKey,d=this.columns,e=b.startRow||0,h=b.endRow||Number.MAX_VALUE,i=b.startColumn||0,g=b.endColumn||Number.MAX_VALUE,f,k;c&&jQuery.ajax({dataType:"json",url:"https://spreadsheets.google.com/feeds/cells/"+c+"/"+(b.googleSpreadsheetWorksheet||"od6")+"/public/values?alt=json-in-script&callback=?",
|
||||
error:b.error,success:function(b){var b=b.feed.entry,c,j=b.length,m=0,n=0,l;for(l=0;l<j;l++)c=b[l],m=Math.max(m,c.gs$cell.col),n=Math.max(n,c.gs$cell.row);for(l=0;l<m;l++)if(l>=i&&l<=g)d[l-i]=[],d[l-i].length=Math.min(n,h-e);for(l=0;l<j;l++)if(c=b[l],f=c.gs$cell.row-1,k=c.gs$cell.col-1,k>=i&&k<=g&&f>=e&&f<=h)d[k-i][f-e]=c.content.$t;a.dataFound()}})},findHeaderRow:function(){m(this.columns,function(){});this.headerRow=0},trim:function(a){return typeof a==="string"?a.replace(/^\s+|\s+$/g,""):a},parseTypes:function(){for(var a=
|
||||
this.columns,b=a.length,c,d,e,h;b--;)for(c=a[b].length;c--;)d=a[b][c],e=parseFloat(d),h=this.trim(d),h==e?(a[b][c]=e,e>31536E6?a[b].isDatetime=!0:a[b].isNumeric=!0):(d=this.parseDate(d),b===0&&typeof d==="number"&&!isNaN(d)?(a[b][c]=d,a[b].isDatetime=!0):a[b][c]=h===""?null:h)},dateFormats:{"YYYY-mm-dd":{regex:"^([0-9]{4})-([0-9]{2})-([0-9]{2})$",parser:function(a){return Date.UTC(+a[1],a[2]-1,+a[3])}}},parseDate:function(a){var b=this.options.parseDate,c,d,e;b&&(c=b(a));if(typeof a==="string")for(d in this.dateFormats)b=
|
||||
this.dateFormats[d],(e=a.match(b.regex))&&(c=b.parser(e));return c},rowsToColumns:function(a){var b,c,d,e,h;if(a){h=[];c=a.length;for(b=0;b<c;b++){e=a[b].length;for(d=0;d<e;d++)h[d]||(h[d]=[]),h[d][b]=a[b][d]}}return h},parsed:function(){this.options.parsed&&this.options.parsed.call(this,this.columns)},complete:function(){var a=this.columns,b,c,d=this.options,e,h,i,g,f,k;if(d.complete){this.getColumnDistribution();a.length>1&&(b=a.shift(),this.headerRow===0&&b.shift(),b.isDatetime?c="datetime":b.isNumeric||
|
||||
(c="category"));for(g=0;g<a.length;g++)if(this.headerRow===0)a[g].name=a[g].shift();h=[];for(g=0,k=0;g<a.length;k++){e=j.pick(this.valueCount.individual[k],this.valueCount.global);i=[];if(g+e<=a.length)for(f=0;f<a[g].length;f++)i[f]=[b[f],a[g][f]!==void 0?a[g][f]:null],e>1&&i[f].push(a[g+1][f]!==void 0?a[g+1][f]:null),e>2&&i[f].push(a[g+2][f]!==void 0?a[g+2][f]:null),e>3&&i[f].push(a[g+3][f]!==void 0?a[g+3][f]:null),e>4&&i[f].push(a[g+4][f]!==void 0?a[g+4][f]:null);h[k]={name:a[g].name,data:i};g+=
|
||||
e}d.complete({xAxis:{type:c},series:h})}}});j.Data=n;j.data=function(a,b){return new n(a,b)};j.wrap(j.Chart.prototype,"init",function(a,b,c){var d=this;b&&b.data?j.data(j.extend(b.data,{complete:function(e){b.hasOwnProperty("series")&&(typeof b.series==="object"?m(b.series,function(a,c){b.series[c]=j.merge(a,e.series[c])}):delete b.series);b=j.merge(e,b);a.call(d,b,c)}}),b):a.call(d,b,c)})})(Highcharts);
|
|
@ -0,0 +1,14 @@
|
|||
(function(g){function s(a,b,d){return"rgba("+[Math.round(a[0]+(b[0]-a[0])*d),Math.round(a[1]+(b[1]-a[1])*d),Math.round(a[2]+(b[2]-a[2])*d),a[3]+(b[3]-a[3])*d].join(",")+")"}var t=function(){},o=g.getOptions(),i=g.each,p=g.extend,x=g.format,q=g.wrap,l=g.Chart,n=g.seriesTypes,u=n.pie,m=n.column,v=HighchartsAdapter.fireEvent,y=HighchartsAdapter.inArray;p(o.lang,{drillUpText:"◁ Back to {series.name}"});o.drilldown={activeAxisLabelStyle:{cursor:"pointer",color:"#0d233a",fontWeight:"bold",textDecoration:"underline"},
|
||||
activeDataLabelStyle:{cursor:"pointer",color:"#0d233a",fontWeight:"bold",textDecoration:"underline"},animation:{duration:500},drillUpButton:{position:{align:"right",x:-10,y:10}}};g.SVGRenderer.prototype.Element.prototype.fadeIn=function(a){this.attr({opacity:0.1,visibility:"inherit"}).animate({opacity:1},a||{duration:250})};l.prototype.addSeriesAsDrilldown=function(a,b){this.addSingleSeriesAsDrilldown(a,b);this.applyDrilldown()};l.prototype.addSingleSeriesAsDrilldown=function(a,b){var d=a.series,
|
||||
c=d.xAxis,f=d.yAxis,h;h=a.color||d.color;var e,w=[],g=[],k;k=d.levelNumber||0;b=p({color:h},b);e=y(a,d.points);i(d.chart.series,function(a){if(a.xAxis===c)w.push(a),g.push(a.userOptions),a.levelNumber=a.levelNumber||0});h={levelNumber:k,seriesOptions:d.userOptions,levelSeriesOptions:g,levelSeries:w,shapeArgs:a.shapeArgs,bBox:a.graphic.getBBox(),color:h,lowerSeriesOptions:b,pointOptions:d.options.data[e],pointIndex:e,oldExtremes:{xMin:c&&c.userMin,xMax:c&&c.userMax,yMin:f&&f.userMin,yMax:f&&f.userMax}};
|
||||
if(!this.drilldownLevels)this.drilldownLevels=[];this.drilldownLevels.push(h);h=h.lowerSeries=this.addSeries(b,!1);h.levelNumber=k+1;if(c)c.oldPos=c.pos,c.userMin=c.userMax=null,f.userMin=f.userMax=null;if(d.type===h.type)h.animate=h.animateDrilldown||t,h.options.animation=!0};l.prototype.applyDrilldown=function(){var a=this.drilldownLevels,b=a[a.length-1].levelNumber;i(this.drilldownLevels,function(a){a.levelNumber===b&&i(a.levelSeries,function(a){a.levelNumber===b&&a.remove(!1)})});this.redraw();
|
||||
this.showDrillUpButton()};l.prototype.getDrilldownBackText=function(){var a=this.drilldownLevels[this.drilldownLevels.length-1];a.series=a.seriesOptions;return x(this.options.lang.drillUpText,a)};l.prototype.showDrillUpButton=function(){var a=this,b=this.getDrilldownBackText(),d=a.options.drilldown.drillUpButton,c,f;this.drillUpButton?this.drillUpButton.attr({text:b}).align():(f=(c=d.theme)&&c.states,this.drillUpButton=this.renderer.button(b,null,null,function(){a.drillUp()},c,f&&f.hover,f&&f.select).attr({align:d.position.align,
|
||||
zIndex:9}).add().align(d.position,!1,d.relativeTo||"plotBox"))};l.prototype.drillUp=function(){for(var a=this,b=a.drilldownLevels,d=b[b.length-1].levelNumber,c=b.length,f=a.series,h=f.length,e,g,j,k,l=function(b){var c;i(f,function(a){a.userOptions===b&&(c=a)});c=c||a.addSeries(b,!1);if(c.type===g.type&&c.animateDrillupTo)c.animate=c.animateDrillupTo;b===e.seriesOptions&&(j=c)};c--;)if(e=b[c],e.levelNumber===d){b.pop();g=e.lowerSeries;if(!g.chart)for(;h--;)if(f[h].options.id===e.lowerSeriesOptions.id){g=
|
||||
f[h];break}g.xData=[];i(e.levelSeriesOptions,l);v(a,"drillup",{seriesOptions:e.seriesOptions});if(j.type===g.type)j.drilldownLevel=e,j.options.animation=a.options.drilldown.animation,g.animateDrillupFrom&&g.animateDrillupFrom(e);j.levelNumber=d;g.remove(!1);if(j.xAxis)k=e.oldExtremes,j.xAxis.setExtremes(k.xMin,k.xMax,!1),j.yAxis.setExtremes(k.yMin,k.yMax,!1)}this.redraw();this.drilldownLevels.length===0?this.drillUpButton=this.drillUpButton.destroy():this.drillUpButton.attr({text:this.getDrilldownBackText()}).align()};
|
||||
m.prototype.supportsDrilldown=!0;m.prototype.animateDrillupTo=function(a){if(!a){var b=this,d=b.drilldownLevel;i(this.points,function(a){a.graphic.hide();a.dataLabel&&a.dataLabel.hide();a.connector&&a.connector.hide()});setTimeout(function(){i(b.points,function(a,b){var h=b===(d&&d.pointIndex)?"show":"fadeIn",e=h==="show"?!0:void 0;a.graphic[h](e);if(a.dataLabel)a.dataLabel[h](e);if(a.connector)a.connector[h](e)})},Math.max(this.chart.options.drilldown.animation.duration-50,0));this.animate=t}};m.prototype.animateDrilldown=
|
||||
function(a){var b=this,d=this.chart.drilldownLevels,c=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1].shapeArgs,f=this.chart.options.drilldown.animation;if(!a)i(d,function(a){if(b.userOptions===a.lowerSeriesOptions)c=a.shapeArgs}),c.x+=this.xAxis.oldPos-this.xAxis.pos,i(this.points,function(a){a.graphic&&a.graphic.attr(c).animate(a.shapeArgs,f);a.dataLabel&&a.dataLabel.fadeIn(f)}),this.animate=null};m.prototype.animateDrillupFrom=function(a){var b=this.chart.options.drilldown.animation,
|
||||
d=this.group,c=this;i(c.trackerGroups,function(a){if(c[a])c[a].on("mouseover")});delete this.group;i(this.points,function(c){var h=c.graphic,e=g.Color(c.color).rgba,i=g.Color(a.color).rgba,j=function(){h.destroy();d&&(d=d.destroy())};h&&(delete c.graphic,b?h.animate(a.shapeArgs,g.merge(b,{step:function(a,b){b.prop==="start"&&e.length===4&&i.length===4&&this.attr({fill:s(e,i,b.pos)})},complete:j})):(h.attr(a.shapeArgs),j()))})};u&&p(u.prototype,{supportsDrilldown:!0,animateDrillupTo:m.prototype.animateDrillupTo,
|
||||
animateDrillupFrom:m.prototype.animateDrillupFrom,animateDrilldown:function(a){var b=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1],d=this.chart.options.drilldown.animation,c=b.shapeArgs,f=c.start,h=(c.end-f)/this.points.length,e=g.Color(b.color).rgba;if(!a)i(this.points,function(a,b){var i=g.Color(a.color).rgba;a.graphic.attr(g.merge(c,{start:f+b*h,end:f+(b+1)*h}))[d?"animate":"attr"](a.shapeArgs,g.merge(d,{step:function(a,b){b.prop==="start"&&e.length===4&&i.length===4&&this.attr({fill:s(e,
|
||||
i,b.pos)})}}))}),this.animate=null}});g.Point.prototype.doDrilldown=function(a){for(var b=this.series.chart,d=b.options.drilldown,c=(d.series||[]).length,f;c--&&!f;)d.series[c].id===this.drilldown&&(f=d.series[c]);v(b,"drilldown",{point:this,seriesOptions:f});f&&(a?b.addSingleSeriesAsDrilldown(this,f):b.addSeriesAsDrilldown(this,f))};q(g.Point.prototype,"init",function(a,b,d,c){var f=a.call(this,b,d,c),h=b.chart,e=(a=b.xAxis&&b.xAxis.ticks[c])&&a.label;if(f.drilldown){if(g.addEvent(f,"click",function(){f.doDrilldown()}),
|
||||
e){if(!e._basicStyle)e._basicStyle=e.element.getAttribute("style");e.addClass("highcharts-drilldown-axis-label").css(h.options.drilldown.activeAxisLabelStyle).on("click",function(){i(e.ddPoints,function(a){a.doDrilldown&&a.doDrilldown(!0)});h.applyDrilldown()});if(!e.ddPoints)e.ddPoints=[];e.ddPoints.push(f)}}else e&&e._basicStyle&&e.element.setAttribute("style",e._basicStyle);return f});q(g.Series.prototype,"drawDataLabels",function(a){var b=this.chart.options.drilldown.activeDataLabelStyle;a.call(this);
|
||||
i(this.points,function(a){if(a.drilldown&&a.dataLabel)a.dataLabel.attr({"class":"highcharts-drilldown-data-label"}).css(b).on("click",function(){a.doDrilldown()})})});var r,o=function(a){a.call(this);i(this.points,function(a){a.drilldown&&a.graphic&&a.graphic.attr({"class":"highcharts-drilldown-point"}).css({cursor:"pointer"})})};for(r in n)n[r].prototype.supportsDrilldown&&q(n[r].prototype,"drawTracker",o)})(Highcharts);
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
Highstock JS v2.0.1 (2014-04-24)
|
||||
Exporting module
|
||||
|
||||
(c) 2010-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(f){var A=f.Chart,t=f.addEvent,B=f.removeEvent,l=f.createElement,o=f.discardElement,v=f.css,k=f.merge,r=f.each,p=f.extend,D=Math.max,j=document,C=window,E=f.isTouchDevice,F=f.Renderer.prototype.symbols,s=f.getOptions(),y;p(s.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",contextButtonTitle:"Chart context menu"});s.navigation={menuStyle:{border:"1px solid #A0A0A0",
|
||||
background:"#FFFFFF",padding:"5px 0"},menuItemStyle:{padding:"0 10px",background:"none",color:"#303030",fontSize:E?"14px":"11px"},menuItemHoverStyle:{background:"#4572A5",color:"#FFFFFF"},buttonOptions:{symbolFill:"#E0E0E0",symbolSize:14,symbolStroke:"#666",symbolStrokeWidth:3,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,theme:{fill:"white",stroke:"none"},verticalAlign:"top",width:24}};s.exporting={type:"image/png",url:"http://export.highcharts.com/",buttons:{contextButton:{menuClassName:"highcharts-contextmenu",
|
||||
symbol:"menu",_titleKey:"contextButtonTitle",menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChart()}},{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}]}}};f.post=function(b,a,d){var c,b=l("form",k({method:"post",
|
||||
action:b,enctype:"multipart/form-data"},d),{display:"none"},j.body);for(c in a)l("input",{type:"hidden",name:c,value:a[c]},null,b);b.submit();o(b)};p(A.prototype,{getSVG:function(b){var a=this,d,c,z,h,g=k(a.options,b);if(!j.createElementNS)j.createElementNS=function(a,b){return j.createElement(b)};b=l("div",null,{position:"absolute",top:"-9999em",width:a.chartWidth+"px",height:a.chartHeight+"px"},j.body);c=a.renderTo.style.width;h=a.renderTo.style.height;c=g.exporting.sourceWidth||g.chart.width||
|
||||
/px$/.test(c)&&parseInt(c,10)||600;h=g.exporting.sourceHeight||g.chart.height||/px$/.test(h)&&parseInt(h,10)||400;p(g.chart,{animation:!1,renderTo:b,forExport:!0,width:c,height:h});g.exporting.enabled=!1;g.series=[];r(a.series,function(a){z=k(a.options,{animation:!1,showCheckbox:!1,visible:a.visible});z.isInternal||g.series.push(z)});d=new f.Chart(g,a.callback);r(["xAxis","yAxis"],function(b){r(a[b],function(a,c){var g=d[b][c],f=a.getExtremes(),h=f.userMin,f=f.userMax;g&&(h!==void 0||f!==void 0)&&
|
||||
g.setExtremes(h,f,!0,!1)})});c=d.container.innerHTML;g=null;d.destroy();o(b);c=c.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ').replace(/ href=/g," xlink:href=").replace(/\n/," ").replace(/<\/svg>.*?$/,"</svg>").replace(/ /g," ").replace(/­/g,"").replace(/<IMG /g,"<image ").replace(/height=([^" ]+)/g,'height="$1"').replace(/width=([^" ]+)/g,
|
||||
'width="$1"').replace(/hc-svg-href="([^"]+)">/g,'xlink:href="$1"/>').replace(/id=([^" >]+)/g,'id="$1"').replace(/class=([^" >]+)/g,'class="$1"').replace(/ transform /g," ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(a){return a.toLowerCase()});return c=c.replace(/(url\(#highcharts-[0-9]+)"/g,"$1").replace(/"/g,"'")},exportChart:function(b,a){var b=b||{},d=this.options.exporting,d=this.getSVG(k({chart:{borderRadius:0}},d.chartOptions,a,{exporting:{sourceWidth:b.sourceWidth||
|
||||
d.sourceWidth,sourceHeight:b.sourceHeight||d.sourceHeight}})),b=k(this.options.exporting,b);f.post(b.url,{filename:b.filename||"chart",type:b.type,width:b.width||0,scale:b.scale||2,svg:d},b.formAttributes)},print:function(){var b=this,a=b.container,d=[],c=a.parentNode,f=j.body,h=f.childNodes;if(!b.isPrinting)b.isPrinting=!0,r(h,function(a,b){if(a.nodeType===1)d[b]=a.style.display,a.style.display="none"}),f.appendChild(a),C.focus(),C.print(),setTimeout(function(){c.appendChild(a);r(h,function(a,b){if(a.nodeType===
|
||||
1)a.style.display=d[b]});b.isPrinting=!1},1E3)},contextMenu:function(b,a,d,c,f,h,g){var e=this,k=e.options.navigation,q=k.menuItemStyle,m=e.chartWidth,n=e.chartHeight,j="cache-"+b,i=e[j],u=D(f,h),w,x,o,s=function(a){e.pointer.inClass(a.target,b)||x()};if(!i)e[j]=i=l("div",{className:b},{position:"absolute",zIndex:1E3,padding:u+"px"},e.container),w=l("div",null,p({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},k.menuStyle),i),x=function(){v(i,{display:"none"});
|
||||
g&&g.setState(0);e.openMenu=!1},t(i,"mouseleave",function(){o=setTimeout(x,500)}),t(i,"mouseenter",function(){clearTimeout(o)}),t(document,"mouseup",s),t(e,"destroy",function(){B(document,"mouseup",s)}),r(a,function(a){if(a){var b=a.separator?l("hr",null,null,w):l("div",{onmouseover:function(){v(this,k.menuItemHoverStyle)},onmouseout:function(){v(this,q)},onclick:function(){x();a.onclick.apply(e,arguments)},innerHTML:a.text||e.options.lang[a.textKey]},p({cursor:"pointer"},q),w);e.exportDivElements.push(b)}}),
|
||||
e.exportDivElements.push(w,i),e.exportMenuWidth=i.offsetWidth,e.exportMenuHeight=i.offsetHeight;a={display:"block"};d+e.exportMenuWidth>m?a.right=m-d-f-u+"px":a.left=d-u+"px";c+h+e.exportMenuHeight>n&&g.alignOptions.verticalAlign!=="top"?a.bottom=n-c-u+"px":a.top=c+h-u+"px";v(i,a);e.openMenu=!0},addButton:function(b){var a=this,d=a.renderer,c=k(a.options.navigation.buttonOptions,b),j=c.onclick,h=c.menuItems,g,e,l={stroke:c.symbolStroke,fill:c.symbolFill},q=c.symbolSize||12;if(!a.btnCount)a.btnCount=
|
||||
0;if(!a.exportDivElements)a.exportDivElements=[],a.exportSVGElements=[];if(c.enabled!==!1){var m=c.theme,n=m.states,o=n&&n.hover,n=n&&n.select,i;delete m.states;j?i=function(){j.apply(a,arguments)}:h&&(i=function(){a.contextMenu(e.menuClassName,h,e.translateX,e.translateY,e.width,e.height,e);e.setState(2)});c.text&&c.symbol?m.paddingLeft=f.pick(m.paddingLeft,25):c.text||p(m,{width:c.width,height:c.height,padding:0});e=d.button(c.text,0,0,i,m,o,n).attr({title:a.options.lang[c._titleKey],"stroke-linecap":"round"});
|
||||
e.menuClassName=b.menuClassName||"highcharts-menu-"+a.btnCount++;c.symbol&&(g=d.symbol(c.symbol,c.symbolX-q/2,c.symbolY-q/2,q,q).attr(p(l,{"stroke-width":c.symbolStrokeWidth||1,zIndex:1})).add(e));e.add().align(p(c,{width:e.width,x:f.pick(c.x,y)}),!0,"spacingBox");y+=(e.width+c.buttonSpacing)*(c.align==="right"?-1:1);a.exportSVGElements.push(e,g)}},destroyExport:function(b){var b=b.target,a,d;for(a=0;a<b.exportSVGElements.length;a++)if(d=b.exportSVGElements[a])d.onclick=d.ontouchstart=null,b.exportSVGElements[a]=
|
||||
d.destroy();for(a=0;a<b.exportDivElements.length;a++)d=b.exportDivElements[a],B(d,"mouseleave"),b.exportDivElements[a]=d.onmouseout=d.onmouseover=d.ontouchstart=d.onclick=null,o(d)}});F.menu=function(b,a,d,c){return["M",b,a+2.5,"L",b+d,a+2.5,"M",b,a+c/2+0.5,"L",b+d,a+c/2+0.5,"M",b,a+c-1.5,"L",b+d,a+c-1.5]};A.prototype.callbacks.push(function(b){var a,d=b.options.exporting,c=d.buttons;y=0;if(d.enabled!==!1){for(a in c)b.addButton(c[a]);t(b,"destroy",b.destroyExport)}})})(Highcharts);
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
|
||||
Highcharts funnel module
|
||||
|
||||
(c) 2010-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(b){var d=b.getOptions(),v=d.plotOptions,q=b.seriesTypes,E=b.merge,D=function(){},A=b.each;v.funnel=E(v.pie,{animation:!1,center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",reversed:!1,dataLabels:{connectorWidth:1,connectorColor:"#606060"},size:!0,states:{select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}}});q.funnel=b.extendClass(q.pie,{type:"funnel",animate:D,singularTooltips:!0,translate:function(){var a=function(j,a){return/%$/.test(j)?a*parseInt(j,
|
||||
10)/100:parseInt(j,10)},B=0,f=this.chart,c=this.options,g=c.reversed,b=f.plotWidth,n=f.plotHeight,o=0,f=c.center,h=a(f[0],b),d=a(f[0],n),q=a(c.width,b),k,r,e=a(c.height,n),s=a(c.neckWidth,b),t=a(c.neckHeight,n),w=e-t,a=this.data,x,y,v=c.dataLabels.position==="left"?1:0,z,l,C,p,i,u,m;this.getWidthAt=r=function(j){return j>e-t||e===t?s:s+(q-s)*((e-t-j)/(e-t))};this.getX=function(j,a){return h+(a?-1:1)*(r(g?n-j:j)/2+c.dataLabels.distance)};this.center=[h,d,e];this.centerX=h;A(a,function(a){B+=a.y});
|
||||
A(a,function(a){m=null;y=B?a.y/B:0;l=d-e/2+o*e;i=l+y*e;k=r(l);z=h-k/2;C=z+k;k=r(i);p=h-k/2;u=p+k;l>w?(z=p=h-s/2,C=u=h+s/2):i>w&&(m=i,k=r(w),p=h-k/2,u=p+k,i=w);g&&(l=e-l,i=e-i,m=m?e-m:null);x=["M",z,l,"L",C,l,u,i];m&&x.push(u,m,p,m);x.push(p,i,"Z");a.shapeType="path";a.shapeArgs={d:x};a.percentage=y*100;a.plotX=h;a.plotY=(l+(m||i))/2;a.tooltipPos=[h,a.plotY];a.slice=D;a.half=v;o+=y})},drawPoints:function(){var a=this,b=a.options,f=a.chart.renderer;A(a.data,function(c){var g=c.graphic,d=c.shapeArgs;
|
||||
g?g.animate(d):c.graphic=f.path(d).attr({fill:c.color,stroke:b.borderColor,"stroke-width":b.borderWidth}).add(a.group)})},sortByAngle:function(a){a.sort(function(a,b){return a.plotY-b.plotY})},drawDataLabels:function(){var a=this.data,b=this.options.dataLabels.distance,f,c,g,d=a.length,n,o;for(this.center[2]-=2*b;d--;)g=a[d],c=(f=g.half)?1:-1,o=g.plotY,n=this.getX(o,f),g.labelPos=[0,o,n+(b-5)*c,o,n+b*c,o,f?"right":"left",0];q.pie.prototype.drawDataLabels.call(this)}});d.plotOptions.pyramid=b.merge(d.plotOptions.funnel,
|
||||
{neckWidth:"0%",neckHeight:"0%",reversed:!0});b.seriesTypes.pyramid=b.extendClass(b.seriesTypes.funnel,{type:"pyramid"})})(Highcharts);
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
Highstock JS v2.0.1 (2014-04-24)
|
||||
|
||||
(c) 2011-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(g){var j=g.Axis,x=g.Chart,o=g.Color,y=g.Legend,s=g.LegendSymbolMixin,t=g.Series,u=g.getOptions(),k=g.each,p=g.extend,z=g.extendClass,l=g.merge,q=g.pick,v=g.numberFormat,m=g.seriesTypes,w=g.wrap,n=function(){},r=g.ColorAxis=function(){this.isColorAxis=!0;this.init.apply(this,arguments)};p(r.prototype,j.prototype);p(r.prototype,{defaultColorAxisOptions:{lineWidth:0,gridLineWidth:1,tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50},color:"gray",width:0.01},
|
||||
labels:{overflow:"justify"},minColor:"#EFEFFF",maxColor:"#003875",tickLength:5},init:function(b,a){var d=b.options.legend.layout!=="vertical",c;c=l(this.defaultColorAxisOptions,{side:d?2:1,reversed:!d},a,{isX:d,opposite:!d,showEmpty:!1,title:null,isColor:!0});j.prototype.init.call(this,b,c);a.dataClasses&&this.initDataClasses(a);this.initStops(a);this.isXAxis=!0;this.horiz=d;this.zoomEnabled=!1},tweenColors:function(b,a,d){var c=a.rgba[3]!==1||b.rgba[3]!==1;return(c?"rgba(":"rgb(")+Math.round(a.rgba[0]+
|
||||
(b.rgba[0]-a.rgba[0])*(1-d))+","+Math.round(a.rgba[1]+(b.rgba[1]-a.rgba[1])*(1-d))+","+Math.round(a.rgba[2]+(b.rgba[2]-a.rgba[2])*(1-d))+(c?","+(a.rgba[3]+(b.rgba[3]-a.rgba[3])*(1-d)):"")+")"},initDataClasses:function(b){var a=this,d=this.chart,c,e=0,h=this.options;this.dataClasses=c=[];k(b.dataClasses,function(f,i){var g,f=l(f);c.push(f);if(!f.color)h.dataClassColor==="category"?(g=d.options.colors,f.color=g[e++],e===g.length&&(e=0)):f.color=a.tweenColors(o(h.minColor),o(h.maxColor),i/(b.dataClasses.length-
|
||||
1))})},initStops:function(b){this.stops=b.stops||[[0,this.options.minColor],[1,this.options.maxColor]];k(this.stops,function(a){a.color=o(a[1])})},setOptions:function(b){j.prototype.setOptions.call(this,b);this.options.crosshair=this.options.marker;this.coll="colorAxis"},setAxisSize:function(){var b=this.legendSymbol,a=this.chart,d,c,e;if(b)this.left=d=b.attr("x"),this.top=c=b.attr("y"),this.width=e=b.attr("width"),this.height=b=b.attr("height"),this.right=a.chartWidth-d-e,this.bottom=a.chartHeight-
|
||||
c-b,this.len=this.horiz?e:b,this.pos=this.horiz?d:c},toColor:function(b,a){var d,c=this.stops,e,h=this.dataClasses,f,i;if(h)for(i=h.length;i--;){if(f=h[i],e=f.from,c=f.to,(e===void 0||b>=e)&&(c===void 0||b<=c)){d=f.color;if(a)a.dataClass=i;break}}else{this.isLog&&(b=this.val2lin(b));d=1-(this.max-b)/(this.max-this.min);for(i=c.length;i--;)if(d>c[i][0])break;e=c[i]||c[i+1];c=c[i+1]||e;d=1-(c[0]-d)/(c[0]-e[0]||1);d=this.tweenColors(e.color,c.color,d)}return d},getOffset:function(){var b=this.legendGroup;
|
||||
if(b&&(j.prototype.getOffset.call(this),!this.axisGroup.parentGroup))this.axisGroup.add(b),this.gridGroup.add(b),this.labelGroup.add(b),this.added=!0},setLegendColor:function(){var b,a=this.options;b=this.horiz?[0,0,1,0]:[0,0,0,1];this.legendColor={linearGradient:{x1:b[0],y1:b[1],x2:b[2],y2:b[3]},stops:a.stops||[[0,a.minColor],[1,a.maxColor]]}},drawLegendSymbol:function(b,a){var d=b.padding,c=b.options,e=this.horiz,h=q(c.symbolWidth,e?200:12),f=q(c.symbolHeight,e?12:200),c=q(c.labelPadding,e?10:30);
|
||||
this.setLegendColor();a.legendSymbol=this.chart.renderer.rect(0,b.baseline-11,h,f).attr({zIndex:1}).add(a.legendGroup);a.legendSymbol.getBBox();this.legendItemWidth=h+d+(e?0:c);this.legendItemHeight=f+d+(e?c:0)},setState:n,visible:!0,setVisible:n,getSeriesExtremes:function(){var b;if(this.series.length)b=this.series[0],this.dataMin=b.valueMin,this.dataMax=b.valueMax},drawCrosshair:function(b,a){var d=!this.cross,c=a&&a.plotX,e=a&&a.plotY,h,f=this.pos,i=this.len;if(a)h=this.toPixels(a.value),h<f?h=
|
||||
f-2:h>f+i&&(h=f+i+2),a.plotX=h,a.plotY=this.len-h,j.prototype.drawCrosshair.call(this,b,a),a.plotX=c,a.plotY=e,!d&&this.cross&&this.cross.attr({fill:this.crosshair.color}).add(this.labelGroup)},getPlotLinePath:function(b,a,d,c,e){return e?this.horiz?["M",e-4,this.top-6,"L",e+4,this.top-6,e,this.top,"Z"]:["M",this.left,e,"L",this.left-6,e+6,this.left-6,e-6,"Z"]:j.prototype.getPlotLinePath.call(this,b,a,d,c)},update:function(b,a){k(this.series,function(a){a.isDirtyData=!0});j.prototype.update.call(this,
|
||||
b,a);this.legendItem&&(this.setLegendColor(),this.chart.legend.colorizeItem(this,!0))},getDataClassLegendSymbols:function(){var b=this,a=this.chart,d=[],c=a.options.legend,e=c.valueDecimals,h=c.valueSuffix||"",f;k(this.dataClasses,function(c,g){var j=!0,l=c.from,m=c.to;f="";l===void 0?f="< ":m===void 0&&(f="> ");l!==void 0&&(f+=v(l,e)+h);l!==void 0&&m!==void 0&&(f+=" - ");m!==void 0&&(f+=v(m,e)+h);d.push(p({chart:a,name:f,options:{},drawLegendSymbol:s.drawRectangle,visible:!0,setState:n,setVisible:function(){j=
|
||||
this.visible=!j;k(b.series,function(a){k(a.points,function(a){a.dataClass===g&&a.setVisible(j)})});a.legend.colorizeItem(this,j)}},c))});return d},name:""});w(x.prototype,"getAxes",function(b){var a=this.options.colorAxis;b.call(this);this.colorAxis=[];a&&new r(this,a)});w(y.prototype,"getAllItems",function(b){var a=[],d=this.chart.colorAxis[0];d&&(d.options.dataClasses?a=a.concat(d.getDataClassLegendSymbols()):a.push(d),k(d.series,function(a){a.options.showInLegend=!1}));return a.concat(b.call(this))});
|
||||
g={pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",dashstyle:"dashStyle"},pointArrayMap:["value"],axisTypes:["xAxis","yAxis","colorAxis"],optionalAxis:"colorAxis",trackerGroups:["group","markerGroup","dataLabelsGroup"],getSymbol:n,parallelArrays:["x","y","value"],translateColors:function(){var b=this,a=this.options.nullColor,d=this.colorAxis;k(this.data,function(c){var e=c.value;if(e=e===null?a:d?d.toColor(e,c):c.color||b.color)c.color=e})}};u.plotOptions.heatmap=
|
||||
l(u.plotOptions.scatter,{animation:!1,borderWidth:0,nullColor:"#F8F8F8",dataLabels:{format:"{point.value}",verticalAlign:"middle",crop:!1,overflow:!1,style:{color:"white",fontWeight:"bold",textShadow:"0 0 5px black"}},marker:null,tooltip:{pointFormat:"{point.x}, {point.y}: {point.value}<br/>"},states:{normal:{animation:!0},hover:{brightness:0.2}}});m.heatmap=z(m.scatter,l(g,{type:"heatmap",pointArrayMap:["y","value"],hasPointSpecificOptions:!0,supportsDrilldown:!0,getExtremesFromAll:!0,init:function(){m.scatter.prototype.init.apply(this,
|
||||
arguments);this.pointRange=this.options.colsize||1;this.yAxis.axisPointRange=this.options.rowsize||1},translate:function(){var b=this.options,a=this.xAxis,d=this.yAxis;this.generatePoints();k(this.points,function(c){var e=(b.colsize||1)/2,h=(b.rowsize||1)/2,f=Math.round(a.len-a.translate(c.x-e,0,1,0,1)),e=Math.round(a.len-a.translate(c.x+e,0,1,0,1)),g=Math.round(d.translate(c.y-h,0,1,0,1)),h=Math.round(d.translate(c.y+h,0,1,0,1));c.plotX=(f+e)/2;c.plotY=(g+h)/2;c.shapeType="rect";c.shapeArgs={x:Math.min(f,
|
||||
e),y:Math.min(g,h),width:Math.abs(e-f),height:Math.abs(h-g)}});this.translateColors()},drawPoints:m.column.prototype.drawPoints,animate:n,getBox:n,drawLegendSymbol:s.drawRectangle,getExtremes:function(){t.prototype.getExtremes.call(this,this.valueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;t.prototype.getExtremes.call(this)}}))})(Highcharts);
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
Highstock JS v2.0.1 (2014-04-24)
|
||||
Plugin for displaying a message when there is no data visible in chart.
|
||||
|
||||
(c) 2010-2014 Highsoft AS
|
||||
Author: Oystein Moseng
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(c){function f(){return!!this.points.length}function g(){this.hasData()?this.hideNoData():this.showNoData()}var d=c.seriesTypes,e=c.Chart.prototype,h=c.getOptions(),i=c.extend;i(h.lang,{noData:"No data to display"});h.noData={position:{x:0,y:0,align:"center",verticalAlign:"middle"},attr:{},style:{fontWeight:"bold",fontSize:"12px",color:"#60606a"}};if(d.pie)d.pie.prototype.hasData=f;if(d.gauge)d.gauge.prototype.hasData=f;if(d.waterfall)d.waterfall.prototype.hasData=f;c.Series.prototype.hasData=
|
||||
function(){return this.dataMax!==void 0&&this.dataMin!==void 0};e.showNoData=function(a){var b=this.options,a=a||b.lang.noData,b=b.noData;if(!this.noDataLabel)this.noDataLabel=this.renderer.label(a,0,0,null,null,null,null,null,"no-data").attr(b.attr).css(b.style).add(),this.noDataLabel.align(i(this.noDataLabel.getBBox(),b.position),!1,"plotBox")};e.hideNoData=function(){if(this.noDataLabel)this.noDataLabel=this.noDataLabel.destroy()};e.hasData=function(){for(var a=this.series,b=a.length;b--;)if(a[b].hasData()&&
|
||||
!a[b].options.isInternal)return!0;return!1};e.callbacks.push(function(a){c.addEvent(a,"load",g);c.addEvent(a,"redraw",g)})})(Highcharts);
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
Highstock JS v2.0.1 (2014-04-24)
|
||||
Solid angular gauge module
|
||||
|
||||
(c) 2010-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(a){var l=a.getOptions().plotOptions,o=a.pInt,p=a.pick,j=a.each,m;l.solidgauge=a.merge(l.gauge,{colorByPoint:!0});m={initDataClasses:function(b){var h=this,e=this.chart,c,k=0,f=this.options;this.dataClasses=c=[];j(b.dataClasses,function(g,d){var i,g=a.merge(g);c.push(g);if(!g.color)f.dataClassColor==="category"?(i=e.options.colors,g.color=i[k++],k===i.length&&(k=0)):g.color=h.tweenColors(a.Color(f.minColor),a.Color(f.maxColor),d/(b.dataClasses.length-1))})},initStops:function(b){this.stops=
|
||||
b.stops||[[0,this.options.minColor],[1,this.options.maxColor]];j(this.stops,function(b){b.color=a.Color(b[1])})},toColor:function(b,h){var e,c=this.stops,a,f=this.dataClasses,g,d;if(f)for(d=f.length;d--;){if(g=f[d],a=g.from,c=g.to,(a===void 0||b>=a)&&(c===void 0||b<=c)){e=g.color;if(h)h.dataClass=d;break}}else{this.isLog&&(b=this.val2lin(b));e=1-(this.max-b)/(this.max-this.min);for(d=c.length;d--;)if(e>c[d][0])break;a=c[d]||c[d+1];c=c[d+1]||a;e=1-(c[0]-e)/(c[0]-a[0]||1);e=this.tweenColors(a.color,
|
||||
c.color,e)}return e},tweenColors:function(b,a,e){var c=a.rgba[3]!==1||b.rgba[3]!==1;return b.rgba.length===0||a.rgba.length===0?"none":(c?"rgba(":"rgb(")+Math.round(a.rgba[0]+(b.rgba[0]-a.rgba[0])*(1-e))+","+Math.round(a.rgba[1]+(b.rgba[1]-a.rgba[1])*(1-e))+","+Math.round(a.rgba[2]+(b.rgba[2]-a.rgba[2])*(1-e))+(c?","+(a.rgba[3]+(b.rgba[3]-a.rgba[3])*(1-e)):"")+")"}};a.seriesTypes.solidgauge=a.extendClass(a.seriesTypes.gauge,{type:"solidgauge",bindAxes:function(){var b;a.seriesTypes.gauge.prototype.bindAxes.call(this);
|
||||
b=this.yAxis;a.extend(b,m);b.options.dataClasses&&b.initDataClasses(b.options);b.initStops(b.options)},drawPoints:function(){var b=this,h=b.yAxis,e=h.center,c=b.options,k=b.chart.renderer;a.each(b.points,function(f){var g=f.graphic,d=h.startAngleRad+h.translate(f.y,null,null,null,!0),i=o(p(c.radius,100))*e[2]/200,l=o(p(c.innerRadius,60))*e[2]/200,n=h.toColor(f.y,f),j;if(n!=="none")j=f.color,f.color=n;c.wrap===!1&&(d=Math.max(h.startAngleRad,Math.min(h.endAngleRad,d)));d=d*180/Math.PI;d={x:e[0],y:e[1],
|
||||
r:i,innerR:l,start:h.startAngleRad,end:d/(180/Math.PI)};g?(i=d.d,g.attr({fill:f.color}).animate(d,{step:function(b,c){g.attr("fill",m.tweenColors(a.Color(j),a.Color(n),c.pos))}}),d.d=i):f.graphic=k.arc(d).attr({stroke:c.borderColor||"none","stroke-width":c.borderWidth||0,fill:f.color}).add(b.group)})},animate:null})})(Highcharts);
|
|
@ -0,0 +1,254 @@
|
|||
/**
|
||||
* Dark blue theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#DDDF0D", "#55BF3B", "#DF5353", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 },
|
||||
stops: [
|
||||
[0, 'rgb(48, 48, 96)'],
|
||||
[1, 'rgb(0, 0, 0)']
|
||||
]
|
||||
},
|
||||
borderColor: '#000000',
|
||||
borderWidth: 2,
|
||||
className: 'dark-container',
|
||||
plotBackgroundColor: 'rgba(255, 255, 255, .1)',
|
||||
plotBorderColor: '#CCCCCC',
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#C0C0C0',
|
||||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#666666',
|
||||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineColor: '#333333',
|
||||
gridLineWidth: 1,
|
||||
labels: {
|
||||
style: {
|
||||
color: '#A0A0A0'
|
||||
}
|
||||
},
|
||||
lineColor: '#A0A0A0',
|
||||
tickColor: '#A0A0A0',
|
||||
title: {
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
gridLineColor: '#333333',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#A0A0A0'
|
||||
}
|
||||
},
|
||||
lineColor: '#A0A0A0',
|
||||
minorTickInterval: null,
|
||||
tickColor: '#A0A0A0',
|
||||
tickWidth: 1,
|
||||
title: {
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.75)',
|
||||
style: {
|
||||
color: '#F0F0F0'
|
||||
}
|
||||
},
|
||||
toolbar: {
|
||||
itemStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
line: {
|
||||
dataLabels: {
|
||||
color: '#CCC'
|
||||
},
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
spline: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
scatter: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: 'white'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: '#A0A0A0'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#FFF'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: '#444'
|
||||
}
|
||||
},
|
||||
credits: {
|
||||
style: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#CCC'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
symbolStroke: '#DDDDDD',
|
||||
hoverSymbolStroke: '#FFFFFF',
|
||||
theme: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#606060'],
|
||||
[0.6, '#333333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// scroll charts
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
states: {
|
||||
hover: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#BBB'],
|
||||
[0.6, '#888']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.1, '#000'],
|
||||
[0.3, '#333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'yellow'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
inputStyle: {
|
||||
backgroundColor: '#333',
|
||||
color: 'silver'
|
||||
},
|
||||
labelStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
|
||||
navigator: {
|
||||
handles: {
|
||||
backgroundColor: '#666',
|
||||
borderColor: '#AAA'
|
||||
},
|
||||
outlineColor: '#CCC',
|
||||
maskFill: 'rgba(16, 16, 16, 0.5)',
|
||||
series: {
|
||||
color: '#7798BF',
|
||||
lineColor: '#A6C7ED'
|
||||
}
|
||||
},
|
||||
|
||||
scrollbar: {
|
||||
barBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
barBorderColor: '#CCC',
|
||||
buttonArrowColor: '#CCC',
|
||||
buttonBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
buttonBorderColor: '#CCC',
|
||||
rifleColor: '#FFF',
|
||||
trackBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0, '#000'],
|
||||
[1, '#333']
|
||||
]
|
||||
},
|
||||
trackBorderColor: '#666'
|
||||
},
|
||||
|
||||
// special colors for some of the
|
||||
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)',
|
||||
background2: 'rgb(35, 35, 70)',
|
||||
dataLabelsColor: '#444',
|
||||
textColor: '#C0C0C0',
|
||||
maskColor: 'rgba(255,255,255,0.3)'
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
|
@ -0,0 +1,255 @@
|
|||
/**
|
||||
* Dark blue theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#DDDF0D", "#55BF3B", "#DF5353", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: [0, 0, 250, 500],
|
||||
stops: [
|
||||
[0, 'rgb(48, 96, 48)'],
|
||||
[1, 'rgb(0, 0, 0)']
|
||||
]
|
||||
},
|
||||
borderColor: '#000000',
|
||||
borderWidth: 2,
|
||||
className: 'dark-container',
|
||||
plotBackgroundColor: 'rgba(255, 255, 255, .1)',
|
||||
plotBorderColor: '#CCCCCC',
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#C0C0C0',
|
||||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#666666',
|
||||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineColor: '#333333',
|
||||
gridLineWidth: 1,
|
||||
labels: {
|
||||
style: {
|
||||
color: '#A0A0A0'
|
||||
}
|
||||
},
|
||||
lineColor: '#A0A0A0',
|
||||
tickColor: '#A0A0A0',
|
||||
title: {
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
gridLineColor: '#333333',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#A0A0A0'
|
||||
}
|
||||
},
|
||||
lineColor: '#A0A0A0',
|
||||
minorTickInterval: null,
|
||||
tickColor: '#A0A0A0',
|
||||
tickWidth: 1,
|
||||
title: {
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.75)',
|
||||
style: {
|
||||
color: '#F0F0F0'
|
||||
}
|
||||
},
|
||||
toolbar: {
|
||||
itemStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
line: {
|
||||
dataLabels: {
|
||||
color: '#CCC'
|
||||
},
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
spline: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
scatter: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: 'white'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: '#A0A0A0'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#FFF'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: '#444'
|
||||
}
|
||||
},
|
||||
credits: {
|
||||
style: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#CCC'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
symbolStroke: '#DDDDDD',
|
||||
hoverSymbolStroke: '#FFFFFF',
|
||||
theme: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#606060'],
|
||||
[0.6, '#333333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// scroll charts
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
states: {
|
||||
hover: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#BBB'],
|
||||
[0.6, '#888']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.1, '#000'],
|
||||
[0.3, '#333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'yellow'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
inputStyle: {
|
||||
backgroundColor: '#333',
|
||||
color: 'silver'
|
||||
},
|
||||
labelStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
|
||||
navigator: {
|
||||
handles: {
|
||||
backgroundColor: '#666',
|
||||
borderColor: '#AAA'
|
||||
},
|
||||
outlineColor: '#CCC',
|
||||
maskFill: 'rgba(16, 16, 16, 0.5)',
|
||||
series: {
|
||||
color: '#7798BF',
|
||||
lineColor: '#A6C7ED'
|
||||
}
|
||||
},
|
||||
|
||||
scrollbar: {
|
||||
barBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
barBorderColor: '#CCC',
|
||||
buttonArrowColor: '#CCC',
|
||||
buttonBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
buttonBorderColor: '#CCC',
|
||||
rifleColor: '#FFF',
|
||||
trackBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0, '#000'],
|
||||
[1, '#333']
|
||||
]
|
||||
},
|
||||
trackBorderColor: '#666'
|
||||
},
|
||||
|
||||
// special colors for some of the
|
||||
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)',
|
||||
background2: 'rgb(35, 35, 70)',
|
||||
dataLabelsColor: '#444',
|
||||
textColor: '#C0C0C0',
|
||||
maskColor: 'rgba(255,255,255,0.3)'
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
|
@ -0,0 +1,213 @@
|
|||
/**
|
||||
* Dark theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
// Load the fonts
|
||||
Highcharts.createElement('link', {
|
||||
href: 'http://fonts.googleapis.com/css?family=Unica+One',
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css'
|
||||
}, null, document.getElementsByTagName('head')[0]);
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#2b908f", "#90ee7e", "#f45b5b", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 },
|
||||
stops: [
|
||||
[0, '#2a2a2b'],
|
||||
[1, '#3e3e40']
|
||||
]
|
||||
},
|
||||
style: {
|
||||
fontFamily: "'Unica One', sans-serif"
|
||||
},
|
||||
plotBorderColor: '#606063'
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#E0E0E3',
|
||||
textTransform: 'uppercase',
|
||||
fontSize: '20px'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#E0E0E3',
|
||||
textTransform: 'uppercase'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineColor: '#707073',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#E0E0E3'
|
||||
}
|
||||
},
|
||||
lineColor: '#707073',
|
||||
minorGridLineColor: '#505053',
|
||||
tickColor: '#707073',
|
||||
title: {
|
||||
style: {
|
||||
color: '#A0A0A3'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
gridLineColor: '#707073',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#E0E0E3'
|
||||
}
|
||||
},
|
||||
lineColor: '#707073',
|
||||
minorGridLineColor: '#505053',
|
||||
tickColor: '#707073',
|
||||
tickWidth: 1,
|
||||
title: {
|
||||
style: {
|
||||
color: '#A0A0A3'
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.85)',
|
||||
style: {
|
||||
color: '#F0F0F0'
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
series: {
|
||||
dataLabels: {
|
||||
color: '#B0B0B3'
|
||||
},
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
boxplot: {
|
||||
fillColor: '#505053'
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: 'white'
|
||||
},
|
||||
errorbar: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
color: '#E0E0E3'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#FFF'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: '#606063'
|
||||
}
|
||||
},
|
||||
credits: {
|
||||
style: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#707073'
|
||||
}
|
||||
},
|
||||
|
||||
drilldown: {
|
||||
activeAxisLabelStyle: {
|
||||
color: '#F0F0F3'
|
||||
},
|
||||
activeDataLabelStyle: {
|
||||
color: '#F0F0F3'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
symbolStroke: '#DDDDDD',
|
||||
theme: {
|
||||
fill: '#505053'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// scroll charts
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: '#505053',
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: '#CCC'
|
||||
},
|
||||
states: {
|
||||
hover: {
|
||||
fill: '#707073',
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
fill: '#000003',
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
inputBoxBorderColor: '#505053',
|
||||
inputStyle: {
|
||||
backgroundColor: '#333',
|
||||
color: 'silver'
|
||||
},
|
||||
labelStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
|
||||
navigator: {
|
||||
handles: {
|
||||
backgroundColor: '#666',
|
||||
borderColor: '#AAA'
|
||||
},
|
||||
outlineColor: '#CCC',
|
||||
maskFill: 'rgba(255,255,255,0.1)',
|
||||
series: {
|
||||
color: '#7798BF',
|
||||
lineColor: '#A6C7ED'
|
||||
},
|
||||
xAxis: {
|
||||
gridLineColor: '#505053'
|
||||
}
|
||||
},
|
||||
|
||||
scrollbar: {
|
||||
barBackgroundColor: '#808083',
|
||||
barBorderColor: '#808083',
|
||||
buttonArrowColor: '#CCC',
|
||||
buttonBackgroundColor: '#606063',
|
||||
buttonBorderColor: '#606063',
|
||||
rifleColor: '#FFF',
|
||||
trackBackgroundColor: '#404043',
|
||||
trackBorderColor: '#404043'
|
||||
},
|
||||
|
||||
// special colors for some of the
|
||||
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)',
|
||||
background2: '#505053',
|
||||
dataLabelsColor: '#B0B0B3',
|
||||
textColor: '#C0C0C0',
|
||||
contrastTextColor: '#F0F0F3',
|
||||
maskColor: 'rgba(255,255,255,0.3)'
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
Highcharts.setOptions(Highcharts.theme);
|
|
@ -0,0 +1,257 @@
|
|||
/**
|
||||
* Gray theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#DDDF0D", "#7798BF", "#55BF3B", "#DF5353", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0, 'rgb(96, 96, 96)'],
|
||||
[1, 'rgb(16, 16, 16)']
|
||||
]
|
||||
},
|
||||
borderWidth: 0,
|
||||
borderRadius: 0,
|
||||
plotBackgroundColor: null,
|
||||
plotShadow: false,
|
||||
plotBorderWidth: 0
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#FFF',
|
||||
font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#DDD',
|
||||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 0,
|
||||
lineColor: '#999',
|
||||
tickColor: '#999',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#999',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#AAA',
|
||||
font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
alternateGridColor: null,
|
||||
minorTickInterval: null,
|
||||
gridLineColor: 'rgba(255, 255, 255, .1)',
|
||||
minorGridLineColor: 'rgba(255,255,255,0.07)',
|
||||
lineWidth: 0,
|
||||
tickWidth: 0,
|
||||
labels: {
|
||||
style: {
|
||||
color: '#999',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#AAA',
|
||||
font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
color: '#CCC'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#FFF'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: '#333'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#CCC'
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0, 'rgba(96, 96, 96, .8)'],
|
||||
[1, 'rgba(16, 16, 16, .8)']
|
||||
]
|
||||
},
|
||||
borderWidth: 0,
|
||||
style: {
|
||||
color: '#FFF'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
plotOptions: {
|
||||
series: {
|
||||
nullColor: '#444444'
|
||||
},
|
||||
line: {
|
||||
dataLabels: {
|
||||
color: '#CCC'
|
||||
},
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
spline: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
scatter: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: 'white'
|
||||
}
|
||||
},
|
||||
|
||||
toolbar: {
|
||||
itemStyle: {
|
||||
color: '#CCC'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
symbolStroke: '#DDDDDD',
|
||||
hoverSymbolStroke: '#FFFFFF',
|
||||
theme: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#606060'],
|
||||
[0.6, '#333333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// scroll charts
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
states: {
|
||||
hover: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#BBB'],
|
||||
[0.6, '#888']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.1, '#000'],
|
||||
[0.3, '#333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'yellow'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
inputStyle: {
|
||||
backgroundColor: '#333',
|
||||
color: 'silver'
|
||||
},
|
||||
labelStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
|
||||
navigator: {
|
||||
handles: {
|
||||
backgroundColor: '#666',
|
||||
borderColor: '#AAA'
|
||||
},
|
||||
outlineColor: '#CCC',
|
||||
maskFill: 'rgba(16, 16, 16, 0.5)',
|
||||
series: {
|
||||
color: '#7798BF',
|
||||
lineColor: '#A6C7ED'
|
||||
}
|
||||
},
|
||||
|
||||
scrollbar: {
|
||||
barBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
barBorderColor: '#CCC',
|
||||
buttonArrowColor: '#CCC',
|
||||
buttonBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
buttonBorderColor: '#CCC',
|
||||
rifleColor: '#FFF',
|
||||
trackBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0, '#000'],
|
||||
[1, '#333']
|
||||
]
|
||||
},
|
||||
trackBorderColor: '#666'
|
||||
},
|
||||
|
||||
// special colors for some of the demo examples
|
||||
legendBackgroundColor: 'rgba(48, 48, 48, 0.8)',
|
||||
background2: 'rgb(70, 70, 70)',
|
||||
dataLabelsColor: '#444',
|
||||
textColor: '#E0E0E0',
|
||||
maskColor: 'rgba(255,255,255,0.3)'
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
|
@ -0,0 +1,74 @@
|
|||
/**
|
||||
* Grid-light theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
// Load the fonts
|
||||
Highcharts.createElement('link', {
|
||||
href: 'http://fonts.googleapis.com/css?family=Dosis:400,600',
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css'
|
||||
}, null, document.getElementsByTagName('head')[0]);
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#7cb5ec", "#f7a35c", "#90ee7e", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: null,
|
||||
style: {
|
||||
fontFamily: "Dosis, sans-serif"
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
fontSize: '16px',
|
||||
fontWeight: 'bold',
|
||||
textTransform: 'uppercase'
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
borderWidth: 0,
|
||||
backgroundColor: 'rgba(219,219,216,0.8)',
|
||||
shadow: false
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
fontWeight: 'bold',
|
||||
fontSize: '13px'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 1,
|
||||
labels: {
|
||||
style: {
|
||||
fontSize: '12px'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
minorTickInterval: 'auto',
|
||||
title: {
|
||||
style: {
|
||||
textTransform: 'uppercase'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
fontSize: '12px'
|
||||
}
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
candlestick: {
|
||||
lineColor: '#404048'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// General
|
||||
background2: '#F0F0EA'
|
||||
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
Highcharts.setOptions(Highcharts.theme);
|
|
@ -0,0 +1,103 @@
|
|||
/**
|
||||
* Grid theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 },
|
||||
stops: [
|
||||
[0, 'rgb(255, 255, 255)'],
|
||||
[1, 'rgb(240, 240, 255)']
|
||||
]
|
||||
},
|
||||
borderWidth: 2,
|
||||
plotBackgroundColor: 'rgba(255, 255, 255, .9)',
|
||||
plotShadow: true,
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#666666',
|
||||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 1,
|
||||
lineColor: '#000',
|
||||
tickColor: '#000',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: '11px Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#333',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
minorTickInterval: 'auto',
|
||||
lineColor: '#000',
|
||||
lineWidth: 1,
|
||||
tickWidth: 1,
|
||||
tickColor: '#000',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: '11px Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#333',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: 'black'
|
||||
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#039'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: 'gray'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#99b'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
theme: {
|
||||
stroke: '#CCCCCC'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
|
@ -0,0 +1,101 @@
|
|||
/**
|
||||
* Sand-Signika theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
// Load the fonts
|
||||
Highcharts.createElement('link', {
|
||||
href: 'http://fonts.googleapis.com/css?family=Signika:400,700',
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css'
|
||||
}, null, document.getElementsByTagName('head')[0]);
|
||||
|
||||
// Add the background image to the container
|
||||
Highcharts.wrap(Highcharts.Chart.prototype, 'getContainer', function (proceed) {
|
||||
proceed.call(this);
|
||||
this.container.style.background = 'url(http://www.highcharts.com/samples/graphics/sand.png)';
|
||||
});
|
||||
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#f45b5b", "#8085e9", "#8d4654", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: null,
|
||||
style: {
|
||||
fontFamily: "Signika, serif"
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: 'black',
|
||||
fontSize: '16px',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: 'black'
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
borderWidth: 0
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
fontWeight: 'bold',
|
||||
fontSize: '13px'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
labels: {
|
||||
style: {
|
||||
color: '#6e6e70'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
labels: {
|
||||
style: {
|
||||
color: '#6e6e70'
|
||||
}
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
series: {
|
||||
shadow: true
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: '#404048'
|
||||
}
|
||||
},
|
||||
|
||||
// Highstock specific
|
||||
navigator: {
|
||||
xAxis: {
|
||||
gridLineColor: '#D0D0D8'
|
||||
}
|
||||
},
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: 'white',
|
||||
stroke: '#C0C0C8',
|
||||
'stroke-width': 1,
|
||||
states: {
|
||||
select: {
|
||||
fill: '#D0D0D8'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
scrollbar: {
|
||||
trackBorderColor: '#C0C0C8'
|
||||
},
|
||||
|
||||
// General
|
||||
background2: '#E0E0E8'
|
||||
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
Highcharts.setOptions(Highcharts.theme);
|
|
@ -0,0 +1,89 @@
|
|||
/**
|
||||
* Skies theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#514F78", "#42A07B", "#9B5E4A", "#72727F", "#1F949A", "#82914E", "#86777F", "#42A07B"],
|
||||
chart: {
|
||||
className: 'skies',
|
||||
borderWidth: 0,
|
||||
plotShadow: true,
|
||||
plotBackgroundImage: 'http://www.highcharts.com/demo/gfx/skies.jpg',
|
||||
plotBackgroundColor: {
|
||||
linearGradient: [0, 0, 250, 500],
|
||||
stops: [
|
||||
[0, 'rgba(255, 255, 255, 1)'],
|
||||
[1, 'rgba(255, 255, 255, 0)']
|
||||
]
|
||||
},
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#3E576F',
|
||||
font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#6D869F',
|
||||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 0,
|
||||
lineColor: '#C0D0E0',
|
||||
tickColor: '#C0D0E0',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#666',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#666',
|
||||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
alternateGridColor: 'rgba(255, 255, 255, .5)',
|
||||
lineColor: '#C0D0E0',
|
||||
tickColor: '#C0D0E0',
|
||||
tickWidth: 1,
|
||||
labels: {
|
||||
style: {
|
||||
color: '#666',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#666',
|
||||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: '#3E576F'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: 'black'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#3E576F'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
Loading…
Reference in New Issue