获取用于渲染图表的确切highcharts数据

时间:2016-11-10 05:54:21

标签: highcharts

High Charts中是否有任何方法可以获取用于渲染图表的确切数据? 我已经尝试过使用"选项"但它返回整个JSON结构。我只需要用于渲染图表的数据。

{
    "chart": {
        "marginRight": 80
    },
    "xAxis": {
        "categories": [
            "Jan",
            "Feb"
        ],
        "title": {
            "text": "xAxisName"
        }
    },
    "series": [
        {
            "data": [
                29.9,
                71.5
            ]
        },
        {
            "data": [
                144,
                176
            ]
        }
    ]
}

例如,如果我使用上面的对象渲染了图表,我需要在图表渲染后检索相同的对象。

1 个答案:

答案 0 :(得分:1)

您可以通过<template name="adminNav"> <nav class="navbar-default navbar-static-side" role="navigation"> <div class="sidebar-collapse"> <!-- Close canvas menu used only on OffCanvas page --> <!-- You can remove this tag if you dont use offCanvas menu --> <a class="close-canvas-menu"><i class="fa fa-times"></i></a> <!-- End offCanvas menu toggle --> <ul class="nav metismenu" id="side-menu"> <li class="nav-header"> <div class="dropdown profile-element"> <span> <img alt="image" class="img-circle" src="{{currentUser.profile.picture}}" width="48" height="48"/> </span> <a data-toggle="dropdown" class="dropdown-toggle" href="#"> <span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">{{currentUser.profile.name}}</strong> </span> <span class="text-muted text-xs block">{{currentUser.accountType}} <b class="caret"></b></span> </span> </a> <ul class="dropdown-menu animated fadeInRight m-t-xs"> <li><a href="{{pathFor route='profile'}}">Profile</a></li> <li><a href="{{pathFor route='mailbox'}}">Mailbox</a></li> <li class="divider"></li> <li><a href="{{pathFor route='login'}}">Logout</a></li> </ul> </div> <div class="logo-element"> X </div> </li> <li class="{{isActiveRoute regex='/'}}"> <a href="{{pathFor route='dashboard'}}"><i class="fa fa-th-large"></i> <span class="nav-label">Dashboard</span> </a> </li> <!-- Here is the collapsible part of the navigation --> <li class="{{isActiveRoute regex='manage|manage-alerts'}}"> <a href="#"><i class="fa fa-gears"></i> <span class="nav-label">Manage</span><span class="fa arrow"></span></a> <ul class="nav nav-second-level collapse {{isActiveRoute regex='manage|manage-alerts' className='in'}}"> <li class="{{isActiveRoute regex='manage'}}"><a href="{{pathFor route='manage'}}"><i class="fa fa-users"></i> Users</a></li> <li class="{{isActiveRoute regex='manage-alerts'}}"><a href="{{pathFor route='manage-alerts'}}"><i class="fa fa-bell"></i> Alerts</a></li> </ul> </li> </ul> </div> </nav> </template> 获取这些选项。

http://jsfiddle.net/zd3q8t2L/