import { Component, OnInit } from '@angular/core'; declare const require: any; @Component({ selector: 'app-theme', templateUrl: './theme.component.html', styleUrls: ['./theme.component.scss'] }) export class ThemeComponent implements OnInit { demo_html = require('!!html-loader!./theme.component.html'); demo_ts = require('!!raw-loader!./theme.component.ts'); demo_main_ts = `\ import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; /** import theme files here: */ import 'echarts/theme/dark.js'; import 'echarts/theme/macarons.js'; if (environment.production) { enableProdMode(); } platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.log(err)); `; theme: string; options = { title: { text: 'Nightingale\'s Rose Diagram', subtext: 'Mocking Data', x: 'center' }, tooltip: { trigger: 'item', formatter: '{a}
{b} : {c} ({d}%)' }, legend: { x: 'center', y: 'bottom', data: ['rose1', 'rose2', 'rose3', 'rose4', 'rose5', 'rose6', 'rose7', 'rose8'] }, calculable: true, series: [ { name: 'area', type: 'pie', radius: [30, 110], roseType: 'area', data: [ { value: 10, name: 'rose1' }, { value: 5, name: 'rose2' }, { value: 15, name: 'rose3' }, { value: 25, name: 'rose4' }, { value: 20, name: 'rose5' }, { value: 35, name: 'rose6' }, { value: 30, name: 'rose7' }, { value: 40, name: 'rose8' } ] } ] }; constructor() { } ngOnInit() { } }