You are here:
Configure 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 sfiEnergySelfService_FetchUsagePerPremise fetches sample 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 sfiEnergySelfService_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:
{
"electricityData": [],
"gasData": [
{
"xAxis": "12:00 am",
"yAxis": "15"
},
{
"xAxis": "01:00 am",
"yAxis": "20"
},
{
"xAxis": "02:00 am",
"yAxis": "8"
},
{
"xAxis": "03:00 am",
"yAxis": "8"
},
{
"xAxis": "04:00 am",
"yAxis": "4"
},
{
"xAxis": "05:00 am",
"yAxis": "5"
},
{
"xAxis": "06:00 am",
"yAxis": "5"
},
{
"xAxis": "07:00 am",
"yAxis": "5"
},
{
"xAxis": "08:00 am",
"yAxis": "10"
},
{
"xAxis": "09:00 am",
"yAxis": "12"
},
{
"xAxis": "10:00 am",
"yAxis": "9"
},
{
"xAxis": "11:00 am",
"yAxis": "6"
},
{
"xAxis": "12:00 am",
"yAxis": "10"
},
{
"xAxis": "01:00 pm",
"yAxis": "8"
},
{
"xAxis": "02:00 pm",
"yAxis": "8"
},
{
"xAxis": "03:00 pm",
"yAxis": "7"
},
{
"xAxis": "04:00 pm",
"yAxis": "8"
},
{
"xAxis": "05:00 pm",
"yAxis": "15"
}
]
}
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 sfiEnergySelfService_GetUsageInfo integration procedure.

