KoolReport's Forum

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

Gauge options? #2581

Closed Dennis Spanogle opened this topic on on Feb 17, 2022 - 4 comments

Dennis Spanogle commented on Feb 17, 2022

I have my Google Gauge working but would like to change the range.
The default is 0 to 100. I would like different lower and upper range E.G. -15 to 115 for temperature gauge.

How do I set the bottom and top ranges? Here is my current code: $vt is the temperature when the gauge displays

 Gauge::create(array(
      "title"=>"Maloof Temperature",
      "height"=>"200px",
      "dataSource"=>array(
          array("label"=>"Temperature","value"=>$vt),
      ),
      "columns"=>array(
        "label",
        "value"=>array(
            "suffix"=>" (F)",
            )
            )
       ));

Thanks for any help you can give.

Dennis

KoolReport commented on Feb 18, 2022

You use options:

Gauge::create([
    ...
    "options"=>[
        "min"=>-15,
        "max"=>115
    ]
])

Hope that helps.

Dennis Spanogle commented on Feb 18, 2022

Works! Thanks.
I searched the download core and examples and could not find that - or missed it. Where in the download or documents would I have found that?

KoolReport commented on Feb 18, 2022

Ah yes, actually we put the "options" in which you can put any native google chart properties. You can find those native properties for gauge here:

https://developers.google.com/chart/interactive/docs/gallery/gauge#configuration-options

Hope that helps.

Dennis Spanogle commented on Feb 21, 2022

Yes, 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
None yet

None