コード例 #1
0
ファイル: HighchartTest.php プロジェクト: mrtos/OpenNVR
 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
0
                                        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
0
ファイル: donut_chart.php プロジェクト: mrtos/OpenNVR
<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
                });