Trend Widget



  Trend widget is a widget that is used to register points or trend groups to the widget and display the real time trend graph.


  User is able to do the following tasks through trend widget scripts.


    1. It is able to read the registered trend and display it as the real time trend.


    1. It is able to search for the trend.



    1. It is able to read the value printed on the graph.

   



Methods



 Trend widget provides the following functions.

 Scripts for the Trend widget is the same as for the Data chart. Refer to the [Data Chart] function.


Return Type

Method

Description


addBarData( name, value )

Add a bar graph data to the chart.


addCurveData( name, value )

Add a curve graph data to the chart.


addSeriesData( name, value )

Add a line graph data to the chart.


moveToY2Scale( name )

Enter the name of graphs to use the right Y-axis of the chart.


setBarChartStyle( style )

Set the style of bar graphs to the chart.


setBarColor( name, color )

Set the line color of bar graphs to the chart.


setBarSpacing( width )

Set the space of bar graphs to the chart.


setDataVisible( index, visible )

Reveal or hide the graph.


setLineColor( name, color )

Set the line color of line graphs to the chart.


setLineStyle( name, style )

Set the line style of line graphs to the chart.


setLineWidth( name, width )

Set the line width of line graphs to the chart.


setY2Range( min, max, step )

Set the range and space of the right Y-axis to the chart.


setYRange( min, max, step )

Set the range and space of the Y-axis to the chart.



 Trend widget provides the following functions.


Return Type

Method

Description

list[float]

getGraphData( name )

Read the data of graphs.


loadHistoryTrend( trendsetName,

 syear, smonth, sday, shour, sminute,

 eyear, emonth, eday, ehour, eminute,

 step )

Read the past trend and display it on the widget.


loadTrend( trendsetName )

Read the trend group and display it as the real time trend.


  loadHistoryTrend( trendsetName:Trend set name,

                          syear:Start year, smonth:Start month, sday:Start day, shour:Start hour, sminute:Start minute,

                          eyear:End year, emonth:End month, eday:End day, ehour:End hour, eminute:End minute,

                          step=0:Display interval(Second)  )

 

  Read the selected data on the trend set by entering the start date and the end date.

 

        ㆍ trendsetName setting is as follows.

                - When loading the entire data : 'Trend set name'

                - When loading a subset of data : {'Trend set name' : ['Point 1', ' Point 2']}

                - When loading the data from two different trend set : ['Point 1', 'Point 2']


  Select the displaying space on the last parameter.

  If you did not set the last parameter, it displays it according to the recording period set on the trend set.

     


  Example) When loading the entire data

   


       chart = canvas.getObject('trend')  # Obtain the trend widget.


       # Display all data for 5 minutes interval.

       chart.loadHistoryTrend( 'Power', 2017, 7, 3, 1, 0, 2017, 7, 3, 2, 0, 60*5 )



     


  Example) When loading a subset of data

   


       chart = canvas.getObject('trend')  # Obtain the trend widget.


       # Display all data for 5 minutes interval.

       chart.loadHistoryTrend( trendSetName , 2017,7,3,1,0   , 2017,7,3,2,0 , 60*5 )


   

     


  Example) When loading the data from two different trend set

   


       chart = canvas.getObject('trend')  # Obtain the trend widget.


       # Display all data for 5 minutes interval.

       chart.loadHistoryTrend( trendSetName , 2017,7,3,1,0   , 2017,7,3,2,0 , 60*5 )



 


  list[float] getGraphData( name:Data name )

 

  Read the data printed on the graph.


        ㆍ name : Enter the name of graphs set on the history data chart widget.


 

 

  Example)

   


       chart = canvas.getObject('trend')  # Obtain the trend widget.

       print chart.getGraphData('Outlet')






  loadTrend( trendsetName:Trend set name )

 

  Read the data of the entered trend set and display it as the real time trend.


        ㆍ trendsetName setting is as follows.

                - When loading the entire data : 'Trend set name'

                - When loading a subset of data : {'Trend set name' : ['Point 1', 'Point 2'] }

                - When loading the data from two different trend set : ['Point 1', 'Point 2']

     


  Example) When loading the entire data

   


       chart = canvas.getObject('trend')  # Obtain the trend widget.

       data = chart.loadTrendSet('Available Power')   # Read 'Available Power' trend cell.


     

     


  Example) When loading a subset of data

   


       chart = canvas.getObject('trend')  # Obtain the trend widget.

       name = {'Available Power' : ['Equipment1.Power', 'Equipment2.Power']}

       data = chart.loadTrendSet(name)   # Read 'Equipment1.Power', 'Equipment2.Power' from 'Available Power'.


     

     


  Example) When loading the data from two different trend set

   


       chart = canvas.getObject('trend')  # Obtain the trend widget

       name = ['Equipment1.Power', 'Equipment2.Power']

       data = chart.loadTrendSet(name)   # Read 'Equipment1.Power', 'Equipment2.Power'.