Charts Definition Language (CDL): Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
mNo edit summary
(6 intermediate revisions by the same user not shown)
Line 17: Line 17:
== The Language ==
== The Language ==
=== The Chart block ===
=== The Chart block ===
CHART <id> TITLE [<word>...<word>]  CONNECTSto [1 … 24]
  CHART <id> TITLE [<word>...<word>]  CONNECTSto [1 … 24]
 
   [ PLOT [ALL|RECENT] <Plotvariable> [ [[CDL - EVAL|EVAL]] '[' <Expression> ']' ]
   [ PLOT [ALL|RECENT] <Plotvariable> [ [[CDL - EVAL|EVAL]] '[' <Expression> ']' ]
             AS <Line Type>  
             AS <Line Type>  
Line 31: Line 32:
   STATS blocks repeated
   STATS blocks repeated
     [...]
     [...]
   ENDCHART OUTPUT <filespec>
   ENDCHART OUTPUT <filespec>


   CHART […] ENDCHART blocks repeated
   CHART […] ENDCHART blocks repeated
Line 50: Line 51:
All capital written words in the Chart block section are keywords (reserved words) and have meaning.
All capital written words in the Chart block section are keywords (reserved words) and have meaning.


The following PlotVariables are also reserved words:
==== Explanation of the definition Keywords ====
#EQUATIONS: Starts an equations block. Such block only defines (partial) equations, it does not cause code generation in itself
#CHART: Starts a chart definition
#TITLE: Starts the title. All words until the next keyword comprise the title of the chart
#CONNECTSTO: The integer numbers which follow CONNECTSTO represent a pane in the realtime [[Dashboard|dashboard]]. When clicked on that pane this chart appears. This is only valid on charts in the default output. For other outputs there is no semantics for CONNECTSTO and a warning is issued in the logfile if it is specified in any second or higher output.
#PLOT: Starts the plot specification using one of the possible variables
#[[CDL - STATS|STATS]]: Starts the statistics block using one of the possible variables. Semantics demands the variable to be plotted normally as well.
#ALL: Defines the variable to be taken from the [[Dayfile.txt|Dayfile]] and all data for that variable will be plotted (Note that the CMX parameter ''ChartMaxDays'' will not be used)
#RECENT: Defines the variable to be governed by the CMX parameter ''GraphHours'' and are similar to the CMX RECENT graphs (though not equal).
#AS: Defines the type of charting for that variable.
#[[CDL - EVAL|EVAL]] [ ]: Defines an expression for the plot variable. The equation must be placed between the square brackets, space has no value here (does not act as separator).
#COLOUR: Defines the colour of that variable.
#ZINDEX: Defines the zIndex plane for that variable.
#LINEWIDTH: Defines the linewidth for that variable.
#OPACITY: Defines the opacity for that variable (important for area and column graphs)
#AXIS: Gives the user the possibility to specify an axis when using the EVAL construct otherwise an error is generated.
#ENDCHART: End the chart definition
#OUTPUT: Gives an optional name of an outputfile which starts at the chart where it is defined. Any chart after this OUTPUT specifier goes to this OUTPUT until another OUTPUT is found. Only the first OUTPUT specifier accepts click events as defined by CONNECTSTO.
 
The keywords for the actual parameters and the Graph Types speak for themselves.


==== With the RECENT qualifier ====
==== Plotvariables ====
The following PlotVariables are reserved words:
 
===== With the RECENT qualifier =====
       "InsideTemp", "Dewpoint", "ApparentTemp", "FeelsLike", "WindChill", "HeatIndex","Temperature", "Humidex",
       "InsideTemp", "Dewpoint", "ApparentTemp", "FeelsLike", "WindChill", "HeatIndex","Temperature", "Humidex",
       "WindGust", "WindSpeed",
       "WindGust", "WindSpeed",
Line 62: Line 85:
       "EvapoTranspiration"
       "EvapoTranspiration"


==== With the ALL qualifier ====
===== With the ALL qualifier =====


       "MinTemp", "MaxTemp", "AverageTemp", "WindChill", "MaxDewpoint", "MinDewpoint","MaxFeelsLike", "MinFeelsLike",  
       "MinTemp", "MaxTemp", "AverageTemp", "WindChill", "MaxDewpoint", "MinDewpoint","MaxFeelsLike", "MinFeelsLike",  
Line 72: Line 95:
       "HeatingDegreeDays","CoolingDegreeDays","EvapoTranspiration"
       "HeatingDegreeDays","CoolingDegreeDays","EvapoTranspiration"


==== Graph Types ====
==== Types ====
===== Graph Types =====
The following graphs are possible  
The following graphs are possible  
       Line, SpLine, Area, Scatter, Column, ColumnRange
       Line, SpLine, Area, Scatter, Column, ColumnRange
Line 80: Line 104:
ColumnRange only works for DAILY and ALL range specifiers. If the Max and Min lines of the range must be shown, they need to be specified as a separate line. The range can be specified for either Min or Max, the range will automatically be applied and no line will be shown. The ColumnRange is valid for all variables in the datafile with a Max/Min range: ''Temperature, Dewpoint, FeelsLike'' (and other derivatives), ''Barometer'' and ''Humidity''. Other variables will generate an error.
ColumnRange only works for DAILY and ALL range specifiers. If the Max and Min lines of the range must be shown, they need to be specified as a separate line. The range can be specified for either Min or Max, the range will automatically be applied and no line will be shown. The ColumnRange is valid for all variables in the datafile with a Max/Min range: ''Temperature, Dewpoint, FeelsLike'' (and other derivatives), ''Barometer'' and ''Humidity''. Other variables will generate an error.


==== Axis Types ====
===== Axis Types =====
The following Axis are possible.  
The following Axis are possible.  
       Temp, Wind, Distance, Hours, Solar, UV, Rain, Rrate, Pressure, Humidity, DegreeDays, EVT
       Temp, Wind, Distance, Hours, Solar, UV, Rain, Rrate, Pressure, Humidity, DegreeDays, EVT
Line 88: Line 112:
In future a generic (without title or unit) Axis will selectable to accommodate plotting in combination with other variables.
In future a generic (without title or unit) Axis will selectable to accommodate plotting in combination with other variables.


==== Stats Types ====
===== Other Types =====
The STATS keywords requires a ''Plotvariable'' on which to apply the statistics and a method to apply.
For other types such as STATS types (or methods) and FUNCTION types for EVAL, see those respective pages for [[CDL - STATS|STATS]] and for [[CDL - EVAL|EVAL]].


The following statistical methods are available in the ChartsCompiler:
=== Equations ===
      SMA
'''The Equations are in BETA, by the nature of all possible combinations and the recursive parsing not all possible equations have been tested (haha)'''
#SMA - [https://en.wikipedia.org/wiki/Moving_average#Simple_moving_average Simple Moving Average]


-- To be Continued --
See page [[CDL - EVAL]].
 
==== Explanation of the definition Keywords ====
#CHART: Starts a chart definition
#TITLE: Starts the title. All words until the next keyword comprise the title of the chart
#CONNECTSTO: The integer numbers which follow CONNECTSTO represent a pane in the realtime dashboard. When clicked on that pane this chart appears. This is only valid on charts in the default output. For other outputs there is no semantics for CONNECTSTO and a warning is issued in the logfile if it is specified in any second or higher output.
#PLOT: Starts the plot specification using one of the possible variables
#[[CDL - STATS|STATS]]: Starts the statistics block using one of the possible variables. Semantics demands the variable to be plotted normally as well.
#ALL: Defines the variable to be taken from the [[Dayfile.txt|Dayfile]] and all data for that variable will be plotted (Note that the CMX parameter ''ChartMaxDays'' will not be used)
#RECENT: Defines the variable to be governed by the CMX parameter ''GraphHours'' and are similar to the CMX RECENT graphs (though not equal).
#AS: Defines the type of charting for that variable.
#[[CDL - EVAL|EVAL]] [ ]: Defines an expression for the plot variable. The equation must be placed between the square brackets, space has no value here (does not act as separator).
#COLOUR: Defines the colour of that variable.
#ZINDEX: Defines the zIndex plane for that variable.
#LINEWIDTH: Defines the linewidth for that variable.
#OPACITY: Defines the opacity for that variable (important for area and column graphs)
#AXIS: Gives the user the possibility to specify an axis when using the EVAL construct otherwise an error is generated.
#ENDCHART: End the chart definition
#OUTPUT: Gives an optional name of an outputfile which starts at the chart where it is defined. Any chart after this OUTPUT specifier goes to this OUTPUT until another OUTPUT is found. Only the first OUTPUT specifier accepts clickevents as defined by CONNECTSTO.
 
The keywords for the actual parameters and the Graph Types speak for themselves.


== The Chart Axis ==
== The Chart Axis ==

Navigation menu