KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

ComboChart - combined tooltip for all data series #363

Open Jure Zakrajsek opened this topic on on Jul 11, 2018 - 1 comments

Jure Zakrajsek commented on Jul 11, 2018

I created a nice report with a ChartJS using a ComboChart.

Is there a way to get a tooltip to display all dataseries at the same label.

Like this example:

http://www.chartjs.org/samples/latest/charts/combo-bar-line.html

Tooltips on my page show only the data values for the point that I hover over.

Thx for advice Jure

KoolReport commented on Jul 11, 2018

Hope that you are able to download new version of ChartJS that I sent to you through email. Please following below code to make the effect that you want:

<?php
ColumnChart::create(array(
    "title"=>"Sale Report",
    "dataSource"=>$category_amount,
    "columns"=>array(
        "category",
        "sale"=>array(
            "label"=>"Sale",
            "type"=>"number",
            "prefix"=>"$"
        ),
        "cost"=>array(
            "label"=>"Cost",
            "type"=>"number",
            "prefix"=>"$"
        ),
        "profit"=>array(
            "label"=>"Profit",
            "type"=>"number",
            "prefix"=>"$",
            "config"=>array(
                "type"=>"line",
                "borderWidth"=>3,
            )
        ),
    ),
    "options"=>array(
        "tooltips"=>array(
            "mode"=>"index",
            "intersect"=>true,
        )
    )
));
?>

Please pay attention to the tooltips in options

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

ChartJS