Skip to content

to add tooltip method #19

@kan0p

Description

@kan0p

just in case to add tooltip method
in ChartPresenter file ...vendor\muhamadrezaar\highcharts\src\Classes\Presenters
add

public $tooltip;
public function tooltip($tooltip=[])
{
$this->transform->tooltip=$tooltip;
return $this;
}

in JsTransformerPresenter file
...\vendor\muhamadrezaar\highcharts\src\Classes\Presenters
add

 public $tooltip=[];
 public function encode_tooltip()
 {
     $data = $this->tooltip;
     $this->tooltip = !empty($data) ? 'tooltip: '.json_encode($data).',' : null;
     return $this;
 }

edit this method

public function transform()
{
...
$this->encode_tooltip(); //add this line
$this->credits();

and add to $allString

     $allString = $this->title.
     $this->tooltip.   

in your controller

->tooltip([ 'formatter'=> "startJs:function(){return '' + this.x + '
' + this.series.name + '
' + 'Valor:'+this.y + '
' + 'Total: ' + this.point.stackTotal }:endJs",
])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions