Basic Polar Chart

The sample demonstrates FlexRadar with multiple line series.

import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './styles.css'; import * as chart from '@grapecity/wijmo.chart'; import * as radar from '@grapecity/wijmo.chart.radar'; import * as animation from '@grapecity/wijmo.chart.animation'; import { getData } from './data'; // document.readyState === 'complete' ? init() : window.onload = init; // function init() { var r = new radar.FlexRadar('#chart', { itemsSource: getData(), bindingX: 'longitude', series: [ { binding: 'latitude1' }, { binding: 'latitude2' } ], axisX: { min: 0, max: 360, majorUnit: 60 }, axisY: { min: 0, max: 100, majorUnit: 25 } }); let ani = new animation.ChartAnimation(r, { animationMode: animation.AnimationMode.Series, easing: animation.Easing.EaseInOutBounce, duration: 1000 }); r.palette = getRandomPalette(); } // 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 Basic Polar Chart</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 id="chart"></div> </div> </body> </html> // Get random data. export function getData() { var data = []; for (var i = 0; i <= 360; i += 10) { data.push({ longitude: i, latitude1: Math.ceil(Math.random() * 30) + 60, latitude2: Math.ceil(Math.random() * 30) + 30 }); } return data; } body { margin-bottom: 24px; } import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './styles.css'; // import * as wjChart from '@grapecity/wijmo.chart'; import * as wjRadar from '@grapecity/wijmo.chart.radar'; import * as animation from '@grapecity/wijmo.chart.animation'; import { Component, Inject, enableProdMode, NgModule, ViewChild, AfterViewInit } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { BrowserModule } from '@angular/platform-browser'; import { WjChartModule } from '@grapecity/wijmo.angular2.chart'; import { WjChartRadarModule } from '@grapecity/wijmo.angular2.chart.radar'; import { DataService } from './app.data'; // @Component({ selector: 'app-component', templateUrl: 'src/app.component.html' }) export class AppComponent implements AfterViewInit { @ViewChild('chart') chart: wjRadar.FlexRadar; data: any; // DataSvc will be passed by derived classes constructor(@Inject(DataService) private dataService: DataService) { this.data = dataService.getData(); } // ngAfterViewInit() { let ani = new animation.ChartAnimation(this.chart, { animationMode: animation.AnimationMode.Series, easing: animation.Easing.EaseInOutBounce, duration: 1000 }); this.chart.palette = this._getRandomPalette(); } // 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, WjChartRadarModule, 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 FlexChart Basic Polar Chart</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"> <wj-flex-radar #chart [itemsSource]="data" [bindingX]="'longitude'"> <wj-flex-radar-axis [wjProperty]="'axisY'" [min]="0" [max]="100" [majorUnit]="25"></wj-flex-radar-axis> <wj-flex-radar-series [binding]="'latitude1'"></wj-flex-radar-series> <wj-flex-radar-series [binding]="'latitude2'"></wj-flex-radar-series> </wj-flex-radar> </div> import { Injectable } from '@angular/core'; @Injectable() export class DataService { getData() { var data = []; for (var i = 0; i <= 360; i += 10) { data.push({ longitude: i, latitude1: Math.ceil(Math.random() * 30) + 60, latitude2: Math.ceil(Math.random() * 30) + 30 }); } return data; } } body { margin-bottom: 24px; } <template> <div class="container-fluid"> <wj-flex-radar :itemsSource="data" bindingX="longitude" :palette="palette"> <wj-flex-radar-axis wjProperty="axisY" :min="0" :max="100" :majorUnit="25"></wj-flex-radar-axis> <wj-flex-radar-series binding="latitude1"></wj-flex-radar-series> <wj-flex-radar-series binding="latitude2"></wj-flex-radar-series> <wj-flex-chart-animation easing="EaseInOutBounce" animationMode="Series" :duration="1000"></wj-flex-chart-animation> </wj-flex-radar> </div> </template> <script> import "@grapecity/wijmo.styles/wijmo.css"; import 'bootstrap.css'; import Vue from 'vue'; import '@grapecity/wijmo.vue2.core'; import '@grapecity/wijmo.vue2.chart'; import '@grapecity/wijmo.vue2.chart.radar'; import '@grapecity/wijmo.vue2.chart.animation'; import { getData } from './data'; import * as wjChart from '@grapecity/wijmo.chart'; let App = Vue.extend({ name: 'app', data: function () { return { data: getData(), palette: this.getRandomPalette() } }, methods: { 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]]; } } }) new Vue({ render: h => h(App) }).$mount('#app'); </script> <style> body { margin-bottom: 24px; } label { margin-right: 3px; } </style> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexChart Basic Polar Chart</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> export function getData() { var data = []; for (var i = 0; i <= 360; i += 10) { data.push({ longitude: i, latitude1: Math.ceil(Math.random() * 30) + 60, latitude2: Math.ceil(Math.random() * 30) + 30 }); } return data; } 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 chart from '@grapecity/wijmo.chart'; import * as wjRadar from '@grapecity/wijmo.react.chart.radar'; 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(chart.Palettes) .filter(prop => typeof chart.Palettes[prop] === "object" && prop !== 'prototype'); let rand = Math.floor(Math.random() * palettes.length); // return chart.Palettes[palettes[rand]]; }; this.state = { data: getData(), palette: this.getRandomPalette() }; } render() { return <div className="container-fluid"> <wjRadar.FlexRadar itemsSource={this.state.data} bindingX="longitude" palette={this.state.palette}> <wjRadar.FlexRadarAxis wjProperty="axisY" min={0} max={100} majorUnit={25}> </wjRadar.FlexRadarAxis> <wjRadar.FlexRadarSeries binding="latitude1"></wjRadar.FlexRadarSeries> <wjRadar.FlexRadarSeries binding="latitude2"></wjRadar.FlexRadarSeries> <wjChartAnimate.FlexChartAnimation easing="EaseInOutBounce" animationMode="Series" duration={1000}> </wjChartAnimate.FlexChartAnimation> </wjRadar.FlexRadar> </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>GrapeCity Wijmo FlexChart Basic Polar Chart</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> body { margin-bottom: 24px; } export function getData() { var data = []; for (var i = 0; i <= 360; i += 10) { data.push({ longitude: i, latitude1: Math.ceil(Math.random() * 30) + 60, latitude2: Math.ceil(Math.random() * 30) + 30 }); } return data; }