KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

Timelines + ToolTip #806

Open paulo opened this topic on on Apr 15, 2019 - 6 comments

paulo commented on Apr 15, 2019

Hi, I am trying to customize my Google Timeline Chart to show the full date when mousing over / tooltip of the chart. On google, this is possible by adding a row. How can I translate this to KolReports?

Google: dataTable.addColumn({ type: 'string', role: 'tooltip' }); https://developers.google.com/chart/interactive/docs/gallery/timeline#customizing-tooltips

thank you

KoolReport commented on Apr 15, 2019

You do this:

ColumChart::create(array(
    ...
    "columns"=>array(
        "myColumn"=>array(
            "tooltip"=>function($row){
                return "Something for tooltip";
            }
        )
    )
))
paulo commented on Apr 15, 2019

thanks, I tried your basic example and it didn't show anything

        "columns"=>array(
            "tourname",
            "startDate"=>array(
                "type"=>"date",
                "tooltip"=>function($row){
                    return "Something for tooltip";
                }
            ),
            "endDate"=>array(
                "type"=>"date",
            ),

Am I placing this in the right location?

KoolReport commented on Apr 16, 2019

Please try this:

In the setup() function, you try to create a dummy column like this:

->pipe(new CalculatedColumn(array(
    "barlabel"=>"0",
    "tooltip"=>"0",
))
->pipe($this->dataStore("timeline"));

Now in the Timeline, you do:

        "dataSource"=>$this->dataStore("timeline"),
        "columns"=>array(
            "tourname",
            "barlabel",
            "tooltip"=>array(
                "tooltip"=>function($row)
                {
                    return "Some tooltip";
                }
            )
            "startDate"=>array(
                "type"=>"date",
                "tooltip"=>function($row){
                    return "Something for tooltip";
                }
            ),
            "endDate"=>array(
                "type"=>"date",
            ),
paulo commented on Apr 22, 2019

Hi, thanks for you response. When I do this, I get: ErrorException (E_ERROR) Class 'CJSON' not found (View: C:\dev-test\laravel\resources\views\report.blade.php) Previous exceptions Class 'CJSON' not found

on the line: echo CJSON::encode(array(

KoolReport commented on Apr 23, 2019

Please help to change CJSON::encode to json_encode()

paulo commented on Jun 11, 2019

sorry, how do I do that? thanks

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

None