Jump to content

Chart documentation for Reports (v5.1.2)


Nicholi3

Recommended Posts

I have been creating several customized reports with good success. I have also begun adding charts as part of the reports to make recognizing trends easy. I have been using the handful of chart examples coded into the default reports in v5.1.2 to study the various parameters and chart types available. I have adapted the charts and used them successfully, but find there are things I want to do, but do not know how.

 

I could not find any WHMCS documentation on the charting capability in the Reports area - other than the report examples. Is there any Chart documentation available? Does WHMCS's charting use a 3rd party charting library that would have documentation available elsewhere?

 

Specifically, one thing I'm trying to do is force the y-axis scale on a column chart to start at 0 and possibly also set a maximum instead of defaulting to a min/max based on the data in the chart. It would seem this might be possible using the $args array, but it's not clear how to do so without documentation on what parameters the $args will accept.

 

Thanks!

Link to comment
Share on other sites

  • 4 months later...

Hi Nicholi3,

 

WHMCS is using the Google Visualization API.

 

Unfortunatly the WHMCSChart object does not support every feature (yet?), because I tried to add a "vAxis: { minValue: 0 }" to the options.

 

But I found a (bit dirty) workaround:

At the end of your report file, add the following line:

 

$reportdata["headertext"] = strtr($reportdata["headertext"], array("var options = {"=>"var options = { vAxis: {minValue: 0},"));

 

That will include the vAxis minValue=0 to the options, after the WHMCSChart has created the javascript code that will calling the Google Visualization API from the browser.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated