小编Cat*_*tEr的帖子

Highcharts饼图可以有url链接

我在我的应用程序中使用Highcharts饼图,其中饼图的数据是从数据库填充的.我的问题是在填充饼图后,如果我点击某个区域它应该呈现给特定的php页面.可能吗?

这是我的代码:

    function open_risk_level_pie()
    {
    $chart = new Highchart();

    $chart->chart->renderTo = "open_risk_level_pie";
    $chart->chart->plotBackgroundColor = null;
    $chart->chart->plotBorderWidth = null;
    $chart->chart->plotShadow = false;
    $chart->title->text = "Risk Level";

    $chart->tooltip->formatter = new HighchartJsExpr("function() {
    return '<b>'+ this.point.name +'</b>: '+ this.point.y; }");

    $chart->plotOptions->pie->allowPointSelect = 1;
    $chart->plotOptions->pie->cursor = "pointer";
    $chart->plotOptions->pie->dataLabels->enabled = false;
    $chart->plotOptions->pie->showInLegend = 1;
    $chart->plotOptions->pie->colors = array('red', 'orange', 'yellow', 'black');
    $chart->credits->enabled = false;

    // Open the database connection
    $db = db_open();

// Get the risk levels
$stmt = $db->prepare("SELECT * from `risk_levels`");
$stmt->execute();
$array = …
Run Code Online (Sandbox Code Playgroud)

javascript php jquery charts highcharts

4
推荐指数
1
解决办法
2747
查看次数

标签 统计

charts ×1

highcharts ×1

javascript ×1

jquery ×1

php ×1