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 - 6 comments

paulo commented on Apr 15

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

You do this:

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

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

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

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

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

paulo commented 7 days ago

sorry, how do I do that? thanks

Give tips to supporter for his good work

If you feel that supporter has done a good work, consider giving him some credit. Any amount put into the tips box below is appreciated. By doing so, you have contribtuted to the existence of KoolReport and the quality of support.

Tips box
help needed

None