Line with Gaps

The sample shows a line chart with missing points (interpolate nulls)

import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './styles.css'; // import * as chart from '@grapecity/wijmo.chart'; import * as animation from '@grapecity/wijmo.chart.animation'; import { getData } from './data'; // document.readyState === 'complete' ? init() : window.onload = init; // function init() { let lineChart = new chart.FlexChart('#chart', { header: '24 Hours CPU Utilization and Temperature', legend: { position: chart.Position.None }, chartType: chart.ChartType.Line, bindingX: 'time', interpolateNulls: false, series: [ { binding: 'utilization', name: 'Utilization(%)' }, { binding: 'temperature', name: 'Temperature(°C)' } ], itemsSource: getData(), palette: getRandomPalette() }); let ani = new animation.ChartAnimation(lineChart); ani.animationMode = animation.AnimationMode.Point; // let chkbox = document.querySelector('#interpolateNulls'); chkbox.addEventListener('change', () => { lineChart.interpolateNulls = chkbox.checked; }); } // function getRandomPalette() { let palettes = Object.getOwnPropertyNames(chart.Palettes) .filter(prop => typeof chart.Palettes[prop] === "object" && prop !== 'prototype'); let rand = Math.floor(Math.random() * palettes.length); // return chart.Palettes[palettes[rand]]; } <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexChart Line with Gaps</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app'); </script> </head> <body> <div class="container-fluid"> <div class="form-check"> <label for="interpolateNulls" class="form-check-label">interpolateNulls:</label> <input id="interpolateNulls" type="checkbox" class="form-check-input"> </div> <div id="chart"></div> </div> </body> </html> // The Utilization and Temperature of CPU. export function getData() { return [ { time: '1:00', utilization: 26, temperature: 55 }, { time: '2:00', utilization: 36, temperature: 57 }, { time: '3:00', utilization: 74, temperature: 60 }, { time: '4:00', utilization: 23, temperature: 46 }, { time: '5:00', utilization: 13, temperature: 44 }, { time: '6:00', utilization: 64, temperature: 56 }, { time: '7:00', utilization: 34, temperature: 50 }, { time: '8:00', utilization: 67, temperature: 55 }, { time: '9:00', utilization: 72, temperature: 60 }, { time: '10:00', utilization: 23, temperature: 54 }, { time: '11:00', utilization: 100, temperature: 78 }, { time: '12:00', utilization: 100, temperature: 87 }, { time: '13:00', utilization: 100, temperature: 94 }, { time: '14:00', utilization: null, temperature: null }, { time: '15:00', utilization: 95, temperature: 87 }, { time: '16:00', utilization: 80, temperature: 84 }, { time: '17:00', utilization: 53, temperature: 76 }, { time: '18:00', utilization: 26, temperature: 58 }, { time: '19:00', utilization: 42, temperature: 53 }, { time: '20:00', utilization: 36, temperature: 62 }, { time: '21:00', utilization: 34, temperature: 53 }, { time: '22:00', utilization: 63, temperature: 61 }, { time: '23:00', utilization: 53, temperature: 57 }, { time: '24:00', utilization: 54, temperature: 47 } ]; } label { margin-right: 3px; } body { margin-bottom: 24px; } import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './styles.css'; // import * as wjChart from '@grapecity/wijmo.chart'; import { Component, Inject, enableProdMode, NgModule } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { WjChartModule } from '@grapecity/wijmo.angular2.chart'; import { WjChartAnimationModule } from '@grapecity/wijmo.angular2.chart.animation'; import { DataService } from './app.data'; // @Component({ selector: 'app-component', templateUrl: 'src/app.component.html' }) export class AppComponent { data: any; palette: string[]; interpolateNulls: boolean; // constructor(@Inject(DataService) private dataService: DataService) { this.data = dataService.getData(); this.palette = this._getRandomPalette(); this.interpolateNulls = false; } // private _getRandomPalette() { let palettes = Object.getOwnPropertyNames(wjChart.Palettes) .filter(prop => typeof wjChart.Palettes[prop] === "object" && prop !== 'prototype'); let rand = Math.floor(Math.random() * palettes.length); // return wjChart.Palettes[palettes[rand]]; } } // @NgModule({ imports: [WjChartModule, WjChartAnimationModule, FormsModule, BrowserModule], declarations: [AppComponent], providers: [DataService], bootstrap: [AppComponent] }) export class AppModule { } // enableProdMode(); // Bootstrap application with hash style navigation and global services. platformBrowserDynamic().bootstrapModule(AppModule); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexGrid Line with Gaps</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Polyfills --> <script src="node_modules/core-js/client/shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.min.js"></script> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.js"></script> <script src="systemjs.config.js"></script> <script> // workaround to load 'rxjs/operators' from the rxjs bundle System.import('rxjs').then(function (m) { System.set(SystemJS.resolveSync('rxjs/operators'), System.newModule(m.operators)); System.import('./src/app.component'); }); </script> </head> <body> <app-component></app-component> </body> </html> <div class="container-fluid"> <div class="form-check"> <label for="interpolateNulls" class="form-check-label">interpolateNulls:</label> <input id="interpolateNulls" type="checkbox" class="form-check-input" [(ngModel)]="chart.interpolateNulls"> </div> <wj-flex-chart #chart [itemsSource]="data" header="24 Hours CPU Utilization and Temperature" bindingX="time" chartType="Line" [interpolateNulls]="interpolateNulls" [palette]="palette"> <wj-flex-chart-legend position="None"></wj-flex-chart-legend> <wj-flex-chart-series binding="utilization" name="Utilization(%)"></wj-flex-chart-series> <wj-flex-chart-series binding="temperature" name="Temperature(°C)"></wj-flex-chart-series> <wj-flex-chart-animation animationMode="Point"></wj-flex-chart-animation> </wj-flex-chart> </div> import { Injectable } from '@angular/core'; // @Injectable() export class DataService { getData() { return [ { time: '1:00', utilization: 26, temperature: 55 }, { time: '2:00', utilization: 36, temperature: 57 }, { time: '3:00', utilization: 74, temperature: 60 }, { time: '4:00', utilization: 23, temperature: 46 }, { time: '5:00', utilization: 13, temperature: 44 }, { time: '6:00', utilization: 64, temperature: 56 }, { time: '7:00', utilization: 34, temperature: 50 }, { time: '8:00', utilization: 67, temperature: 55 }, { time: '9:00', utilization: 72, temperature: 60 }, { time: '10:00', utilization: 23, temperature: 54 }, { time: '11:00', utilization: 100, temperature: 78 }, { time: '12:00', utilization: 100, temperature: 87 }, { time: '13:00', utilization: 100, temperature: 94 }, { time: '14:00', utilization: null, temperature: null }, { time: '15:00', utilization: 95, temperature: 87 }, { time: '16:00', utilization: 80, temperature: 84 }, { time: '17:00', utilization: 53, temperature: 76 }, { time: '18:00', utilization: 26, temperature: 58 }, { time: '19:00', utilization: 42, temperature: 53 }, { time: '20:00', utilization: 36, temperature: 62 }, { time: '21:00', utilization: 34, temperature: 53 }, { time: '22:00', utilization: 63, temperature: 61 }, { time: '23:00', utilization: 53, temperature: 57 }, { time: '24:00', utilization: 54, temperature: 47 } ]; } } label { margin-right: 3px; } body { margin-bottom: 24px; } <template> <div class="container-fluid"> <div class="form-check"> <label for="interpolateNulls" class="form-check-label">interpolateNulls:</label> <input id="interpolateNulls" type="checkbox" class="form-check-input" :checked="interpolateNulls" @click="onCheckboxClick"> </div> <wj-flex-chart :itemsSource="data" header="24 Hours CPU Utilization and Temperature" bindingX="time" chartType="Line" :interpolateNulls="interpolateNulls" :palette="palette"> <wj-flex-chart-legend position="None"></wj-flex-chart-legend> <wj-flex-chart-series binding="utilization" name="Utilization(%)"></wj-flex-chart-series> <wj-flex-chart-series binding="temperature" name="Temperature(°C)"></wj-flex-chart-series> <wj-flex-chart-animation animationMode="Point"></wj-flex-chart-animation> </wj-flex-chart> </div> </template> <script> import '@grapecity/wijmo.styles/wijmo.css'; import 'bootstrap.css'; import Vue from 'vue'; import * as wjChart from '@grapecity/wijmo.chart'; import '@grapecity/wijmo.vue2.chart'; import '@grapecity/wijmo.vue2.chart.animation'; import { getData } from './data'; // new Vue({ el: '#app', data: { data: getData(), interpolateNulls: false, // Get random palette palette: this.palette = (() => { let palettes = Object.getOwnPropertyNames(wjChart.Palettes) .filter(prop => typeof wjChart.Palettes[prop] === "object" && prop !== 'prototype'); let rand = Math.floor(Math.random() * palettes.length); // return wjChart.Palettes[palettes[rand]]; })() }, methods: { onCheckboxClick(e) { this.interpolateNulls = e.target.checked; } } }); </script> <style> label { margin-right: 3px; } body { margin-bottom: 24px; } </style> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexChart Line with Gaps</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app.vue'); </script> </head> <body> <div id="app"></div> </body> </html> // The Utilization and Temperature of CPU. export function getData() { return [ { time: '1:00', utilization: 26, temperature: 55 }, { time: '2:00', utilization: 36, temperature: 57 }, { time: '3:00', utilization: 74, temperature: 60 }, { time: '4:00', utilization: 23, temperature: 46 }, { time: '5:00', utilization: 13, temperature: 44 }, { time: '6:00', utilization: 64, temperature: 56 }, { time: '7:00', utilization: 34, temperature: 50 }, { time: '8:00', utilization: 67, temperature: 55 }, { time: '9:00', utilization: 72, temperature: 60 }, { time: '10:00', utilization: 23, temperature: 54 }, { time: '11:00', utilization: 100, temperature: 78 }, { time: '12:00', utilization: 100, temperature: 87 }, { time: '13:00', utilization: 100, temperature: 94 }, { time: '14:00', utilization: null, temperature: null }, { time: '15:00', utilization: 95, temperature: 87 }, { time: '16:00', utilization: 80, temperature: 84 }, { time: '17:00', utilization: 53, temperature: 76 }, { time: '18:00', utilization: 26, temperature: 58 }, { time: '19:00', utilization: 42, temperature: 53 }, { time: '20:00', utilization: 36, temperature: 62 }, { time: '21:00', utilization: 34, temperature: 53 }, { time: '22:00', utilization: 63, temperature: 61 }, { time: '23:00', utilization: 53, temperature: 57 }, { time: '24:00', utilization: 54, temperature: 47 } ]; } import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './app.css'; // import * as React from 'react'; import * as ReactDOM from 'react-dom'; // import * as wjChart from '@grapecity/wijmo.react.chart'; import * as wjCharts from '@grapecity/wijmo.chart'; import * as wjChartAnimate from '@grapecity/wijmo.react.chart.animation'; import { getData } from './data'; // class App extends React.Component { constructor(props) { super(props); this._getRandomPalette = () => { let palettes = Object.getOwnPropertyNames(wjCharts.Palettes) .filter(prop => typeof wjCharts.Palettes[prop] === "object" && prop !== 'prototype'); let rand = Math.floor(Math.random() * palettes.length); // return wjCharts.Palettes[palettes[rand]]; }; this.onCheckboxClick = (target) => { this.setState({ interpolateNulls: target.checked }); }; this.state = { data: getData(), interpolateNulls: false, palette: this._getRandomPalette() }; } render() { return <div className="container-fluid"> <div className="form-check"> <label htmlFor="interpolateNulls" className="form-check-label">interpolateNulls:</label> <input id="interpolateNulls" type="checkbox" className="form-check-input" defaultChecked={false} onClick={e => this.onCheckboxClick(e.target)}/> </div> <wjChart.FlexChart itemsSource={this.state.data} header="24 Hours CPU Utilization and Temperature" bindingX="time" chartType="Line" interpolateNulls={this.state.interpolateNulls} palette={this.state.palette}> <wjChart.FlexChartLegend position="None"></wjChart.FlexChartLegend> <wjChart.FlexChartSeries binding="utilization" name="Utilization(%)"></wjChart.FlexChartSeries> <wjChart.FlexChartSeries binding="temperature" name="Temperature(°C)"></wjChart.FlexChartSeries> <wjChartAnimate.FlexChartAnimation animationMode="Point"></wjChartAnimate.FlexChartAnimation> </wjChart.FlexChart> </div>; } } ReactDOM.render(<App />, document.getElementById('app')); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>AutoComplete</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app'); </script> </head> <body> <div id="app"></div> </body> </html> label { margin-right: 3px; } body { margin-bottom: 24px; } export function getData() { return [ { time: '1:00', utilization: 26, temperature: 55 }, { time: '2:00', utilization: 36, temperature: 57 }, { time: '3:00', utilization: 74, temperature: 60 }, { time: '4:00', utilization: 23, temperature: 46 }, { time: '5:00', utilization: 13, temperature: 44 }, { time: '6:00', utilization: 64, temperature: 56 }, { time: '7:00', utilization: 34, temperature: 50 }, { time: '8:00', utilization: 67, temperature: 55 }, { time: '9:00', utilization: 72, temperature: 60 }, { time: '10:00', utilization: 23, temperature: 54 }, { time: '11:00', utilization: 100, temperature: 78 }, { time: '12:00', utilization: 100, temperature: 87 }, { time: '13:00', utilization: 100, temperature: 94 }, { time: '14:00', utilization: null, temperature: null }, { time: '15:00', utilization: 95, temperature: 87 }, { time: '16:00', utilization: 80, temperature: 84 }, { time: '17:00', utilization: 53, temperature: 76 }, { time: '18:00', utilization: 26, temperature: 58 }, { time: '19:00', utilization: 42, temperature: 53 }, { time: '20:00', utilization: 36, temperature: 62 }, { time: '21:00', utilization: 34, temperature: 53 }, { time: '22:00', utilization: 63, temperature: 61 }, { time: '23:00', utilization: 53, temperature: 57 }, { time: '24:00', utilization: 54, temperature: 47 } ]; }