本文整理汇总了PHP中Highchart::renderOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Highchart::renderOptions方法的具体用法?PHP Highchart::renderOptions怎么用?PHP Highchart::renderOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Highchart
的用法示例。
在下文中一共展示了Highchart::renderOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRenderOptionsEncoding
public function testRenderOptionsEncoding()
{
//Check for encoding problems
$chart = new Highchart();
$chart->test->utf8String = "áù anything ü";
$chart->test->iso88591 = iconv("UTF-8", "ISO-8859-1", "áù anything ü");
$result = $chart->renderOptions();
$this->assertEquals('{"test":{"utf8String":"\\u00e1\\u00f9 anything \\u00fc","iso88591":"\\u00e1\\u00f9 anything \\u00fc"}}', $result);
}
示例2:
name: this.innerHTML,
data: []
};
} else { // add values
options.series[j - 1].data.push(parseFloat(this.innerHTML));
}
}
});
});
var chart = new Highcharts.Chart(options);
}
var table = document.getElementById('datatable'),
options = <?php
echo $chart->renderOptions();
?>
;
Highcharts.visualize(table, options);
});
</script>
<table id="datatable">
<thead>
<tr>
<th></th>
<th>Jane</th>
<th>John</th>
</tr>
</thead>
<tbody>
<tr>
示例3:
<html>
<head>
<title>Donut chart</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
$chart->printScripts();
?>
</head>
<body>
<div id="container"></div>
<script type="text/javascript">
var colors = Highcharts.getOptions().colors,
categories = ['MSIE', 'Firefox', 'Chrome', 'Safari', 'Opera'],
name = 'Browser brands',
data = <?php
echo $chartData->renderOptions();
?>
;
// Build the data arrays
var browserData = [];
var versionsData = [];
for (var i = 0; i < data.length; i++) {
// add browser data
browserData.push({
name: categories[i],
y: data[i].y,
color: data[i].color
});