FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat-增加对称条形图 · stack-stark/ngx-g2plot@95eda73 · GitHub

Repository navigation

Commit 95eda73

Browse files
committed
feat-增加对称条形图
1 parent 8081395 commit 95eda73

10 files changed

Lines changed: 124 additions & 39 deletions

File tree

‎README.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Description:
33
* @Date: 2020-05-07 11:57:49
44
* @LastEditors: tanmh
5-
* @LastEditTime: 2020-12-01 17:49:55
5+
* @LastEditTime: 2020-12-02 09:55:59
66
-->
77
# NgxG2plot
88

@@ -167,6 +167,7 @@ See the official documentation for all methods of charting: https://g2plot.antv.
167167
-|-|-|-
168168
starkG2plotArea | Area - 面积图 | g2plotArea | G2plotAreaModule
169169
starkG2plotBar | Bar - 基础条形图 | g2plotBar | G2plotBarModule
170+
starkG2plotBidirectionalBar | BidirectionalBar - 对称条形图 | g2plotBidirectionalBar | G2plotBidirectionalBarModule
170171
starkG2plotBox | Box - 箱图 | g2plotBox | G2plotBoxModule
171172
starkG2plotBullet | Bullet - 子弹图 | g2plotBullet | G2plotBulletModule
172173
starkG2plotColumn | Column - 柱状图 | g2plotColumn | G2plotColumnModule
@@ -178,13 +179,20 @@ starkG2plotHistogram | Histogram - 直方图 | g2plotHistogram | G2plotHistogra
178179
starkG2plotLine | Line - 折线图 | g2plotLine | G2plotLineModule
179180
starkG2plotLiquid | Liquid - 水波图 | g2plotLiquid | G2plotLiquidModule
180181
starkG2plotPie | Pie - 饼图 | g2plotPie | G2plotPieModule
182+
starkG2plotRadialBar | RadialBar - 玉珏图 | g2plotRadialBar | G2plotRadialBarModule
181183
starkG2plotRadar | Radar - 雷达图 | g2plotRadar | G2plotRadarModule
182184
starkG2plotRose | Rose - 玫瑰图 | g2plotRose | G2plotRoseModule
183185
starkG2plotScatter | Scatter - 散点图 | g2plotScatter | G2plotScatterModule
186+
starkG2plotStock | Stock - 股票图 | g2plotStock | G2plotStockModule
187+
starkG2plotSunburst | Sunburst - 旭日图图 | g2plotSunburst | G2plotSunburstModule
184188
starkG2plotTinyColumn | TinyColumn - 迷你图 | g2plotTinyColumn | G2plotTinyColumnModule
185189
starkG2plotWaterfall | Waterfall - 瀑布图 | g2plotWaterfall | G2plotWaterfallModule
186190
starkG2plotWordCloud | WordCloud - 词云 | g2plotWordCloud | G2plotWordCloudModule
187191

192+
### 关于命名
193+
194+
指令名为 `starkG2plot` + `官方图表名称`, exportAs导出为`g2plot` + `官方图表名称`, Module为 `G2plot` + `官方图表名称` + `Module`
195+
188196
## g2plot官方文档地址 -- G2plot official document address
189197
https://g2plot.antv.vision/zh/docs/manual/introduction
190198

‎projects/ngx-g2plot/README.md‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,13 @@ If you need to get the current diagram instance and all its properties and metho
147147

148148
See the official documentation for all methods of charting: https://g2plot.antv.vision/zh/docs/manual/plot-api
149149

150-
## 所有指令列表 -- All Directive
150+
## 所有指令列表 -- All Directive
151151

152152
指令名/Directive | 图表名 | exportAs | Module
153153
-|-|-|-
154154
starkG2plotArea | Area - 面积图 | g2plotArea | G2plotAreaModule
155155
starkG2plotBar | Bar - 基础条形图 | g2plotBar | G2plotBarModule
156+
starkG2plotBidirectionalBar | BidirectionalBar - 对称条形图 | g2plotBidirectionalBar | G2plotBidirectionalBarModule
156157
starkG2plotBox | Box - 箱图 | g2plotBox | G2plotBoxModule
157158
starkG2plotBullet | Bullet - 子弹图 | g2plotBullet | G2plotBulletModule
158159
starkG2plotColumn | Column - 柱状图 | g2plotColumn | G2plotColumnModule
@@ -164,13 +165,19 @@ starkG2plotHistogram | Histogram - 直方图 | g2plotHistogram | G2plotHistogra
164165
starkG2plotLine | Line - 折线图 | g2plotLine | G2plotLineModule
165166
starkG2plotLiquid | Liquid - 水波图 | g2plotLiquid | G2plotLiquidModule
166167
starkG2plotPie | Pie - 饼图 | g2plotPie | G2plotPieModule
168+
starkG2plotRadialBar | RadialBar - 玉珏图 | g2plotRadialBar | G2plotRadialBarModule
167169
starkG2plotRadar | Radar - 雷达图 | g2plotRadar | G2plotRadarModule
168170
starkG2plotRose | Rose - 玫瑰图 | g2plotRose | G2plotRoseModule
169171
starkG2plotScatter | Scatter - 散点图 | g2plotScatter | G2plotScatterModule
172+
starkG2plotStock | Stock - 股票图 | g2plotStock | G2plotStockModule
173+
starkG2plotSunburst | Sunburst - 旭日图图 | g2plotSunburst | G2plotSunburstModule
170174
starkG2plotTinyColumn | TinyColumn - 迷你图 | g2plotTinyColumn | G2plotTinyColumnModule
171175
starkG2plotWaterfall | Waterfall - 瀑布图 | g2plotWaterfall | G2plotWaterfallModule
172176
starkG2plotWordCloud | WordCloud - 词云 | g2plotWordCloud | G2plotWordCloudModule
173177

