History Report Chart
History Report Chart
History report chart is a widget that prints the data as a form of minutely, hourly, daily, monthly, and annually.
Users can do the following tasks using history report chart scripts.
- It is able to obtain the report data by setting the type of data to display on the report chart.
- It is able to obtain the data of the day selected on the report chart.
- It is able to obtain various data on a graph by changing the name of data on the graph.
- It is able to obtain the value of data displayed on the graph through getGraphDate.
- Display the data of the selected period.
Methods
History report chart widget object provides the following scripts.
Scripts for the History report chart is the same as for the Data chart. Refer to the [Data Chart] function.
Return type |
Method |
Description |
Add a bar graph data to the chart. |
||
Add a curve graph data to the chart. |
||
Add a line graph data to the chart. |
||
Enter the name of graphs to use the right Y-axis. |
||
Set the style of bar graphs to the chart. |
||
Set the line color of bar graphs to the chart. |
||
Set the space of bar graphs to the chart. |
||
setDataVisible( index, visible ) |
Reveal or hide the graph. |
|
Set the line color of line graphs to the chart. |
||
Set the line style of line graphs to the chart. |
||
Set the line width of line graphs to the chart. |
||
Set the range and space of the right Y-axis to the chart. |
||
Set the range and space of the Y-axis to the chart. |
History report chart provides the following functions.
Return Type |
Method |
Description |
list[float] |
Read the data displayed on the graph. |
|
Read the report data (Select minute, hour, day, month, year) |
||
Read the data of the entered date and print it on the widget. |
||
Read the data of the selected period. (Select minute, hour, day, month, year) |
||
Read the data of the entered date by selecting the report data. (Select minute, hour, day, month) |
||
replaceText( replacelist ) |
Change the name of the selected data and print various data on one graph. |
loadData reads the selected history data, and print it on the graph of the history report chart widget. ㆍ Enter the type of historical data to print. - HistoryDataReportChartItem.Minute : Minute data - HistoryDataReportChartItem.Hour : Hour data - HistoryDataReportChartItem.Day : Day data - HistoryDataReportChartItem.Month : Month data - HistoryDataReportChartItem.Year : Annual data Example)
chart = canvas.getObject('HistoryReportChart') # Obtain the history report chart widget. data = chart.loadData( chart.Minute ) # Print the minute data. data = chart.loadData( chart.Hour ) # Print the hour data. |
Read the data printed on the graph. ㆍ name : Enter the name of graphs set to the history data chart widget. Example)
chart = canvas.getObject('HistoryReportChart') # Obtain the history report chart widget. print chart.getGraphData('ESS Charge') # Read 'ESS Charge' printed on the history report chart widget. |
Output)
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 34.0, 70.0, 192.0, 122.0, 197.0, 192.0, 145.0, 68.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) |
replaceText is used to change the data name and print various data on one graph widget. If the [Lighting] button is clicked, it reads the data corresponding to the toilet, if the [Outlet] button is clicked. it reads the data corresponding to the office. If you want to use replaceText, pre-set the name through scripts as below. If you set the String to $1,$2 as below, it is able to call the data by replacing $1,$2 to the desired text.
-> ['Replace text:Current text', 'Replace:Current text', ···] Example)
chart = canvas.getObject('HistoryReportChart') # Obtain the history report chart widget. chart.replaceText(['$1:Lighting#1', '$2:Lighting']) # Replace '$1', '$2' with 'Lighting#1' , 'Lighting' respectively. |