123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668 |
- <!doctype html>
- <html class="no-js" lang="">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <title>app-angular documentation</title>
- <meta name="description" content="">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="icon" type="image/x-icon" href="../images/favicon.ico">
- <link rel="stylesheet" href="../styles/style.css">
- </head>
- <body>
- <div class="navbar navbar-default navbar-fixed-top visible-xs">
- <a href="../" class="navbar-brand">app-angular documentation</a>
- <button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>
- </div>
- <div class="xs-menu menu" id="mobile-menu">
- <div id="book-search-input" role="search">
- <input type="text" placeholder="Type to search">
- </div>
- <nav>
-
- <ul class="list">
-
- <li class="title">
- <a href="../">app-angular documentation</a>
- </li>
-
- <li class="divider"></li>
-
-
- <li class="chapter">
- <a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
- <ul class="links">
- <li class="link">
- <a href="../" ><span class="fa fa-file-text-o"></span>README</a>
- </li>
- <li class="link">
- <a
-
- href="../overview.html"
- href="../overview.html"
- >
- <span class="fa fa-th"></span>Overview
- </a>
- </li>
- </ul>
- </li>
-
- <li class="chapter">
- <a data-type="chapter-link" href="./modules.html" >
- <span class="fa fa-archive"></span>
- <span>Modules</span>
- <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
- data-target="#xs-modules-links"
- ></span>
- </a>
- <ul class="links collapse in"
- id="xs-modules-links"
- >
- <li class="link">
- <a href="../modules/AppModule.html" >AppModule</a>
- </li>
- <li class="link">
- <a href="../modules/LessonModule.html" >LessonModule</a>
- </li>
- </ul>
- </li>
-
- <li class="chapter">
- <div class="simple">
- <span class="fa fa-cogs"></span>
- <span>Components</span>
- <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
- data-target="#xs-components-links"
- ></span>
- </div>
- <ul class="links collapse in"
- id="xs-components-links"
- >
- <li class="link">
- <a href="../components/AppComponent.html" >AppComponent</a>
- </li>
- <li class="link">
- <a href="../components/BblComponent.html" >BblComponent</a>
- </li>
- <li class="link">
- <a href="../components/DetailComponent.html" >DetailComponent</a>
- </li>
- <li class="link">
- <a href="../components/EcharsComponent.html" class="active" >EcharsComponent</a>
- </li>
- <li class="link">
- <a href="../components/EchartsExempleComponent.html" >EchartsExempleComponent</a>
- </li>
- <li class="link">
- <a href="../components/EditComponent.html" >EditComponent</a>
- </li>
- <li class="link">
- <a href="../components/FlowfatherComponent.html" >FlowfatherComponent</a>
- </li>
- <li class="link">
- <a href="../components/FlowtestComponent.html" >FlowtestComponent</a>
- </li>
- <li class="link">
- <a href="../components/HomeComponent.html" >HomeComponent</a>
- </li>
- <li class="link">
- <a href="../components/NavTabsComponent.html" >NavTabsComponent</a>
- </li>
- <li class="link">
- <a href="../components/PageMineComponent.html" >PageMineComponent</a>
- </li>
- <li class="link">
- <a href="../components/PageSpotDetailComponent.html" >PageSpotDetailComponent</a>
- </li>
- </ul>
- </li>
-
-
- <li class="chapter">
- <div class="simple">
- <span class="fa fa-file-code-o"></span>
- <span>Classes</span>
- <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
- data-target="#xs-classes-links"
- ></span>
- </div>
- <ul class="links collapse in"
- id="xs-classes-links"
- >
- <li class="link">
- <a href="../classes/TestChatCompletion.html" >TestChatCompletion</a>
- </li>
- </ul>
- </li>
-
-
- <li class="chapter">
- <div class="simple">
- <span class="fa fa-long-arrow-down"></span>
- <span>Injectables</span>
- <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
- data-target="#xs-injectables-links"
- ></span>
- </div>
- <ul class="links collapse in"
- id="xs-injectables-links"
- >
- <li class="link">
- <a href="../injectables/DataServiceService.html" >DataServiceService</a>
- </li>
- </ul>
- </li>
-
- <li class="chapter">
- <div class="simple">
- <span class="fa fa-info"></span>
- <span>Interfaces</span>
- <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
- data-target="#xs-interfaces-links"
- ></span>
- </div>
- <ul class="links collapse in"
- id="xs-interfaces-links"
- >
- <li class="link">
- <a href="../interfaces/TestChatMessage.html" >TestChatMessage</a>
- </li>
- </ul>
- </li>
-
- <li class="chapter">
- <div class="simple">
- <span class="fa fa-plus"></span>
- <span>Pipes</span>
- <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
- data-target="#xs-pipes-links"
- ></span>
- </div>
- <ul class="links collapse in"
- id="xs-pipes-links"
- >
- <li class="link">
- <a href="../pipes/TokPipe.html" >TokPipe</a>
- </li>
- </ul>
- </li>
-
-
- <li class="chapter">
- <a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
- </li>
-
- <li class="divider"></li>
- <li class="copyright">
- Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
- <img src="..//images/compodoc-vectorise.svg" class="img-responsive">
- </a>
- </li>
-
- </ul>
-
- </nav>
- </div>
- <div class="container-fluid main">
- <div class="row main">
- <div class="hidden-xs menu">
- <nav>
-
- <ul class="list">
-
- <li class="title">
- <a href="../">app-angular documentation</a>
- </li>
-
- <li class="divider"></li>
-
- <div id="book-search-input" role="search">
- <input type="text" placeholder="Type to search">
- </div>
-
- <li class="chapter">
- <a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
- <ul class="links">
- <li class="link">
- <a href="../" ><span class="fa fa-file-text-o"></span>README</a>
- </li>
- <li class="link">
- <a
-
- href="../overview.html"
- href="../overview.html"
- >
- <span class="fa fa-th"></span>Overview
- </a>
- </li>
- </ul>
- </li>
-
- <li class="chapter">
- <a data-type="chapter-link" href="./modules.html" >
- <span class="fa fa-archive"></span>
- <span>Modules</span>
- <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
- data-target="#modules-links"
- ></span>
- </a>
- <ul class="links collapse in"
- id="modules-links"
- >
- <li class="link">
- <a href="../modules/AppModule.html" >AppModule</a>
- </li>
- <li class="link">
- <a href="../modules/LessonModule.html" >LessonModule</a>
- </li>
- </ul>
- </li>
-
- <li class="chapter">
- <div class="simple">
- <span class="fa fa-cogs"></span>
- <span>Components</span>
- <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
- data-target="#components-links"
- ></span>
- </div>
- <ul class="links collapse in"
- id="components-links"
- >
- <li class="link">
- <a href="../components/AppComponent.html" >AppComponent</a>
- </li>
- <li class="link">
- <a href="../components/BblComponent.html" >BblComponent</a>
- </li>
- <li class="link">
- <a href="../components/DetailComponent.html" >DetailComponent</a>
- </li>
- <li class="link">
- <a href="../components/EcharsComponent.html" class="active" >EcharsComponent</a>
- </li>
- <li class="link">
- <a href="../components/EchartsExempleComponent.html" >EchartsExempleComponent</a>
- </li>
- <li class="link">
- <a href="../components/EditComponent.html" >EditComponent</a>
- </li>
- <li class="link">
- <a href="../components/FlowfatherComponent.html" >FlowfatherComponent</a>
- </li>
- <li class="link">
- <a href="../components/FlowtestComponent.html" >FlowtestComponent</a>
- </li>
- <li class="link">
- <a href="../components/HomeComponent.html" >HomeComponent</a>
- </li>
- <li class="link">
- <a href="../components/NavTabsComponent.html" >NavTabsComponent</a>
- </li>
- <li class="link">
- <a href="../components/PageMineComponent.html" >PageMineComponent</a>
- </li>
- <li class="link">
- <a href="../components/PageSpotDetailComponent.html" >PageSpotDetailComponent</a>
- </li>
- </ul>
- </li>
-
-
- <li class="chapter">
- <div class="simple">
- <span class="fa fa-file-code-o"></span>
- <span>Classes</span>
- <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
- data-target="#classes-links"
- ></span>
- </div>
- <ul class="links collapse in"
- id="classes-links"
- >
- <li class="link">
- <a href="../classes/TestChatCompletion.html" >TestChatCompletion</a>
- </li>
- </ul>
- </li>
-
-
- <li class="chapter">
- <div class="simple">
- <span class="fa fa-long-arrow-down"></span>
- <span>Injectables</span>
- <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
- data-target="#injectables-links"
- ></span>
- </div>
- <ul class="links collapse in"
- id="injectables-links"
- >
- <li class="link">
- <a href="../injectables/DataServiceService.html" >DataServiceService</a>
- </li>
- </ul>
- </li>
-
- <li class="chapter">
- <div class="simple">
- <span class="fa fa-info"></span>
- <span>Interfaces</span>
- <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
- data-target="#interfaces-links"
- ></span>
- </div>
- <ul class="links collapse in"
- id="interfaces-links"
- >
- <li class="link">
- <a href="../interfaces/TestChatMessage.html" >TestChatMessage</a>
- </li>
- </ul>
- </li>
-
- <li class="chapter">
- <div class="simple">
- <span class="fa fa-plus"></span>
- <span>Pipes</span>
- <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
- data-target="#pipes-links"
- ></span>
- </div>
- <ul class="links collapse in"
- id="pipes-links"
- >
- <li class="link">
- <a href="../pipes/TokPipe.html" >TokPipe</a>
- </li>
- </ul>
- </li>
-
-
- <li class="chapter">
- <a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
- </li>
-
- <li class="divider"></li>
- <li class="copyright">
- Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
- <img src="..//images/compodoc-vectorise.svg" class="img-responsive">
- </a>
- </li>
-
- </ul>
-
- </nav>
- </div>
- <div class="content component">
- <div class="content-data">
- <ol class="breadcrumb">
- <li>Components</li>
- <li>EcharsComponent</li>
- </ol>
- <ul class="nav nav-tabs" role="tablist">
- <li class="active">
- <a href="#infos" id="infos-tab" role="tab" data-toggle="tab">Infos</a>
- </li>
- <li>
- <a href="#source" role="tab" id="source-tab" data-toggle="tab">Source</a>
- </li>
- </ul>
- <div class="tab-content">
- <div class="tab-pane fade active in" id="infos"><p class="comment">
- <h3>File</h3>
- </p>
- <p class="comment">
- <code>src/modules/lesson/echars/echars.component.ts</code>
- </p>
- <section>
- <h3>Metadata</h3>
- <table class="table table-sm table-hover">
- <tbody>
- <tr>
- <td class="col-md-3">selector</td>
- <td class="col-md-9"><code>app-echars</code></td>
- </tr>
- <tr>
- <td class="col-md-3">styleUrls</td>
- <td class="col-md-9"><code>echars.component.scss</code></td>
- </tr>
- <tr>
- <td class="col-md-3">templateUrl</td>
- <td class="col-md-9"><code>echars.component.html</code></td>
- </tr>
- </tbody>
- </table>
- </section>
- <section>
- <h3 id="inputs">Inputs</h3>
- <table class="table table-sm table-bordered">
- <tbody>
- <tr>
- <td class="col-md-2">
- <code>options</code>
- </td>
- <td class="col-md-10">
- <p>
- <em>Type:</em> <code>any</code>
- </p>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section>
- <h3 id="constructor">Constructor</h3>
- <table class="table table-sm table-bordered">
- <tbody>
- <tr>
- <td class="col-md-4">
- <code>constructor()</code>
- </td>
- </tr>
-
- </tbody>
- </table>
- </section>
- <section>
- <h3 id="methods">Methods</h3>
- <table class="table table-sm table-bordered">
- <tbody>
- <tr>
- <td class="col-md-4">
- <b><span class="modifier"></span> createEcharts</b>
- </td>
- </tr>
-
- <tr>
- <td class="col-md-4">
- <span class="modifier-icon method fa fa-play ">
- <span class="fa fa-"></span>
- </span>
- <code>createEcharts()</code>
- </td>
- </tr>
-
- <tr>
- <td class="col-md-4">
- <div class="io-description">
- <b>Returns: </b> <code>void</code>
-
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- <section>
- <h3 id="inputs">Properties</h3>
- <table class="table table-sm table-bordered">
- <tbody>
- <tr>
- <td class="col-md-4">
- <b> chartDiv</b>
- </td>
- </tr>
- <tr>
- <td class="col-md-4">
- <code>chartDiv: <code>boolean</code>
- </bcode>
- </td>
- </tr>
- </tbody>
- </table>
- <table class="table table-sm table-bordered">
- <tbody>
- <tr>
- <td class="col-md-4">
- <b> ElementRef</b>
- </td>
- </tr>
- <tr>
- <td class="col-md-4">
- <code>ElementRef: <code>any</code>
- </bcode>
- </td>
- </tr>
- </tbody>
- </table>
- </section>
- </div>
- <div class="tab-pane fade tab-source-code" id="source">
- <pre><code class="hljs javascript">import { Component, Input, AfterViewInit } from '@angular/core';
- // 引入Angular的DOM操作装饰器ViewChiild
- import { ViewChild, ElementRef } from '@angular/core';
- // 引入echarts第三方库
- import * as echarts from "echarts"
- @Component({
- selector: 'app-echars',
- templateUrl: './echars.component.html',
- styleUrls: ['./echars.component.scss']
- })
- export class EcharsComponent implements AfterViewInit {
- // 编写Echart图表的配置项与数据
- @Input() options: any = {
- xAxis: {
- type: 'category',
- data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
- },
- yAxis: {
- type: 'value'
- },
- series: [
- {
- data: [150, 230, 224, 218, 135, 147, 260],
- type: 'line'
- }
- ]
- };
- // 通过ViewChild获取页面中#chartDiv标记的DOM元素
- @ViewChild("chartDiv", { static: false }) chartDiv!: ElementRef;
- constructor() {
- }
- // 生命周期:视图DOM加载完成后再执行创建图表操作
- ngAfterViewInit(): void {
- this.createEcharts();
- }
- async createEcharts() {
- // 从ViewChild元素中获取dom节点
- let chartDom = this.chartDiv.nativeElement;
- // 向指定节点渲染初始化echarts
- let myChart = echarts.init(chartDom);
- // 当配置项存在时
- // 根据配置渲染图表内容
- this.options && myChart.setOption(this.options);
- }
- }</code></pre>
- </div>
- </div>
- </div><div class="search-results">
- <div class="has-results">
- <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
- <ul class="search-results-list"></ul>
- </div>
- <div class="no-results">
- <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="../js/libs/bootstrap-native.js"></script>
- <script src="../js/libs/es6-shim.min.js"></script>
- <script src="../js/libs/EventDispatcher.js"></script>
- <script src="../js/libs/promise.min.js"></script>
- <script src="../js/libs/zepto.min.js"></script>
- <script src="../js/compodoc.js"></script>
- <script src="../js/search/search.js"></script>
- <script src="../js/search/lunr.min.js"></script>
- <script src="../js/search/search-lunr.js"></script>
- <script src="../js/menu.js"></script>
- <script src="../js/libs/highlight.pack.js"></script>
- <script src="../js/libs/highlightjs-line-numbers.min.js"></script>
- <script src="../js/search/search_index.js"></script>
- <script>
- document.addEventListener('DOMContentLoaded', function() {
- hljs.initHighlightingOnLoad();
- hljs.initLineNumbersOnLoad();
- });
- </script>
- </body>
- </html>
|