13. Detect validity of data, and add points if necessary

  1. When a Load History block only generates one value, because the value has not changed over the selected time range, then the chart will not display any data. This will also break the Average and Max labels. We will fix this by detecting if there are less than two values and for a chart and make a new chart with 2 values. This will fix the prior issues.
  2. Go to graphs.dg5
    1. Right click on topRow – topChart select Edit Symbol
    2. Click on metricGraph – Chart – dataflow
    3. On dataflow
      1. Drag and Drop table – aggregation block
        1. Input: Bind from loadHistory – output
        2. Column: “row”
        3. Method: count
      2. Drag and Drop logic – if block
        1. Input 0: Bind from tableAggregation – output
        2. Op: >
        3. Input 1: “1”
        4. Then: Bind from loadHistory – output
      3. Drag and Drop date time – date range block
        1. Input: Bind from metricGraph – Symbol Properties - selectedRange
        2. Right click on formatted, select Pinned
      4. Drag and Drop String Operations – Split
        1. Input: Bind from dateRange – formatted
        2. Separator: “/”
      5. Drag and Drop Variables – Table
        1. Click on data – table tab in properties panel
          1. Generic table window will pop up
          2. Double click on v1, change it to “timestamp”
          3. Double click on v2, change it to “value”
          4. Right click on v3, select Delete
          5. Right click on row 2, select Delete
          6. Right click on row 1, select Delete
          7. Right click on row 0, select Delete
          8. Close table window
        2. Name: “singleValue”
        3. In properties window, click save – invoke
      6. Drag and Drop Table – Add Row
        1. Click on plus
        2. Name: “start”
        3. Table: Bind from singleValue – output
        4. Column 0: “timestamp”
        5. Column 1: “value”
      7. Duplicate start block
        1. Name: “end”
      8. Click on split – output Table
        1. Move table window off dataflow, so you can see both
        2. Drag and Drop the cell located at row:0 in the value column to start – value 0
        3. Drag and Drop the cell located at row:1 in the value column to end – value 0
      9. Drag and Drop Data Services – Load Value
      10. Click on loadHistroy
        1. In properties panel hover over blue dot of path
          1. Right click on it, select Copy Binding
      11. Click on loadValue
        1. In properties panel hover over blue dot of path
          1. Right click on it, select Paste
        2. Bind value to start – value 1
        3. Bind value to end – value 1
      12. Drag and Drop logic – delay block
        1. Delay: “0.2”
        2. Input 0: Bind from metricGraph – List – Value
        3. Output 0: Bind to start – invoke
      13. Click on start
        1. Invoke: Bind to end - invoke
      14. Drag and Drop Table – Remove Rows
        1. Invoke: Bind from metricGraph – List – Value
        2. Table: Bind from singleValue
        3. Condition: “row >= 0”
      15. Click on singleValue
        1. Data: Bind to if – else
      16. Click on if
        1. Output: Bind to metricGraph – Chart – Series – Series Series Properties Advanced – Data Source
        2. Double click on output blue dot to hang binding window
    4. Click on metricGraph – header – average - value dataflow
      1. Bind from hanging bind window, if.output – singleValue to tableAggregation – input
      2. Bind from hanging bind window, if.output – singleValue to tableAggregation1 - input
    5. Click on metricGraph – header – max - value dataflow
      1. Bind from hanging bind window, if.output – singleValue to tableAggregation – input
    6. Save symbol
    7. Save page