178+
### 关于命名
179+
180+
指令名为 `starkG2plot` + `官方图表名称`, exportAs导出为`g2plot` + `官方图表名称`, Module为 `G2plot` + `官方图表名称` + `Module`
174181
## g2plot官方文档地址 -- G2plot official document address
175182
https://g2plot.antv.vision/zh/docs/manual/introduction
176183

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* @Description:
3+
* @Date: 2020-12-02 09:49:11
4+
* @LastEditors: tanmh
5+
* @LastEditTime: 2020-12-02 09:54:42
6+
*/
7+
import { G2plotBidirectionalBarDirective } from './g2plot-bidirectional-bar.directive';
8+
9+
describe('G2plotBidirectionalBarDirective', () => {
10+
it('should create an instance', () => {
11+
const directive = new G2plotBidirectionalBarDirective();
12+
expect(directive).toBeTruthy();
13+
});
14+
});
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* @Description: BidirectionalBar图表指令
3+
* @Date: 2020-11-27 10:07:48
4+
* @LastEditors: tanmh
5+
* @LastEditTime: 2020-12-02 09:51:38
6+
*/
7+
import { Directive, ElementRef, Input, AfterViewInit } from '@angular/core';
8+
import { BidirectionalBar, BidirectionalBarOptions } from '@antv/g2plot';
9+
@Directive({
10+
selector: '[starkG2plotBidirectionalBar]',
11+
exportAs: 'g2plotBidirectionalBar'
12+
})
13+
export class G2plotBidirectionalBarDirective implements AfterViewInit {
14+
15+
@Input() options: BidirectionalBarOptions;
16+
17+
public instance: BidirectionalBar;
18+
19+
constructor(
20+
private elementRef: ElementRef
21+
) { }
22+
23+
ngAfterViewInit(): void {
24+
const hostElement = this.elementRef.nativeElement;
25+
this.instance = new BidirectionalBar(hostElement, this.options);
26+
this.instance.render();
27+
}
28+
29+
/**
30+
* 通过这个方法,可以增量的更新图表配置
31+
* @param options
32+
*/
33+
update(options: BidirectionalBarOptions): void {
34+
this.instance.update(options);
35+
}
36+
37+
/**
38+
* 通过这个方法,可以修改图表的数据,并自动重新渲染
39+
* @param newData
40+
*/
41+
changeData(newData: Array<object>): void {
42+
this.instance.changeData(newData);
43+
}
44+
45+
/**
46+
* 完全销毁整个画布,回收所有资源,仅仅保留传入的 DOM container 容器
47+
*/
48+
destroy(): void {
49+
this.instance.destroy();
50+
}
51+
52+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* @Description:
3+
* @Date: 2020-12-02 09:48:38
4+
* @LastEditors: tanmh
5+
* @LastEditTime: 2020-12-02 09:55:29
6+
*/
7+
import { NgModule } from '@angular/core';
8+
import { CommonModule } from '@angular/common';
9+
import { G2plotBidirectionalBarDirective } from './g2plot-bidirectional-bar.directive';
10+
11+
@NgModule({
12+
declarations: [G2plotBidirectionalBarDirective],
13+
imports: [
14+
CommonModule
15+
]
16+
})
17+
export class G2plotBidirectionalBarModule { }
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* @Description:
3+
* @Date: 2020-12-01 11:55:11
4+
* @LastEditors: tanmh
5+
* @LastEditTime: 2020-12-01 11:56:33
6+
*/
7+
export * from './public-api';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"ngPackage": {
3+
"lib": {
4+
"entryFile": "public-api.ts"
5+
}
6+
}
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* @Description:
3+
* @Date: 2020-12-01 11:55:06
4+
* @LastEditors: tanmh
5+
* @LastEditTime: 2020-12-02 09:52:13
6+
*/
7+
export * from './g2plot-bidirectional-bar.module';
8+
export * from './g2plot-bidirectional-bar.directive';

‎projects/ngx-g2plot/src/lib/index.ts‎

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎projects/ngx-g2plot/src/public-api.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export * from './lib/g2plot-area/g2plot-area.module';
22
export * from './lib/g2plot-bar/g2plot-bar.module';
3+
export * from './lib/g2plot-bidirectional-bar/g2plot-bidirectional-bar.module';
34
export * from './lib/g2plot-box/g2plot-box.module';
45
export * from './lib/g2plot-bullet/g2plot-bullet.module';
56
export * from './lib/g2plot-column/g2plot-column.module';
@@ -24,6 +25,7 @@ export * from './lib/g2plot-word-cloud/g2plot-word-cloud.module';
2425

2526
export * from './lib/g2plot-area/g2plot-area.directive';
2627
export * from './lib/g2plot-bar/g2plot-bar.directive';
28+
export * from './lib/g2plot-bidirectional-bar/g2plot-bidirectional-bar.directive';
2729
export * from './lib/g2plot-box/g2plot-box.directive';
2830
export * from './lib/g2plot-bullet/g2plot-bullet.directive';
2931
export * from './lib/g2plot-column/g2plot-column.directive';

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL