• Edit
  • Download
  • <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingSoft Demo</title>
      <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
      <style>
        html,
        body {
          margin: 0;
          padding: 0;
          width: 100%;
          height: 100%;
        }
    
        .chart--container {
          min-height: 150px;
          width: 100%;
          height: 100%;
        }
    
        .zc-ref {
          display: none;
        }
      </style>
    </head>
    
    <body>
      <!-- CHART CONTAINER -->
      <div id="myChart" class="chart--container">
        <a class="zc-ref" href="https://www.zingchart.com/">Powered by ZingChart</a>
      </div>
      <script>
        ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"]; // window:load event for Javascript to run after HTML
        // because this Javascript is injected into the document head
        window.addEventListener('load', () => {
          // Javascript code to execute after DOM content
    
          // full ZingChart schema can be found here:
          // https://www.zingchart.com/docs/api/json-configuration/
          let chartConfig = {
            type: 'scatter',
            globals: {
              fontSize: '14px'
            },
            title: {
              text: 'Using rules for styling thresholds',
              fontSize: '24px'
            },
            legend: {
              cursor: 'hand',
              draggable: true
            },
            // plot represents general series, or plots, styling
            plot: {
              // hoverstate
              tooltip: {
                // % symbol represents a token to insert a value. Full list here:
                // https://www.zingchart.com/docs/tutorials/chart-elements/zingchart-tokens/
                text: '%plot-text %kl was %v (&deg;F)',
                padding: '10px 15px',
                borderRadius: '3px',
                // htmlMode renders text attribute as html so
                // &deg; is rendered
                htmlMode: true
              },
              // animation docs here:
              // https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
              animation: {
                effect: 'ANIMATION_SLIDE_TOP',
                method: 'ANIMATION_BOUNCE_EASE_OUT',
                sequence: 'ANIMATION_BY_PLOT',
                speed: 375
              },
              lineWidth: '3px',
              // line node styling
              marker: {
                borderWidth: '0px',
                size: '6px',
                rules: [{
                    rule: '%v > 40',
                    backgroundColor: '#000'
                  },
                  {
                    rule: '%v < 20',
                    backgroundColor: '#000'
                  }
                ],
              }
            },
            scaleX: {
              // set scale label
              label: {
                text: 'Hour'
              },
            },
            scaleY: {
              // scale label with unicode character
              label: {
                text: 'Temperature (°F)'
              },
              markers: [{
                  type: 'line',
                  lineWidth: 2,
                  range: [40],
                  label: {
                    text: 'Upper Tolerance'
                  }
                },
                {
                  type: 'line',
                  lineWidth: 2,
                  range: [20],
                  label: {
                    text: 'Lower Tolerance'
                  }
                }
              ]
            },
            series: [{
                values: [
                  [1, 9],
                  [2, 15],
                  [3, 21],
                  [4, 30],
                  [5, 40],
                  [6, 59],
                  [7, 60],
                  [8, 75]
                ],
                text: 'Week 1'
              },
              {
                values: [
                  [2.1, 13],
                  [3.5, 25],
                  [4.9, 35],
                  [5.3, 41],
                  [6.5, 57],
                  [7.1, 61],
                  [8.7, 70]
                ],
                text: 'Week 2'
              },
              {
                values: [
                  [1.8, 21],
                  [1.9, 29],
                  [4.1, 33],
                  [4.5, 39],
                  [6.9, 51],
                  [7.4, 64],
                  [8.9, 70]
                ],
                text: 'Week 3'
              },
              {
                values: [
                  [0.9, 15],
                  [1.1, 24],
                  [2.3, 29],
                  [2.9, 30],
                  [3.3, 35],
                  [5.6, 67],
                  [6.9, 70]
                ],
                text: 'Week 4'
              },
              {
                values: [
                  [1.9, 5],
                  [2.5, 10],
                  [3.1, 30],
                  [6.5, 45],
                  [6.9, 74],
                  [7.2, 50],
                  [7.8, 56]
                ],
                text: 'Week 5'
              }
            ]
          };
    
          // render chart
          zingchart.render({
            id: 'myChart',
            data: chartConfig,
            height: '100%',
            width: '100%',
          });
        });
      </script>
    </body>
    
    </html>
    <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingSoft Demo</title>
      <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    </head>
    
    <body>
      <!-- CHART CONTAINER -->
      <div id="myChart" class="chart--container">
        <a class="zc-ref" href="https://www.zingchart.com/">Powered by ZingChart</a>
      </div>
    </body>
    
    </html>
    html,
    body {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
    }
    
    .chart--container {
      min-height: 150px;
      width: 100%;
      height: 100%;
    }
    
    .zc-ref {
      display: none;
    }
    // window:load event for Javascript to run after HTML
    // because this Javascript is injected into the document head
    window.addEventListener('load', () => {
      // Javascript code to execute after DOM content
    
      // full ZingChart schema can be found here:
      // https://www.zingchart.com/docs/api/json-configuration/
      let chartConfig = {
        type: 'scatter',
        globals: {
          fontSize: '14px'
        },
        title: {
          text: 'Using rules for styling thresholds',
          fontSize: '24px'
        },
        legend: {
          cursor: 'hand',
          draggable: true
        },
        // plot represents general series, or plots, styling
        plot: {
          // hoverstate
          tooltip: {
            // % symbol represents a token to insert a value. Full list here:
            // https://www.zingchart.com/docs/tutorials/chart-elements/zingchart-tokens/
            text: '%plot-text %kl was %v (&deg;F)',
            padding: '10px 15px',
            borderRadius: '3px',
            // htmlMode renders text attribute as html so
            // &deg; is rendered
            htmlMode: true
          },
          // animation docs here:
          // https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
          animation: {
            effect: 'ANIMATION_SLIDE_TOP',
            method: 'ANIMATION_BOUNCE_EASE_OUT',
            sequence: 'ANIMATION_BY_PLOT',
            speed: 375
          },
          lineWidth: '3px',
          // line node styling
          marker: {
            borderWidth: '0px',
            size: '6px',
            rules: [{
                rule: '%v > 40',
                backgroundColor: '#000'
              },
              {
                rule: '%v < 20',
                backgroundColor: '#000'
              }
            ],
          }
        },
        scaleX: {
          // set scale label
          label: {
            text: 'Hour'
          },
        },
        scaleY: {
          // scale label with unicode character
          label: {
            text: 'Temperature (°F)'
          },
          markers: [{
              type: 'line',
              lineWidth: 2,
              range: [40],
              label: {
                text: 'Upper Tolerance'
              }
            },
            {
              type: 'line',
              lineWidth: 2,
              range: [20],
              label: {
                text: 'Lower Tolerance'
              }
            }
          ]
        },
        series: [{
            values: [
              [1, 9],
              [2, 15],
              [3, 21],
              [4, 30],
              [5, 40],
              [6, 59],
              [7, 60],
              [8, 75]
            ],
            text: 'Week 1'
          },
          {
            values: [
              [2.1, 13],
              [3.5, 25],
              [4.9, 35],
              [5.3, 41],
              [6.5, 57],
              [7.1, 61],
              [8.7, 70]
            ],
            text: 'Week 2'
          },
          {
            values: [
              [1.8, 21],
              [1.9, 29],
              [4.1, 33],
              [4.5, 39],
              [6.9, 51],
              [7.4, 64],
              [8.9, 70]
            ],
            text: 'Week 3'
          },
          {
            values: [
              [0.9, 15],
              [1.1, 24],
              [2.3, 29],
              [2.9, 30],
              [3.3, 35],
              [5.6, 67],
              [6.9, 70]
            ],
            text: 'Week 4'
          },
          {
            values: [
              [1.9, 5],
              [2.5, 10],
              [3.1, 30],
              [6.5, 45],
              [6.9, 74],
              [7.2, 50],
              [7.8, 56]
            ],
            text: 'Week 5'
          }
        ]
      };
    
      // render chart
      zingchart.render({
        id: 'myChart',
        data: chartConfig,
        height: '100%',
        width: '100%',
      });
    });