You are here:
Configuring the Data Source for Graphs in the Usage Tab
The graphs in the Usage tab represents data visually so that your customers can notice trends and better understand their usage metrics across weeks or months.
The integration procedure sfiEnergyConsole_FetchUsagePerPremise fetches mock data that is represented by the graph. You can edit the integration procedure to fetch data from other sources.
The integration procedure fetches unique data sources for the selected combination of premises, utility service, frequency, and units. You must configure the data sources for each of the combinations individually.
For the graph to work correctly, you must ensure that:
-
The sfiEnergyConsole_FetchUsagePerPremise integration procedure fetches data from the correct source.
-
The data source is in an X-axis and Y-axis format.
Here is a sample of the data format:
{
"data": [
{
"xAxis": "12:00 am",
"yAxis": "1.5"
},
{
"xAxis": "01:00 am",
"yAxis": "2.0"
},
{
"xAxis": "02:00 am",
"yAxis": "0.8"
},
{
"xAxis": "03:00 am",
"yAxis": "0.8"
},
{
"xAxis": "04:00 am",
"yAxis": "0.4"
},
{
"xAxis": "05:00 am",
"yAxis": "0.5"
},
]
}
You can use an Apex class to fetch data from your Salesforce database or an external source, and then transform it into the data format shown above.
You can modify the properties of the graph, such as the background color and chart type, by configuring the sfiEnergyConsole_GetUsageInfo integration procedure.

