12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- /*
- * ********************************************************************************************************************
- *
- * :*$@@%$*: ;: ;; ;;
- * :@@%! :!@@%: %! ;%%@@%$ =@@@@@@@%; @%@@@%%%%@@@@@
- * :@%; :$= %%$$$%$$ ;$$ ;$@= !@$
- * =@! %! @ $=;% !@@@%: !$$$$$$$$$$$$$$=
- * =@* %! @ $= % %@= =%@! %=
- * *$%%! @@= ;=$%%%$*: %! @ $= % =%%%%%%@$ *%: =%
- * %@@!: !@@@%=$@@@@%! :*@@$: %! @ $= % $* ;@ @* :%*
- * ;@@! ;!!!;: ;@%: =======@%========* @ $$ % $%*****$@ :@$=*********=@$
- * $@* ;@@@%=!: *@*
- * =@$ ;;;!=%@@@@=! =@!
- * %@$: =@%: :*@@@* %@= Copyright (c) 2016-2019. 北京上格云技术有限公司
- * ;%@@$=$@@%* *@@@$=%@@%;
- * ::;:: ::;:: All rights reserved.
- *
- * ********************************************************************************************************************
- */
- import { SGraphyItem, SMouseEvent } from "@sybotan-web/graphy/lib";
- import { SColor, SPainter, SPoint, SRect } from "@sybotan-web/draw/lib";
- import { Column } from "../types/Column";
- import { Opt } from "../types/Opt";
- /**
- * 柱子item
- *
- * @author 郝建龙
- */
- export class ColumnItem extends SGraphyItem {
- /** 柱子数据 */
- data: Column;
- /** 柱子轮廓线坐标list */
- private readonly pointArr: SPoint[] = [];
- /**
- * 构造函数
- *
- * @param parent 指向父对象
- * @param data 柱子数据
- */
- constructor(parent: SGraphyItem | null, data: Column) {
- super(parent);
- this.data = data;
- if (this.data.OutLine.length) {
- this.pointArr = this.data.OutLine[0].map(t => {
- return new SPoint(t.X, -t.Y);
- });
- }
- } // Constructor
- /**
- * Item绘制操作
- *
- * @param painter painter对象
- * @param rect 绘制区域
- */
- onDraw(painter: SPainter, rect?: SRect): void {
- if (this.visible) {
- painter.pen.color = Opt.columnColor;
- painter.pen.lineWidth = 10;
- painter.brush.color = Opt.columnColor;
- painter.drawPolygon(this.pointArr);
- }
- } // Function onDraw()
- } // Class ColumnItem
|