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 on Jun 11

sorry, how do I do that? thanks

KoolReport Is Free and Open-Source!

KoolReport is a professional php reporting framework which saves you tons of time to construct dynamic data report & dashboard.

  • Connect to various datasources such as MySQL, SQL Server, MongoDB or even from CSV or Excel file.
  • Contain series of powerful built-in data processes for your data manipulation.
  • Generate stunning charts and graphs to help you communicate data insights to your audiences effectively.
  • Integrate seamlessly with any php frameworks such as Laravel, CodeIgniter, Symfony.
Download Now and register our tutorials to get started!

Download KoolReport
help needed

None