ngx-pluto
Version:
54 lines (53 loc) • 1.93 kB
TypeScript
import { OnInit, ElementRef, EventEmitter } from '@angular/core';
/**
* 环形占比图
*
* <example-url>https://stackblitz.com/edit/np-circle-bar-sample?embed=1&file=src/app/app.component.ts</example-url>
*/
export declare class NpCircleBar implements OnInit {
canvasRef: ElementRef;
/**百分比值0 ~ 1, 例如0.25,则占比1/4。 */
value: number;
/**环的直径 */
size: number;
/**环形占比开始的角度,例如0代表3点钟方向开始占比,π代表9点钟方向,2π转了一圈又到了3点钟方向开始,以此类推。 */
startAngle: number;
/**环的厚度 */
thickness: string;
/**环形占比渐变色gradient,例如:{ gradient: ['#3aeabb', '#fdd250'] } */
fill: any;
/**环形未占比填充颜色,例如:rgba(0, 0, 0, 0.1) */
emptyFill: string;
/**加载动画效果,例如:{ duration: 1200, easing: 'circleProgressEasing' }*/
animation: object | boolean;
/**加载动画初始值 */
animationStartValue: number;
/**加载动画是否逆时针 */
reverse: boolean;
/**环形图截面形状,butt | round | square,默认round即圆环截面 */
lineCap: 'butt' | 'round' | 'square';
insertMode: 'append' | 'prepend';
circleInited: EventEmitter<{}>;
circleAnimationStart: EventEmitter<{}>;
circleAnimationProgress: EventEmitter<any>;
circleAnimationEnd: EventEmitter<any>;
el: any;
canvas: HTMLCanvasElement;
ctx: CanvasRenderingContext2D;
radius: number;
arcFill: any;
lastFrameValue: number;
constructor();
ngOnInit(): void;
init(): void;
private initWidget;
private initFill;
private draw;
private drawFrame;
private drawArc;
private drawEmptyArc;
private drawAnimated;
private getThickness;
private getValue;
setValue(newValue: number): void;
}