Description

This function generates bandwidth graphs for the current day, week, and year.

We removed this function in cPanel & WHM version 11.52. We strongly recommend that you use the following UAPI function instead of this function:

Examples 


$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$bandwidth_graphs = $cpanel->api1('Bandwidth', 'displaymainbwheader'); // Call the function.

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $bandwidth_graphs = $cpliveapi->api1('Bandwidth', 'displaymainbwheader'); # Call the function.

 

<cpanel Module="Bandwidth::displaymainbwheader()">
cpapi1 --user=username Bandwidth displaymainbwheader

<fieldset>
 <legend><b>Today</b></legend>
 <table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
 <tr>
 <td>
 <div align="center">
 <img file="bw-example-today.png" src="/tmp/example/bw-example-today.png" width="597" height="174">
 </div> </td></tr></table>
 </fieldset>
 <br /><br /> <fieldset>
 <legend><b>Past 7 Days</b></legend>
 <table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
 <tr>
 <td>
 <div align="center">
 <img file="bw-example-7days.png" src="/tmp/example/bw-example-7days.png" width="597" height="174">
 </div> </td></tr></table>
 </fieldset>
 <br /><br /> <fieldset>
 <legend><b>Past 12 Months</b></legend>
 <table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
 <tr>
 <td>
 <div align="center">
 <img file="bw-example-year.png" src="/tmp/example/bw-example-year.png" width="597" height="174">
 </div> </td></tr></table>
 </fieldset>
 <br /> 

Parameters

This function does not accept parameters.

Returns

This function returns HTML to display a table of generated bandwidth graph images for the current date, for the past seven days, and for the past 12 months.

  • The generated image files use the .png extension.
  • The system stores these files in the tmp directory.