|
@@ -1,5 +1,5 @@
|
|
|
|
|
|
-import { SGraphItem } from "@saga-web/graph/lib";
|
|
|
|
|
|
+import { SGraphItem, SLineStyle } from "@saga-web/graph/lib";
|
|
import { Legend } from '../types/Legend';
|
|
import { Legend } from '../types/Legend';
|
|
import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
|
|
import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
|
|
import { STextItem } from '@saga-web/graph/lib';
|
|
import { STextItem } from '@saga-web/graph/lib';
|
|
@@ -144,9 +144,19 @@ export class SZoneLegendItem extends SPolygonItem {
|
|
if (data.Properties.font) {
|
|
if (data.Properties.font) {
|
|
this.font = new SFont("sans-serif", data.Properties.font);
|
|
this.font = new SFont("sans-serif", data.Properties.font);
|
|
}
|
|
}
|
|
- // if( data.Properties.LineDash){
|
|
|
|
- // this.LineDash =this._legend.Properties.LineDash
|
|
|
|
- // }
|
|
|
|
|
|
+ switch (data.Properties.LineDash) {
|
|
|
|
+ case "solid":
|
|
|
|
+ this.lineStyle = SLineStyle.Solid;
|
|
|
|
+ break;
|
|
|
|
+ case "dotted":
|
|
|
|
+ this.lineStyle = SLineStyle.Dotted;
|
|
|
|
+ break;
|
|
|
|
+ case "dashed":
|
|
|
|
+ this.lineStyle = SLineStyle.Dashed;
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ this.lineStyle = SLineStyle.Solid;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 监听多边形创建完成事件,并动态计算文本位置
|
|
// 监听多边形创建完成事件,并动态计算文本位置
|
|
this.connect("finishCreated", this, () => {
|
|
this.connect("finishCreated", this, () => {
|
|
@@ -167,6 +177,19 @@ export class SZoneLegendItem extends SPolygonItem {
|
|
this.data.Properties.FillColor = this.fillColor.value;
|
|
this.data.Properties.FillColor = this.fillColor.value;
|
|
this.data.Properties.StrokeColor = this.strokeColor.value;
|
|
this.data.Properties.StrokeColor = this.strokeColor.value;
|
|
this.data.Properties.LineWidth = this.lineWidth;
|
|
this.data.Properties.LineWidth = this.lineWidth;
|
|
|
|
+ switch (this.lineStyle) {
|
|
|
|
+ case SLineStyle.Solid:
|
|
|
|
+ this.data.Properties.LineDash = "solid";
|
|
|
|
+ break;
|
|
|
|
+ case SLineStyle.Dotted:
|
|
|
|
+ this.data.Properties.LineDash = "dotted";
|
|
|
|
+ break;
|
|
|
|
+ case SLineStyle.Dashed:
|
|
|
|
+ this.data.Properties.LineDash = "dashed";
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ this.data.Properties.LineDash = "solid";
|
|
|
|
+ }
|
|
this.data.OutLine = this.getPointList.map(pos => {
|
|
this.data.OutLine = this.getPointList.map(pos => {
|
|
return {
|
|
return {
|
|
X: pos.x,
|
|
X: pos.x,
|