hqchart 1.1.13531 → 1.1.13537
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/umychart.vue.js +77 -72
- package/package.json +1 -1
- package/src/jscommon/umychart.js +9 -10
- package/src/jscommon/umychart.report.js +160 -22
- package/src/jscommon/umychart.style.js +1 -1
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +171 -34
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +171 -34
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -124,15 +124,14 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
124
124
|
this.OnSize=function(option)
|
|
125
125
|
{
|
|
126
126
|
//画布大小通过div获取 如果有style里的大小 使用style里的
|
|
127
|
+
var height=this.DivElement.offsetHeight;
|
|
128
|
+
var width=this.DivElement.offsetWidth;
|
|
127
129
|
if (this.DivElement.style.height && this.DivElement.style.width)
|
|
128
130
|
{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
{
|
|
134
|
-
var height=this.DivElement.offsetHeight;
|
|
135
|
-
var width=this.DivElement.offsetWidth;
|
|
131
|
+
if (this.DivElement.style.height.includes("px"))
|
|
132
|
+
height=parseInt(this.DivElement.style.height.replace("px",""));
|
|
133
|
+
if (this.DivElement.style.width.includes("px"))
|
|
134
|
+
width=parseInt(this.DivElement.style.width.replace("px",""));
|
|
136
135
|
}
|
|
137
136
|
|
|
138
137
|
if (this.ToolElement)
|
|
@@ -67198,9 +67197,9 @@ function JSChartResource()
|
|
|
67198
67197
|
Mergin:{ Left:5, Right:5, Top:4, Bottom:2 },
|
|
67199
67198
|
|
|
67200
67199
|
TabTitleColor:'rgb(60,60,60)',
|
|
67201
|
-
TabSelectedTitleColor:'rgb(
|
|
67202
|
-
TabSelectedBGColor:"rgb(
|
|
67203
|
-
TabMoveOnTitleColor:"rgb(
|
|
67200
|
+
TabSelectedTitleColor:'rgb(255,255,255)',
|
|
67201
|
+
TabSelectedBGColor:"rgb(234,85,4)",
|
|
67202
|
+
TabMoveOnTitleColor:"rgb(234,85,4)",
|
|
67204
67203
|
TabBGColor:"rgb(220,220,220)"
|
|
67205
67204
|
},
|
|
67206
67205
|
|
|
@@ -90,9 +90,18 @@ function JSReportChart(divElement)
|
|
|
90
90
|
this.OnSize=function()
|
|
91
91
|
{
|
|
92
92
|
//画布大小通过div获取
|
|
93
|
-
var height=
|
|
93
|
+
var height=this.DivElement.offsetHeight;
|
|
94
|
+
var width=this.DivElement.offsetWidth;
|
|
95
|
+
if (this.DivElement.style.height && this.DivElement.style.width)
|
|
96
|
+
{
|
|
97
|
+
if (this.DivElement.style.height.includes("px"))
|
|
98
|
+
height=parseInt(this.DivElement.style.height.replace("px",""));
|
|
99
|
+
if (this.DivElement.style.width.includes("px"))
|
|
100
|
+
width=parseInt(this.DivElement.style.width.replace("px",""));
|
|
101
|
+
}
|
|
102
|
+
|
|
94
103
|
this.CanvasElement.height=height;
|
|
95
|
-
this.CanvasElement.width=
|
|
104
|
+
this.CanvasElement.width=width;
|
|
96
105
|
this.CanvasElement.style.width=this.CanvasElement.width+'px';
|
|
97
106
|
this.CanvasElement.style.height=this.CanvasElement.height+'px';
|
|
98
107
|
|
|
@@ -132,6 +141,8 @@ function JSReportChart(divElement)
|
|
|
132
141
|
this.JSChartContainer=chart;
|
|
133
142
|
this.DivElement.JSChart=this; //div中保存一份
|
|
134
143
|
|
|
144
|
+
if (option.EnableResize==true) this.CreateResizeListener();
|
|
145
|
+
|
|
135
146
|
if (option.EnablePopMenuV2===true) chart.InitalPopMenu();
|
|
136
147
|
if (option.EnableTooltip)
|
|
137
148
|
{
|
|
@@ -223,6 +234,19 @@ function JSReportChart(divElement)
|
|
|
223
234
|
chart.Frame.ChartBorder.Bottom*=pixelTatio;
|
|
224
235
|
}
|
|
225
236
|
|
|
237
|
+
this.CreateResizeListener=function()
|
|
238
|
+
{
|
|
239
|
+
this.ResizeListener = new ResizeObserver((entries)=>{ this.OnDivResize(entries); });
|
|
240
|
+
this.ResizeListener.observe(this.DivElement);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
this.OnDivResize=function(entries)
|
|
244
|
+
{
|
|
245
|
+
JSConsole.Chart.Log("[JSReportChart::OnDivResize] entries=", entries);
|
|
246
|
+
|
|
247
|
+
this.OnSize();
|
|
248
|
+
}
|
|
249
|
+
|
|
226
250
|
/////////////////////////////////////////////////////////////////////////////
|
|
227
251
|
//对外接口
|
|
228
252
|
|
|
@@ -2979,6 +3003,7 @@ function JSReportChartContainer(uielement)
|
|
|
2979
3003
|
{
|
|
2980
3004
|
this.ExecuteMenuCommand(tabData.Tab.CommandID, [tabData.Tab.ID]);
|
|
2981
3005
|
this.SetSelectedTab(tabData.Index);
|
|
3006
|
+
redraw=true;
|
|
2982
3007
|
}
|
|
2983
3008
|
}
|
|
2984
3009
|
|
|
@@ -3077,6 +3102,7 @@ function JSReportChartContainer(uielement)
|
|
|
3077
3102
|
|
|
3078
3103
|
case REPORT_COLUMN_ID.VOL_IN_ID:
|
|
3079
3104
|
case REPORT_COLUMN_ID.VOL_OUT_ID:
|
|
3105
|
+
case REPORT_COLUMN_ID.DATE_ID:
|
|
3080
3106
|
|
|
3081
3107
|
return this.LocalNumberSort(left, right, column, sortType);
|
|
3082
3108
|
case REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID: //自定义数值字段
|
|
@@ -3251,6 +3277,31 @@ function JSReportChartContainer(uielement)
|
|
|
3251
3277
|
}
|
|
3252
3278
|
}
|
|
3253
3279
|
|
|
3280
|
+
this.LoacCustomStringSort=function(left, right, column, sortType)
|
|
3281
|
+
{
|
|
3282
|
+
var leftValue="", rightValue="";
|
|
3283
|
+
if (sortType==2) rightValue=leftValue="啊啊啊啊啊";
|
|
3284
|
+
|
|
3285
|
+
var value=this.GetStockExtendData(left, column);
|
|
3286
|
+
if (IFrameSplitOperator.IsString(value)) leftValue=value;
|
|
3287
|
+
|
|
3288
|
+
var value=this.GetStockExtendData(right, column);
|
|
3289
|
+
if (IFrameSplitOperator.IsString(value)) rightValue=value;
|
|
3290
|
+
|
|
3291
|
+
if (sortType==1)
|
|
3292
|
+
{
|
|
3293
|
+
if (rightValue<leftValue) return -1;
|
|
3294
|
+
else if (rightValue<leftValue) return 1;
|
|
3295
|
+
else return 0;
|
|
3296
|
+
}
|
|
3297
|
+
else
|
|
3298
|
+
{
|
|
3299
|
+
if (leftValue<rightValue) return -1;
|
|
3300
|
+
else if (leftValue>rightValue) return 1;
|
|
3301
|
+
else return 0;
|
|
3302
|
+
}
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3254
3305
|
this.RequestStockSortData=function(column, filedid, sortType)
|
|
3255
3306
|
{
|
|
3256
3307
|
var chart=this.ChartPaint[0];
|
|
@@ -3557,6 +3608,8 @@ var MAP_COLUMN_FIELD=new Map([
|
|
|
3557
3608
|
[REPORT_COLUMN_ID.VOL_OUT_ID,"VolOut"],
|
|
3558
3609
|
|
|
3559
3610
|
[REPORT_COLUMN_ID.NAME_EX_ID, "NameEx"],
|
|
3611
|
+
|
|
3612
|
+
[REPORT_COLUMN_ID.DATE_ID, "Date"],
|
|
3560
3613
|
]);
|
|
3561
3614
|
|
|
3562
3615
|
function ChartReport()
|
|
@@ -3689,7 +3742,11 @@ function ChartReport()
|
|
|
3689
3742
|
this.BottomToolbarHeight=0; //底部工具条高度
|
|
3690
3743
|
this.IsShowAllColumn=false; //是否已显示所有列
|
|
3691
3744
|
|
|
3692
|
-
|
|
3745
|
+
//{
|
|
3746
|
+
// Type:列id, Title:标题, TextAlign:文字对齐方式, MaxText:文字最大宽度 , TextColor:文字颜色, Sort:0=不支持排序 1=本地排序 0=远程排序,
|
|
3747
|
+
// Icon:{ Family:"iconfont", Size:12, Symbol:"", Margin: { Left:, Bottom }}
|
|
3748
|
+
//}
|
|
3749
|
+
this.Column=
|
|
3693
3750
|
[
|
|
3694
3751
|
{ Type:REPORT_COLUMN_ID.INDEX_ID, Title:"序号", TextAlign:"center", Width:null, TextColor:g_JSChartResource.Report.FieldColor.Index, MaxText:"8888"},
|
|
3695
3752
|
{ Type:REPORT_COLUMN_ID.SYMBOL_ID, Title:"代码", TextAlign:"left", Width:null, TextColor:g_JSChartResource.Report.FieldColor.Symbol, MaxText:"888888"},
|
|
@@ -3804,6 +3861,7 @@ function ChartReport()
|
|
|
3804
3861
|
if (IFrameSplitOperator.IsBool(item.EnableDragWidth)) colItem.EnableDragWidth=item.EnableDragWidth;
|
|
3805
3862
|
if (IFrameSplitOperator.IsBool(item.IsDrawCallback)) colItem.IsDrawCallback=item.IsDrawCallback;
|
|
3806
3863
|
else colItem.IsDrawCallback=false;
|
|
3864
|
+
if (item.Icon) colItem.Icon=item.Icon;
|
|
3807
3865
|
|
|
3808
3866
|
if (item.Sort==1 || item.Sort==2) //1本地排序 2=远程排序
|
|
3809
3867
|
{
|
|
@@ -4109,6 +4167,17 @@ function ChartReport()
|
|
|
4109
4167
|
|
|
4110
4168
|
item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;
|
|
4111
4169
|
}
|
|
4170
|
+
|
|
4171
|
+
if (item.Icon && item.Icon.Symbol)
|
|
4172
|
+
{
|
|
4173
|
+
item.Width+=item.Icon.Size;
|
|
4174
|
+
if (item.Icon.Margin)
|
|
4175
|
+
{
|
|
4176
|
+
var margin=item.Icon.Margin;
|
|
4177
|
+
if (IFrameSplitOperator.IsNumber(margin.Left)) item.Width+=margin.Left;
|
|
4178
|
+
if (IFrameSplitOperator.IsNumber(margin.Right)) item.Width+=margin.Right;
|
|
4179
|
+
}
|
|
4180
|
+
}
|
|
4112
4181
|
}
|
|
4113
4182
|
|
|
4114
4183
|
this.Canvas.font=this.HeaderFont;
|
|
@@ -4168,16 +4237,36 @@ function ChartReport()
|
|
|
4168
4237
|
this.DrawItemBG({ Rect:rtBG, BGColor:item.HeaderBGColor });
|
|
4169
4238
|
}
|
|
4170
4239
|
|
|
4240
|
+
var iconWidth=0;
|
|
4241
|
+
if (item.Icon && item.Icon.Symbol) //图标
|
|
4242
|
+
{
|
|
4243
|
+
var iconWidth=item.Icon.Size;
|
|
4244
|
+
if (item.Icon.Margin)
|
|
4245
|
+
{
|
|
4246
|
+
var margin=item.Icon.Margin;
|
|
4247
|
+
if (IFrameSplitOperator.IsNumber(margin.Left)) iconWidth+=margin.Left;
|
|
4248
|
+
if (IFrameSplitOperator.IsNumber(margin.Right)) iconWidth+=margin.Right;
|
|
4249
|
+
}
|
|
4250
|
+
}
|
|
4251
|
+
textWidth-=iconWidth;
|
|
4252
|
+
|
|
4171
4253
|
if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
|
|
4172
4254
|
else this.Canvas.fillStyle=this.HeaderColor;
|
|
4173
4255
|
|
|
4256
|
+
var textSize={ }
|
|
4174
4257
|
if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
|
|
4175
4258
|
{
|
|
4176
|
-
this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
|
|
4259
|
+
this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort, textSize);
|
|
4177
4260
|
}
|
|
4178
4261
|
else
|
|
4179
4262
|
{
|
|
4180
|
-
this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
|
|
4263
|
+
this.DrawText(item.Title,item.TextAlign,x,y,textWidth,textSize);
|
|
4264
|
+
}
|
|
4265
|
+
|
|
4266
|
+
if (iconWidth>0)
|
|
4267
|
+
{
|
|
4268
|
+
this.DrawHeaderIcon(item.Icon, textSize.Right, y, i, item);
|
|
4269
|
+
this.Canvas.font=this.HeaderFont;
|
|
4181
4270
|
}
|
|
4182
4271
|
|
|
4183
4272
|
this.Canvas.fillStyle=this.HeaderColor;
|
|
@@ -4200,44 +4289,91 @@ function ChartReport()
|
|
|
4200
4289
|
this.DrawItemBG({ Rect:rtBG, BGColor:item.HeaderBGColor });
|
|
4201
4290
|
}
|
|
4202
4291
|
|
|
4292
|
+
var iconWidth=0;
|
|
4293
|
+
if (item.Icon && item.Icon.Symbol) //图标
|
|
4294
|
+
{
|
|
4295
|
+
var iconWidth=item.Icon.Size;
|
|
4296
|
+
if (item.Icon.Margin)
|
|
4297
|
+
{
|
|
4298
|
+
var margin=item.Icon.Margin;
|
|
4299
|
+
if (IFrameSplitOperator.IsNumber(margin.Left)) iconWidth+=margin.Left;
|
|
4300
|
+
if (IFrameSplitOperator.IsNumber(margin.Right)) iconWidth+=margin.Right;
|
|
4301
|
+
}
|
|
4302
|
+
}
|
|
4303
|
+
|
|
4304
|
+
textWidth-=iconWidth;
|
|
4305
|
+
|
|
4203
4306
|
if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
|
|
4204
4307
|
else this.Canvas.fillStyle=this.HeaderColor;
|
|
4205
4308
|
|
|
4309
|
+
var textSize={ }
|
|
4206
4310
|
if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
|
|
4207
4311
|
{
|
|
4208
|
-
this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
|
|
4312
|
+
this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort,textSize);
|
|
4209
4313
|
}
|
|
4210
4314
|
else
|
|
4211
4315
|
{
|
|
4212
|
-
this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
|
|
4316
|
+
this.DrawText(item.Title,item.TextAlign,x,y,textWidth,textSize);
|
|
4317
|
+
}
|
|
4318
|
+
|
|
4319
|
+
if (iconWidth>0)
|
|
4320
|
+
{
|
|
4321
|
+
this.DrawHeaderIcon(item.Icon, textSize.Right, y, i, item);
|
|
4322
|
+
this.Canvas.font=this.HeaderFont;
|
|
4213
4323
|
}
|
|
4214
4324
|
|
|
4215
4325
|
textLeft+=item.Width;
|
|
4216
4326
|
}
|
|
4217
4327
|
}
|
|
4218
4328
|
|
|
4219
|
-
this.DrawText=function(text, textAlign, x, y,
|
|
4329
|
+
this.DrawText=function(text, textAlign, x, y, cellWidth, textSize)
|
|
4220
4330
|
{
|
|
4331
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
4221
4332
|
if (textAlign=='center')
|
|
4222
4333
|
{
|
|
4223
|
-
x=x+textWidth/2;
|
|
4224
|
-
this.Canvas.textAlign="center";
|
|
4334
|
+
x=x+(cellWidth-textWidth)/2;
|
|
4225
4335
|
}
|
|
4226
4336
|
else if (textAlign=='right')
|
|
4227
4337
|
{
|
|
4228
|
-
x=x+textWidth;
|
|
4229
|
-
this.Canvas.textAlign="right";
|
|
4230
|
-
}
|
|
4231
|
-
else
|
|
4232
|
-
{
|
|
4233
|
-
this.Canvas.textAlign="left";
|
|
4338
|
+
x=x+cellWidth-textWidth;
|
|
4234
4339
|
}
|
|
4235
4340
|
|
|
4341
|
+
this.Canvas.textAlign="left";
|
|
4236
4342
|
this.Canvas.textBaseline="middle";
|
|
4237
4343
|
this.Canvas.fillText(text,x,y);
|
|
4344
|
+
|
|
4345
|
+
if (textSize)
|
|
4346
|
+
{
|
|
4347
|
+
textSize.Right=x+textWidth;
|
|
4348
|
+
textSize.Width=textWidth;
|
|
4349
|
+
}
|
|
4350
|
+
}
|
|
4351
|
+
|
|
4352
|
+
this.DrawHeaderIcon=function(icon, x, y, index, column)
|
|
4353
|
+
{
|
|
4354
|
+
var iconFont=`${icon.Size}px ${icon.Family}`;
|
|
4355
|
+
this.Canvas.font=iconFont;
|
|
4356
|
+
this.Canvas.textAlign="left";
|
|
4357
|
+
if (icon.Color) this.Canvas.fillStyle=icon.Color;
|
|
4358
|
+
|
|
4359
|
+
var xIcon=x;
|
|
4360
|
+
var yIcon=y;
|
|
4361
|
+
if (icon.Margin && IFrameSplitOperator.IsNumber(icon.Margin.Left)) xIcon+=icon.Margin.Left;
|
|
4362
|
+
if (icon.Margin && IFrameSplitOperator.IsNumber(icon.Margin.Bottom)) yIcon-=icon.Margin.Bottom;
|
|
4363
|
+
this.Canvas.fillText(icon.Symbol, xIcon, yIcon);
|
|
4364
|
+
|
|
4365
|
+
if (icon.Tooltip)
|
|
4366
|
+
{
|
|
4367
|
+
var rtIcon={ Left:xIcon, Top:yIcon-icon.Size/2, Width:icon.Size, Height:icon.Size };
|
|
4368
|
+
rtIcon.Right=rtIcon.Left+rtIcon.Width;
|
|
4369
|
+
rtIcon.Bottom=rtIcon.Top+rtIcon.Height;
|
|
4370
|
+
|
|
4371
|
+
var tooltipData={ Rect:rtIcon, Type:2, Column:column, Index:index, Data:icon.Tooltip.Data };
|
|
4372
|
+
this.TooltipRect.push(tooltipData);
|
|
4373
|
+
}
|
|
4238
4374
|
}
|
|
4239
4375
|
|
|
4240
|
-
this.DrawSortHeader=function(text, textAlign, x, y, width, sortType)
|
|
4376
|
+
this.DrawSortHeader=function(text, textAlign, x, y, width, sortType,textSize)
|
|
4241
4377
|
{
|
|
4242
4378
|
var sortText=sortType==1?"↓":"↑";
|
|
4243
4379
|
var sortTextWidth=this.Canvas.measureText(sortText).width;
|
|
@@ -4253,15 +4389,17 @@ function ChartReport()
|
|
|
4253
4389
|
{
|
|
4254
4390
|
x=(x+width)-sortTextWidth-textWidth;
|
|
4255
4391
|
}
|
|
4256
|
-
else
|
|
4257
|
-
{
|
|
4258
|
-
|
|
4259
|
-
}
|
|
4260
4392
|
|
|
4261
4393
|
this.Canvas.fillText(text,x,y);
|
|
4262
4394
|
this.Canvas.fillStyle=this.SortColor;
|
|
4263
4395
|
this.Canvas.fillText(sortText,x+textWidth,y);
|
|
4264
4396
|
this.Canvas.fillStyle=this.HeaderColor;
|
|
4397
|
+
|
|
4398
|
+
if (textSize)
|
|
4399
|
+
{
|
|
4400
|
+
textSize.Right=x+textWidth+sortTextWidth;
|
|
4401
|
+
textSize.Width=textWidth+sortTextWidth;
|
|
4402
|
+
}
|
|
4265
4403
|
}
|
|
4266
4404
|
|
|
4267
4405
|
|
|
@@ -6870,7 +7008,7 @@ function ChartCellTooltip()
|
|
|
6870
7008
|
if (item.TitleColor) this.Canvas.fillStyle=item.TitleColor;
|
|
6871
7009
|
else this.Canvas.fillStyle=this.TextColor;
|
|
6872
7010
|
this.Canvas.fillText(item.Title,xText,yText,itemSize.TitleWidth);
|
|
6873
|
-
xText+=itemSize.
|
|
7011
|
+
xText+=itemSize.TitleWidth;
|
|
6874
7012
|
if (IFrameSplitOperator.IsNumber(item.Space)) xText+=item.Space;
|
|
6875
7013
|
}
|
|
6876
7014
|
|
|
@@ -592,7 +592,7 @@ function GetBlackStyle()
|
|
|
592
592
|
|
|
593
593
|
TabTitleColor:'rgb(153,153,153)',
|
|
594
594
|
TabSelectedTitleColor:'rgb(255,255,255)',
|
|
595
|
-
TabSelectedBGColor:"rgb(
|
|
595
|
+
TabSelectedBGColor:"rgb(234,85,4)",
|
|
596
596
|
TabMoveOnTitleColor:"rgb(255,255,255)",
|
|
597
597
|
TabBGColor:"rgb(28,28,31)"
|
|
598
598
|
},
|