Pie with Gradient Fill

The sample shows pie chart and support for gradient styling.

import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './styles.css'; // import * as chart from '@grapecity/wijmo.chart'; import { getData } from './data'; // document.readyState === 'complete' ? init() : window.onload = init; // function init() { let pie = new chart.FlexPie('#chart', { header: 'Best-selling Mobile Phones Brands of 2017', bindingName: 'brand', binding: 'sales', itemsSource: getData(), palette: ['l(0,0,1,0)#89f7fe-#66a6ff', 'l(0,0,0,1)#13547a-#80d0c7', 'l(0,0,1,1)#ff0844-#ffb199', 'l(0,0,1,0)#b224ef-#7579ff-#b224ef', 'l(0,0,0,1)#e27f00-#ae1a73', 'r(0.5,0.5,0.7)#cc208e-#6713d2'] }); } <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexChart Pie with Gradient Fill</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> // best selling mobile phones brands // https://en.wikipedia.org/wiki/List_of_best-selling_mobile_phones export function getData() { return [ { brand: 'Samsung', sales: 321 }, { brand: 'Apple', sales: 215 }, { brand: 'Huawei', sales: 160 }, { brand: 'OPPO', sales: 112 }, { brand: 'Vivo', sales: 100 }, { brand: 'Others', sales: 638 } ]; } body { margin-bottom: 24px; } import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './styles.css'; // import { Component, Inject, enableProdMode, NgModule } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { BrowserModule } from '@angular/platform-browser'; import { WjChartModule } from '@grapecity/wijmo.angular2.chart'; import { DataService } from './app.data'; // @Component({ selector: 'app-component', templateUrl: 'src/app.component.html' }) export class AppComponent { data: any; // constructor(@Inject(DataService) private dataService: DataService) { this.data = dataService.getData(); } } // @NgModule({ imports: [WjChartModule, 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 Pie with Gradient Fill</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-pie [header]="'Best-selling Mobile Phones Brands of 2017'" [bindingName]="'brand'" [binding]="'sales'" [itemsSource]="data" [palette]="['l(0,0,1,0)#89f7fe-#66a6ff', 'l(0,0,0,1)#13547a-#80d0c7', 'l(0,0,1,1)#ff0844-#ffb199', 'l(0,0,1,0)#b224ef-#7579ff-#b224ef', 'l(0,0,0,1)#e27f00-#ae1a73', 'r(0.5,0.5,0.7)#cc208e-#6713d2']"> </wj-flex-pie> </div> import { Injectable } from '@angular/core'; // @Injectable() export class DataService { // best selling mobile phones brands // https://en.wikipedia.org/wiki/List_of_best-selling_mobile_phones getData() { return [ { brand: 'Samsung', sales: 321 }, { brand: 'Apple', sales: 215 }, { brand: 'Huawei', sales: 160 }, { brand: 'OPPO', sales: 112 }, { brand: 'Vivo', sales: 100 }, { brand: 'Others', sales: 638 } ]; } } body { margin-bottom: 24px; } <template> <div class="container-fluid"> <wj-flex-pie header="Best-selling Mobile Phones Brands of 2017" bindingName="brand" binding="sales" :itemsSource="data" :palette="['l(0,0,1,0)#89f7fe-#66a6ff', 'l(0,0,0,1)#13547a-#80d0c7', 'l(0,0,1,1)#ff0844-#ffb199', 'l(0,0,1,0)#b224ef-#7579ff-#b224ef', 'l(0,0,0,1)#e27f00-#ae1a73', 'r(0.5,0.5,0.7)#cc208e-#6713d2']"> </wj-flex-pie> </div> </template> <script> import '@grapecity/wijmo.styles/wijmo.css'; import 'bootstrap.css'; import Vue from 'vue'; import '@grapecity/wijmo.vue2.chart'; import { getData } from './data'; // new Vue({ el: '#app', data: { data: getData() } }); </script> <style> 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 Pie with Gradient Fill</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> // best selling mobile phones brands // https://en.wikipedia.org/wiki/List_of_best-selling_mobile_phones export function getData() { return [ { brand: 'Samsung', sales: 321 }, { brand: 'Apple', sales: 215 }, { brand: 'Huawei', sales: 160 }, { brand: 'OPPO', sales: 112 }, { brand: 'Vivo', sales: 100 }, { brand: 'Others', sales: 638 } ]; } 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 { getData } from './data'; // class App extends React.Component { constructor(props) { super(props); this.state = { data: getData(), palette: ['l(0,0,1,0)#89f7fe-#66a6ff', 'l(0,0,0,1)#13547a-#80d0c7', 'l(0,0,1,1)#ff0844-#ffb199', 'l(0,0,1,0)#b224ef-#7579ff-#b224ef', 'l(0,0,0,1)#e27f00-#ae1a73', 'r(0.5,0.5,0.7)#cc208e-#6713d2'] }; } render() { return <div className="container-fluid"> <wjChart.FlexPie header="Best-selling Mobile Phones Brands of 2017" bindingName="brand" binding="sales" itemsSource={this.state.data} palette={this.state.palette}> </wjChart.FlexPie> </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> body { margin-bottom: 24px; } export function getData() { return [ { brand: 'Samsung', sales: 321 }, { brand: 'Apple', sales: 215 }, { brand: 'Huawei', sales: 160 }, { brand: 'OPPO', sales: 112 }, { brand: 'Vivo', sales: 100 }, { brand: 'Others', sales: 638 } ]; }