hqchart 1.1.13573 → 1.1.13584
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 +72 -58
- package/package.json +1 -1
- package/src/jscommon/umychart.js +91 -2
- package/src/jscommon/umychart.report.js +329 -31
- package/src/jscommon/umychart.scrollbar.js +76 -17
- package/src/jscommon/umychart.style.js +23 -2
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +519 -52
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +519 -52
|
@@ -460,7 +460,8 @@ function JSReportChartContainer(uielement)
|
|
|
460
460
|
this.JSPopMenu; //内置菜单
|
|
461
461
|
this.IsShowRightMenu=true;
|
|
462
462
|
|
|
463
|
-
|
|
463
|
+
//MouseOnStatus:{ RowIndex:行, ColumnIndex:列}
|
|
464
|
+
this.LastMouseStatus={ MoveStatus:null, TooltipStatus:null, MouseOnStatus:null };
|
|
464
465
|
|
|
465
466
|
this.ChartDestory=function() //销毁
|
|
466
467
|
{
|
|
@@ -699,6 +700,7 @@ function JSReportChartContainer(uielement)
|
|
|
699
700
|
this.Canvas.clearRect(0,0,this.UIElement.width,this.UIElement.height);
|
|
700
701
|
var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
|
|
701
702
|
this.Canvas.lineWidth=pixelTatio; //手机端需要根据分辨率比调整线段宽度
|
|
703
|
+
this.LastMouseStatus.MouseOnStatus=null;
|
|
702
704
|
|
|
703
705
|
if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash)
|
|
704
706
|
{
|
|
@@ -715,14 +717,14 @@ function JSReportChartContainer(uielement)
|
|
|
715
717
|
{
|
|
716
718
|
var item=this.ChartPaint[i];
|
|
717
719
|
if (item.IsDrawFirst)
|
|
718
|
-
item.Draw();
|
|
720
|
+
item.Draw(this.LastMouseStatus);
|
|
719
721
|
}
|
|
720
722
|
|
|
721
723
|
for(var i=0; i<this.ChartPaint.length; ++i)
|
|
722
724
|
{
|
|
723
725
|
var item=this.ChartPaint[i];
|
|
724
726
|
if (!item.IsDrawFirst)
|
|
725
|
-
item.Draw();
|
|
727
|
+
item.Draw(this.LastMouseStatus);
|
|
726
728
|
}
|
|
727
729
|
|
|
728
730
|
if (this.GlobalOption.FlashBGCount>0)
|
|
@@ -1753,6 +1755,7 @@ function JSReportChartContainer(uielement)
|
|
|
1753
1755
|
var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
|
|
1754
1756
|
var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
|
|
1755
1757
|
|
|
1758
|
+
var oldMouseOnStatus=this.LastMouseStatus.MouseOnStatus;
|
|
1756
1759
|
this.LastMouseStatus.OnMouseMove=null;
|
|
1757
1760
|
|
|
1758
1761
|
var bDrawTooltip=false;
|
|
@@ -1764,6 +1767,7 @@ function JSReportChartContainer(uielement)
|
|
|
1764
1767
|
if (this.DragColumnWidth) return;
|
|
1765
1768
|
|
|
1766
1769
|
var tabChart=this.GetTabChart();
|
|
1770
|
+
var bDrawTab=false;
|
|
1767
1771
|
if (tabChart)
|
|
1768
1772
|
{
|
|
1769
1773
|
var tabData=tabChart.PtInTab(x,y);
|
|
@@ -1773,8 +1777,17 @@ function JSReportChartContainer(uielement)
|
|
|
1773
1777
|
if (tabChart.MoveOnTabIndex!=index)
|
|
1774
1778
|
{
|
|
1775
1779
|
tabChart.MoveOnTabIndex=index;
|
|
1776
|
-
|
|
1780
|
+
bDrawTab=true;
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
else
|
|
1784
|
+
{
|
|
1785
|
+
if (tabChart.MoveOnTabIndex>=0)
|
|
1786
|
+
{
|
|
1787
|
+
tabChart.MoveOnTabIndex=-1;
|
|
1788
|
+
bDrawTab=true;
|
|
1777
1789
|
}
|
|
1790
|
+
|
|
1778
1791
|
}
|
|
1779
1792
|
}
|
|
1780
1793
|
|
|
@@ -1793,12 +1806,28 @@ function JSReportChartContainer(uielement)
|
|
|
1793
1806
|
}
|
|
1794
1807
|
else
|
|
1795
1808
|
{
|
|
1796
|
-
var
|
|
1797
|
-
|
|
1809
|
+
var buttonData=report.GetButtonData(x,y);
|
|
1810
|
+
var mouseOnStatus=null;
|
|
1811
|
+
if (buttonData)
|
|
1798
1812
|
{
|
|
1799
1813
|
mouseStatus={ Cursor:"pointer", Name:"Botton"};
|
|
1814
|
+
if (buttonData.Type==1 || buttonData.Type==0 || buttonData.Type==2)
|
|
1815
|
+
{
|
|
1816
|
+
mouseOnStatus={ Index:buttonData.Index, ColumnIndex:buttonData.ColumnIndex };
|
|
1817
|
+
}
|
|
1800
1818
|
}
|
|
1801
1819
|
|
|
1820
|
+
//console.log("[UIOnMouseMove] ", oldMouseOnStatus, mouseOnStatus)
|
|
1821
|
+
if ((!oldMouseOnStatus && mouseOnStatus) || (oldMouseOnStatus && !mouseOnStatus))
|
|
1822
|
+
{
|
|
1823
|
+
bDraw=true;
|
|
1824
|
+
}
|
|
1825
|
+
else if (oldMouseOnStatus && mouseOnStatus)
|
|
1826
|
+
{
|
|
1827
|
+
if (oldMouseOnStatus.Index!=mouseOnStatus.Index || oldMouseOnStatus.ColumnIndex!=mouseOnStatus.ColumnIndex)
|
|
1828
|
+
bDraw=true;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1802
1831
|
var tooltipData=report.GetTooltipData(x,y); //单元格提示信息
|
|
1803
1832
|
if (tooltipData)
|
|
1804
1833
|
{
|
|
@@ -1832,7 +1861,7 @@ function JSReportChartContainer(uielement)
|
|
|
1832
1861
|
|
|
1833
1862
|
if (mouseStatus) this.UIElement.style.cursor=mouseStatus.Cursor;
|
|
1834
1863
|
|
|
1835
|
-
if (bDraw) this.Draw();
|
|
1864
|
+
if (bDraw || bDrawTab) this.Draw();
|
|
1836
1865
|
else if (bDrawTooltip) this.DrawTooltip(this.LastMouseStatus.TooltipStatus);
|
|
1837
1866
|
}
|
|
1838
1867
|
|
|
@@ -3150,7 +3179,7 @@ function JSReportChartContainer(uielement)
|
|
|
3150
3179
|
switch(cmdID)
|
|
3151
3180
|
{
|
|
3152
3181
|
case JSCHART_MENU_ID.CMD_REPORT_CHANGE_BLOCK_ID:
|
|
3153
|
-
if (srcParam) this.ChangeSymbol(
|
|
3182
|
+
if (srcParam) this.ChangeSymbol(srcParam);
|
|
3154
3183
|
break;
|
|
3155
3184
|
}
|
|
3156
3185
|
}
|
|
@@ -3681,6 +3710,8 @@ var REPORT_COLUMN_ID=
|
|
|
3681
3710
|
CUSTOM_ICON_ID:103, //自定义图标
|
|
3682
3711
|
CUSTOM_CHECKBOX_ID:104, //自定义checkbox
|
|
3683
3712
|
CUSTOM_BUTTON_ID:105, //自定义按钮
|
|
3713
|
+
CUSTOM_PROGRESS_ID:106, //进度条
|
|
3714
|
+
CUSTOM_LINK_ID:107, //链接
|
|
3684
3715
|
}
|
|
3685
3716
|
|
|
3686
3717
|
var MAP_COLUMN_FIELD=new Map([
|
|
@@ -3851,6 +3882,9 @@ function ChartReport()
|
|
|
3851
3882
|
}
|
|
3852
3883
|
|
|
3853
3884
|
this.CheckBoxConfig=CloneData(g_JSChartResource.Report.CheckBox);
|
|
3885
|
+
this.LinkConfig=CloneData(g_JSChartResource.Report.Link);
|
|
3886
|
+
this.ProgressBarConfig=CloneData(g_JSChartResource.Report.ProgressBar);
|
|
3887
|
+
this.ButtonConfig=CloneData(g_JSChartResource.Report.Button);
|
|
3854
3888
|
|
|
3855
3889
|
//股票代码+股票名称
|
|
3856
3890
|
this.ItemSymbolFontConfig={Size:g_JSChartResource.Report.Item.SymbolFont.Size, Name:g_JSChartResource.Report.Item.SymbolFont.Name};
|
|
@@ -3894,6 +3928,8 @@ function ChartReport()
|
|
|
3894
3928
|
//{ Rect:rtItem, Type: 0=checkedbox, 1=button, 2=link , Stock, Index:index, Column:column }
|
|
3895
3929
|
this.ButtonRect=[];
|
|
3896
3930
|
|
|
3931
|
+
this.LastMouseStatus;
|
|
3932
|
+
|
|
3897
3933
|
this.ReloadResource=function(resource)
|
|
3898
3934
|
{
|
|
3899
3935
|
this.DevicePixelRatio=GetDevicePixelRatio()
|
|
@@ -3984,6 +4020,10 @@ function ChartReport()
|
|
|
3984
4020
|
|
|
3985
4021
|
if (this.Tab) this.Tab.ReloadResource(resource);
|
|
3986
4022
|
if (this.VScrollbar) this.VScrollbar.ReloadResource(resource);
|
|
4023
|
+
|
|
4024
|
+
this.CheckBoxConfig=CloneData(g_JSChartResource.Report.CheckBox);
|
|
4025
|
+
this.LinkConfig=CloneData(g_JSChartResource.Report.Link);
|
|
4026
|
+
this.ProgressBarConfig=CloneData(g_JSChartResource.Report.ProgressBar);
|
|
3987
4027
|
}
|
|
3988
4028
|
|
|
3989
4029
|
this.SetColumn=function(aryColumn)
|
|
@@ -4055,7 +4095,7 @@ function ChartReport()
|
|
|
4055
4095
|
if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
|
|
4056
4096
|
if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
|
|
4057
4097
|
if (item.CheckBox) colItem.CheckBox=CloneData(item.CheckBox);
|
|
4058
|
-
else colItem.CheckBox=
|
|
4098
|
+
else colItem.CheckBox=this.CheckBoxConfig;
|
|
4059
4099
|
}
|
|
4060
4100
|
else if (item.Type==REPORT_COLUMN_ID.CUSTOM_BUTTON_ID)
|
|
4061
4101
|
{
|
|
@@ -4063,6 +4103,23 @@ function ChartReport()
|
|
|
4063
4103
|
if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
|
|
4064
4104
|
if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
|
|
4065
4105
|
if (item.Button) colItem.Button=CloneData(item.Button);
|
|
4106
|
+
else colItem.Button=this.ButtonConfig;
|
|
4107
|
+
}
|
|
4108
|
+
else if (item.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID)
|
|
4109
|
+
{
|
|
4110
|
+
if (!IFrameSplitOperator.IsNumber(item.DataIndex) && !IFrameSplitOperator.IsNumber(item.BlockIndex)) continue;
|
|
4111
|
+
if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
|
|
4112
|
+
if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
|
|
4113
|
+
if (item.ProgressBar) colItem.ProgressBar=CloneData(item.ProgressBar);
|
|
4114
|
+
else colItem.ProgressBar=this.ProgressBarConfig;
|
|
4115
|
+
}
|
|
4116
|
+
else if (item.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
|
|
4117
|
+
{
|
|
4118
|
+
if (!IFrameSplitOperator.IsNumber(item.DataIndex) && !IFrameSplitOperator.IsNumber(item.BlockIndex)) continue;
|
|
4119
|
+
if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
|
|
4120
|
+
if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
|
|
4121
|
+
if (item.Link) colItem.Link=CloneData(item.Link);
|
|
4122
|
+
else colItem.Link=this.LinkConfig;
|
|
4066
4123
|
}
|
|
4067
4124
|
else if (item.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID)
|
|
4068
4125
|
{
|
|
@@ -4181,7 +4238,9 @@ function ChartReport()
|
|
|
4181
4238
|
|
|
4182
4239
|
{ Type:REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID, Title:"", TextAlign:"center", FixedWidth:20*GetDevicePixelRatio() },
|
|
4183
4240
|
|
|
4184
|
-
{ Type:REPORT_COLUMN_ID.CUSTOM_BUTTON_ID, Title:"", TextAlign:"center", FixedWidth:50*GetDevicePixelRatio() }
|
|
4241
|
+
{ Type:REPORT_COLUMN_ID.CUSTOM_BUTTON_ID, Title:"", TextAlign:"center", FixedWidth:50*GetDevicePixelRatio() },
|
|
4242
|
+
{ Type:REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID, Title:"进度条", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
|
|
4243
|
+
{ Type:REPORT_COLUMN_ID.CUSTOM_LINK_ID, Title:"链接地址", TextAlign:"center", MaxText:"擎擎擎擎擎" }
|
|
4185
4244
|
];
|
|
4186
4245
|
|
|
4187
4246
|
for(var i=0;i<DEFAULT_COLUMN.length;++i)
|
|
@@ -4202,12 +4261,13 @@ function ChartReport()
|
|
|
4202
4261
|
this.Canvas.clip();
|
|
4203
4262
|
}
|
|
4204
4263
|
|
|
4205
|
-
this.Draw=function()
|
|
4264
|
+
this.Draw=function(lastMouseStatus)
|
|
4206
4265
|
{
|
|
4207
4266
|
this.ShowSymbol=[];
|
|
4208
4267
|
this.TooltipRect=[];
|
|
4209
4268
|
this.ButtonRect=[];
|
|
4210
4269
|
this.DevicePixelRatio=GetDevicePixelRatio()
|
|
4270
|
+
this.LastMouseStatus=lastMouseStatus;
|
|
4211
4271
|
|
|
4212
4272
|
if (this.GlobalOption) this.GlobalOption.FlashBGCount=0;
|
|
4213
4273
|
|
|
@@ -4239,6 +4299,7 @@ function ChartReport()
|
|
|
4239
4299
|
this.VScrollbar.DrawScrollbar(this.RectClient.Left,this.RectClient.Top+this.HeaderHeight, this.RectClient.Right, bottom-this.BottomToolbarHeight-4);
|
|
4240
4300
|
}
|
|
4241
4301
|
|
|
4302
|
+
this.LastMouseStatus=null;
|
|
4242
4303
|
this.SizeChange=false;
|
|
4243
4304
|
}
|
|
4244
4305
|
|
|
@@ -4878,7 +4939,7 @@ function ChartReport()
|
|
|
4878
4939
|
for(var i=0;i<this.FixedColumn && i<this.Column.length;++i)
|
|
4879
4940
|
{
|
|
4880
4941
|
var item=this.Column[i];
|
|
4881
|
-
this.DrawItem(dataIndex, data, item, left, top, rowType);
|
|
4942
|
+
this.DrawItem(dataIndex, data, item, left, top, rowType, i);
|
|
4882
4943
|
left+=item.Width;
|
|
4883
4944
|
|
|
4884
4945
|
if (left>=chartRight) break;
|
|
@@ -4887,20 +4948,24 @@ function ChartReport()
|
|
|
4887
4948
|
for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i)
|
|
4888
4949
|
{
|
|
4889
4950
|
var item=this.Column[i];
|
|
4890
|
-
this.DrawItem(dataIndex, data, item, left, top, rowType);
|
|
4951
|
+
this.DrawItem(dataIndex, data, item, left, top, rowType, i);
|
|
4891
4952
|
left+=item.Width;
|
|
4892
4953
|
|
|
4893
4954
|
if (left>=chartRight) break;
|
|
4894
4955
|
}
|
|
4895
4956
|
}
|
|
4896
4957
|
|
|
4897
|
-
this.DrawItem=function(index, data, column, left, top, rowType)
|
|
4958
|
+
this.DrawItem=function(index, data, column, left, top, rowType, columnIndex)
|
|
4898
4959
|
{
|
|
4899
4960
|
var itemWidth=column.Width;
|
|
4900
4961
|
var x=left+this.ItemMergin.Left;
|
|
4901
4962
|
var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;
|
|
4902
4963
|
var stock=data.Stock;
|
|
4903
|
-
var drawInfo=
|
|
4964
|
+
var drawInfo=
|
|
4965
|
+
{
|
|
4966
|
+
Text:null, TextColor:column.TextColor , TextAlign:column.TextAlign, Tooltip:null,
|
|
4967
|
+
Index:index, ColumnIndex:columnIndex
|
|
4968
|
+
};
|
|
4904
4969
|
var rtItem={ Left:left, Top:top, Width:column.Width, Height:this.RowHeight };
|
|
4905
4970
|
rtItem.Right=rtItem.Left+rtItem.Width;
|
|
4906
4971
|
rtItem.Bottom=rtItem.Top+rtItem.Height;
|
|
@@ -5154,6 +5219,19 @@ function ChartReport()
|
|
|
5154
5219
|
|
|
5155
5220
|
this.GetCustomButtonDrawInfo(data, column, drawInfo);
|
|
5156
5221
|
}
|
|
5222
|
+
else if (column.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID)
|
|
5223
|
+
{
|
|
5224
|
+
rtItem={ Left:left, Top:top, Width:column.Width, Height:this.RowHeight };
|
|
5225
|
+
rtItem.Right=rtItem.Left+rtItem.Width;
|
|
5226
|
+
rtItem.Bottom=rtItem.Top+rtItem.Height;
|
|
5227
|
+
drawInfo.Rect=rtItem;
|
|
5228
|
+
|
|
5229
|
+
this.GetCustomProgressBarDrawInfo(data, column, drawInfo);
|
|
5230
|
+
}
|
|
5231
|
+
else if (column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
|
|
5232
|
+
{
|
|
5233
|
+
this.GetCustomLinkDrawInfo(data, column, drawInfo);
|
|
5234
|
+
}
|
|
5157
5235
|
|
|
5158
5236
|
|
|
5159
5237
|
//拖拽行颜色
|
|
@@ -5176,6 +5254,14 @@ function ChartReport()
|
|
|
5176
5254
|
{
|
|
5177
5255
|
this.DrawButton(drawInfo, left, top, itemWidth);
|
|
5178
5256
|
}
|
|
5257
|
+
else if (column.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID)
|
|
5258
|
+
{
|
|
5259
|
+
this.DrawProgressBar(drawInfo, left, top, itemWidth);
|
|
5260
|
+
}
|
|
5261
|
+
else if (column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
|
|
5262
|
+
{
|
|
5263
|
+
this.DrawLinkText(drawInfo, x, top, textWidth);
|
|
5264
|
+
}
|
|
5179
5265
|
else
|
|
5180
5266
|
{
|
|
5181
5267
|
if (data.FlashBG && data.FlashBG.Data && column.ID!=undefined)
|
|
@@ -5209,7 +5295,7 @@ function ChartReport()
|
|
|
5209
5295
|
|
|
5210
5296
|
if (drawInfo.Botton)
|
|
5211
5297
|
{
|
|
5212
|
-
var buttonData={ Stock:stock, Index:index, Column:column, Rect:drawInfo.Botton.Rect, Type:drawInfo.Botton.Type, Data:drawInfo.Data };
|
|
5298
|
+
var buttonData={ Stock:stock, Index:index, ColumnIndex:columnIndex, Column:column, Rect:drawInfo.Botton.Rect, Type:drawInfo.Botton.Type, Data:drawInfo.Data };
|
|
5213
5299
|
this.ButtonRect.push(buttonData);
|
|
5214
5300
|
}
|
|
5215
5301
|
}
|
|
@@ -5491,6 +5577,36 @@ function ChartReport()
|
|
|
5491
5577
|
if (IFrameSplitOperator.IsBool(buttonData.Enable)) drawInfo.Enable=buttonData.Enable;
|
|
5492
5578
|
}
|
|
5493
5579
|
|
|
5580
|
+
this.GetCustomProgressBarDrawInfo=function(data, column, drawInfo)
|
|
5581
|
+
{
|
|
5582
|
+
var barData=this.GetExtendData(data, column);
|
|
5583
|
+
if (!barData) return;
|
|
5584
|
+
|
|
5585
|
+
drawInfo.Text=barData.Title;
|
|
5586
|
+
drawInfo.ProgressBar=column.ProgressBar;
|
|
5587
|
+
drawInfo.Enable=true;
|
|
5588
|
+
drawInfo.Value=barData.Value; //占比
|
|
5589
|
+
drawInfo.Data=barData;
|
|
5590
|
+
if (IFrameSplitOperator.IsBool(barData.Enable)) drawInfo.Enable=barData.Enable;
|
|
5591
|
+
if (barData.TextColor) drawInfo.TextColor=barData.TextColor;
|
|
5592
|
+
if (barData.BarColor) drawInfo.BarColor=barData.BarColor;
|
|
5593
|
+
if (barData.BGColor) drawInfo.BGColor=barData.BGColor;
|
|
5594
|
+
}
|
|
5595
|
+
|
|
5596
|
+
this.GetCustomLinkDrawInfo=function(data, column, drawInfo)
|
|
5597
|
+
{
|
|
5598
|
+
var linkData=this.GetExtendData(data, column);
|
|
5599
|
+
if (!linkData) return;
|
|
5600
|
+
|
|
5601
|
+
drawInfo.Text=linkData.Title;
|
|
5602
|
+
drawInfo.Link=column.Link;
|
|
5603
|
+
drawInfo.Enable=true;
|
|
5604
|
+
drawInfo.Data=linkData;
|
|
5605
|
+
drawInfo.MaxText=column.MaxText;
|
|
5606
|
+
if (IFrameSplitOperator.IsBool(linkData.Enable)) drawInfo.Enable=linkData.Enable;
|
|
5607
|
+
if (linkData.TextColor) drawInfo.TextColor=linkData.TextColor;
|
|
5608
|
+
}
|
|
5609
|
+
|
|
5494
5610
|
this.FormaTimeDrawInfo=function(column, stock, drawInfo, data)
|
|
5495
5611
|
{
|
|
5496
5612
|
if (!IFrameSplitOperator.IsNumber(stock.Time)) return;
|
|
@@ -5760,35 +5876,57 @@ function ChartReport()
|
|
|
5760
5876
|
if (!IFrameSplitOperator.IsBool(drawInfo.Checked)) return;
|
|
5761
5877
|
if (!drawInfo.CheckBox) return;
|
|
5762
5878
|
|
|
5763
|
-
|
|
5879
|
+
var config=drawInfo.CheckBox;
|
|
5880
|
+
drawInfo.Font=`${config.Size*this.DevicePixelRatio}px ${config.Family}`;
|
|
5764
5881
|
var textAlign=drawInfo.TextAlign;
|
|
5765
5882
|
var size=drawInfo.CheckBox.Size*this.DevicePixelRatio;
|
|
5766
5883
|
var x=left+drawInfo.CheckBox.Margin.Left;
|
|
5767
5884
|
var y=top+this.RowHeight-drawInfo.CheckBox.Margin.Bottom;
|
|
5885
|
+
|
|
5768
5886
|
if (textAlign=='center') x=left+width/2-size/2;
|
|
5769
|
-
else if (textAlign=='right') x=left+width-
|
|
5887
|
+
else if (textAlign=='right') x=left+width-config.Margin.Right;
|
|
5888
|
+
|
|
5889
|
+
var rtBox={ Left:x, Bottom:y, Width:size, Height:size };
|
|
5890
|
+
rtBox.Right=rtBox.Left+rtBox.Width;
|
|
5891
|
+
rtBox.Top=rtBox.Bottom-rtBox.Height;
|
|
5892
|
+
|
|
5893
|
+
//鼠标在上面
|
|
5894
|
+
var bMouseOn=false;
|
|
5895
|
+
if (drawInfo.Enable && this.LastMouseStatus && this.LastMouseStatus.OnMouseMove)
|
|
5896
|
+
{
|
|
5897
|
+
var xMouse=this.LastMouseStatus.OnMouseMove.X;
|
|
5898
|
+
var yMouse=this.LastMouseStatus.OnMouseMove.Y;
|
|
5899
|
+
if (xMouse>rtBox.Left && xMouse<rtBox.Right && yMouse>rtBox.Top && yMouse<rtBox.Bottom)
|
|
5900
|
+
{
|
|
5901
|
+
bMouseOn=true;
|
|
5902
|
+
this.LastMouseStatus.MouseOnStatus={ Index:drawInfo.Index, ColumnIndex:drawInfo.ColumnIndex, Type:0 };
|
|
5903
|
+
}
|
|
5904
|
+
}
|
|
5770
5905
|
|
|
5771
5906
|
this.Canvas.font=drawInfo.Font;
|
|
5772
5907
|
this.Canvas.textBaseline="bottom";
|
|
5773
5908
|
this.Canvas.textAlign="left";
|
|
5774
5909
|
if (drawInfo.Checked===true)
|
|
5775
5910
|
{
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5911
|
+
var textColor=config.Checked.Color;
|
|
5912
|
+
if (drawInfo.Enable===false) textColor=config.Checked.DisableColor;
|
|
5913
|
+
else if (bMouseOn) textColor=config.Checked.MouseOnColor;
|
|
5914
|
+
|
|
5915
|
+
this.Canvas.fillStyle=textColor;
|
|
5916
|
+
this.Canvas.fillText(config.Checked.Symbol,x,y);
|
|
5779
5917
|
}
|
|
5780
5918
|
else if (drawInfo.Checked===false)
|
|
5781
5919
|
{
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5920
|
+
var textColor=config.Unchecked.Color;
|
|
5921
|
+
if (drawInfo.Enable===false) textColor=config.Unchecked.DisableColor;
|
|
5922
|
+
else if (bMouseOn) textColor=config.Unchecked.MouseOnColor;
|
|
5923
|
+
|
|
5924
|
+
this.Canvas.fillStyle=textColor;
|
|
5925
|
+
this.Canvas.fillText(config.Unchecked.Symbol,x,y);
|
|
5785
5926
|
}
|
|
5786
5927
|
|
|
5787
5928
|
if (drawInfo.Enable)
|
|
5788
5929
|
{
|
|
5789
|
-
var rtBox={ Left:x, Bottom:y, Width:size, Height:size };
|
|
5790
|
-
rtBox.Right=rtBox.Left+rtBox.Width;
|
|
5791
|
-
rtBox.Top=rtBox.Bottom-rtBox.Height;
|
|
5792
5930
|
drawInfo.Botton={ Rect:rtBox, Type:0 };
|
|
5793
5931
|
}
|
|
5794
5932
|
}
|
|
@@ -5797,6 +5935,7 @@ function ChartReport()
|
|
|
5797
5935
|
{
|
|
5798
5936
|
if (!drawInfo.Button) return;
|
|
5799
5937
|
|
|
5938
|
+
var config=drawInfo.Button;
|
|
5800
5939
|
var rtBG=
|
|
5801
5940
|
{
|
|
5802
5941
|
Left:left+drawInfo.Button.Margin.Left, Top:top+drawInfo.Button.Margin.Top,
|
|
@@ -5806,11 +5945,26 @@ function ChartReport()
|
|
|
5806
5945
|
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
5807
5946
|
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
5808
5947
|
|
|
5809
|
-
var bgColor=
|
|
5948
|
+
var bgColor=config.BGColor, textColor=config.TextColor;
|
|
5810
5949
|
if (drawInfo.Enable===false)
|
|
5811
5950
|
{
|
|
5812
|
-
bgColor=
|
|
5813
|
-
textColor=
|
|
5951
|
+
bgColor=config.Disable.BGColor;
|
|
5952
|
+
textColor=config.Disable.TextColor;
|
|
5953
|
+
}
|
|
5954
|
+
else
|
|
5955
|
+
{
|
|
5956
|
+
if (this.LastMouseStatus && this.LastMouseStatus.OnMouseMove && config.MouseOn)
|
|
5957
|
+
{
|
|
5958
|
+
var x=this.LastMouseStatus.OnMouseMove.X;
|
|
5959
|
+
var y=this.LastMouseStatus.OnMouseMove.Y;
|
|
5960
|
+
if (x>rtBG.Left && x<rtBG.Right && y>rtBG.Top && y<rtBG.Bottom)
|
|
5961
|
+
{
|
|
5962
|
+
bgColor=config.MouseOn.BGColor;
|
|
5963
|
+
textColor=config.MouseOn.TextColor;
|
|
5964
|
+
|
|
5965
|
+
this.LastMouseStatus.MouseOnStatus={ Index:drawInfo.Index, ColumnIndex:drawInfo.ColumnIndex, Type:1 };
|
|
5966
|
+
}
|
|
5967
|
+
}
|
|
5814
5968
|
}
|
|
5815
5969
|
|
|
5816
5970
|
this.Canvas.fillStyle=bgColor;
|
|
@@ -5833,6 +5987,142 @@ function ChartReport()
|
|
|
5833
5987
|
}
|
|
5834
5988
|
}
|
|
5835
5989
|
|
|
5990
|
+
this.DrawProgressBar=function(drawInfo, left, top, width)
|
|
5991
|
+
{
|
|
5992
|
+
if (!drawInfo.ProgressBar) return;
|
|
5993
|
+
|
|
5994
|
+
var config=drawInfo.ProgressBar;
|
|
5995
|
+
var rtBG=
|
|
5996
|
+
{
|
|
5997
|
+
Left:left+config.Margin.Left, Top:top+config.Margin.Top,
|
|
5998
|
+
Height:this.RowHeight-config.Margin.Top-config.Margin.Bottom,
|
|
5999
|
+
Width:width-config.Margin.Left-config.Margin.Right
|
|
6000
|
+
}
|
|
6001
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
6002
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
6003
|
+
|
|
6004
|
+
var bgColor=config.BGColor;
|
|
6005
|
+
var barColor=config.BarColor;
|
|
6006
|
+
var textColor=config.TextColor;
|
|
6007
|
+
if (drawInfo.Enable===false)
|
|
6008
|
+
{
|
|
6009
|
+
bgColor=config.Disable.BGColor;
|
|
6010
|
+
barColor=config.Disable.BarColor;
|
|
6011
|
+
textColor=config.Disable.TextColor;
|
|
6012
|
+
}
|
|
6013
|
+
|
|
6014
|
+
if (drawInfo.BGColor) bgColor=drawInfo.BGColor;
|
|
6015
|
+
if (drawInfo.TextColor) textColor=drawInfo.TextColor;
|
|
6016
|
+
if (drawInfo.BarColor) barColor=drawInfo.BarColor;
|
|
6017
|
+
|
|
6018
|
+
if (bgColor)
|
|
6019
|
+
{
|
|
6020
|
+
this.Canvas.fillStyle=bgColor;
|
|
6021
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top,rtBG.Width,rtBG.Height);
|
|
6022
|
+
}
|
|
6023
|
+
|
|
6024
|
+
var fullBarWidth=rtBG.Width-config.BarMargin.Left-config.BarMargin.Right;
|
|
6025
|
+
var value=drawInfo.Value; // 0-1 进度条
|
|
6026
|
+
var rtBar={ Left:rtBG.Left+config.BarMargin.Left, Top:rtBG.Top+config.BarMargin.Top, Bottom:rtBG.Bottom-config.BarMargin.Bottom, Width:0 };
|
|
6027
|
+
if (value>0)
|
|
6028
|
+
{
|
|
6029
|
+
if (value>1) value=1;
|
|
6030
|
+
rtBar.Width=fullBarWidth*value;
|
|
6031
|
+
rtBar.Height=rtBar.Bottom-rtBar.Top;
|
|
6032
|
+
if (rtBar.Width<1) rtBG.Width=1;
|
|
6033
|
+
|
|
6034
|
+
this.Canvas.fillStyle=barColor;
|
|
6035
|
+
this.Canvas.fillRect(rtBar.Left, rtBar.Top,rtBar.Width,rtBar.Height);
|
|
6036
|
+
}
|
|
6037
|
+
|
|
6038
|
+
if (textColor && drawInfo.Text)
|
|
6039
|
+
{
|
|
6040
|
+
this.Canvas.font=config.Font;
|
|
6041
|
+
this.Canvas.textBaseline="bottom";
|
|
6042
|
+
this.Canvas.textAlign="left";
|
|
6043
|
+
|
|
6044
|
+
this.Canvas.fillStyle=textColor;
|
|
6045
|
+
var xText=rtBar.Left+config.TextMargin.Left;
|
|
6046
|
+
var yText=rtBar.Bottom-config.TextMargin.Bottom;
|
|
6047
|
+
this.Canvas.fillText(drawInfo.Text, xText, yText);
|
|
6048
|
+
}
|
|
6049
|
+
}
|
|
6050
|
+
|
|
6051
|
+
this.DrawLinkText=function(drawInfo, left, top, width)
|
|
6052
|
+
{
|
|
6053
|
+
if (!drawInfo.Link || !drawInfo.Text) return;
|
|
6054
|
+
|
|
6055
|
+
var config=drawInfo.Link;
|
|
6056
|
+
var text=drawInfo.Text;
|
|
6057
|
+
var textAlign=drawInfo.TextAlign;
|
|
6058
|
+
var font=config.Font;
|
|
6059
|
+
var color=config.TextColor;
|
|
6060
|
+
|
|
6061
|
+
|
|
6062
|
+
|
|
6063
|
+
this.Canvas.font=font;
|
|
6064
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
6065
|
+
var textHeight=this.Canvas.measureText("擎").width;
|
|
6066
|
+
var x=left;
|
|
6067
|
+
if (width>=textWidth)
|
|
6068
|
+
{
|
|
6069
|
+
if (textAlign=='center') x=left+(width-textWidth)/2;
|
|
6070
|
+
else if (textAlign=='right') x=left+width-textWidth;
|
|
6071
|
+
}
|
|
6072
|
+
else
|
|
6073
|
+
{
|
|
6074
|
+
text=this.TextEllipsis(text, width, drawInfo.MaxText);
|
|
6075
|
+
textWidth=this.Canvas.measureText(text).width;
|
|
6076
|
+
|
|
6077
|
+
//数据截断提示信息
|
|
6078
|
+
drawInfo.Tooltip=
|
|
6079
|
+
{
|
|
6080
|
+
Type:2,
|
|
6081
|
+
Data:{ AryText:[ {Text:drawInfo.Text} ] }
|
|
6082
|
+
}
|
|
6083
|
+
}
|
|
6084
|
+
|
|
6085
|
+
var rtText={Left:x, Bottom:top+this.RowHeight-this.ItemMergin.Bottom, Height:textHeight, Width:textWidth };
|
|
6086
|
+
rtText.Right=rtText.Left+rtText.Width;
|
|
6087
|
+
rtText.Top=rtText.Bottom-rtText.Height;
|
|
6088
|
+
|
|
6089
|
+
var drawLine=false; //下划线
|
|
6090
|
+
if (drawInfo.Enable===false)
|
|
6091
|
+
{
|
|
6092
|
+
color=config.Disable.TextColor;
|
|
6093
|
+
}
|
|
6094
|
+
else if (this.LastMouseStatus && this.LastMouseStatus.OnMouseMove && config.MouseOn)
|
|
6095
|
+
{
|
|
6096
|
+
var x=this.LastMouseStatus.OnMouseMove.X;
|
|
6097
|
+
var y=this.LastMouseStatus.OnMouseMove.Y;
|
|
6098
|
+
if (x>rtText.Left && x<rtText.Right && y>rtText.Top && y<rtText.Bottom)
|
|
6099
|
+
{
|
|
6100
|
+
color=config.MouseOn.TextColor;
|
|
6101
|
+
drawLine=true;
|
|
6102
|
+
this.LastMouseStatus.MouseOnStatus={ Index:drawInfo.Index, ColumnIndex:drawInfo.ColumnIndex, Type:2 };
|
|
6103
|
+
}
|
|
6104
|
+
}
|
|
6105
|
+
|
|
6106
|
+
this.Canvas.textBaseline="bottom";
|
|
6107
|
+
this.Canvas.textAlign="left";
|
|
6108
|
+
this.Canvas.fillStyle=color;
|
|
6109
|
+
this.Canvas.fillText(text,rtText.Left, rtText.Bottom);
|
|
6110
|
+
|
|
6111
|
+
if (drawLine)
|
|
6112
|
+
{
|
|
6113
|
+
this.Canvas.strokeStyle=color;
|
|
6114
|
+
this.Canvas.beginPath();
|
|
6115
|
+
this.Canvas.moveTo(rtText.Left,rtText.Bottom);
|
|
6116
|
+
this.Canvas.lineTo(rtText.Right,rtText.Bottom);
|
|
6117
|
+
this.Canvas.stroke();
|
|
6118
|
+
}
|
|
6119
|
+
|
|
6120
|
+
if (drawInfo.Enable)
|
|
6121
|
+
{
|
|
6122
|
+
drawInfo.Botton={ Rect:rtText, Type:2 };
|
|
6123
|
+
}
|
|
6124
|
+
}
|
|
6125
|
+
|
|
5836
6126
|
//字体由外面设置
|
|
5837
6127
|
this.TextEllipsis=function(text, maxWidth, maxText)
|
|
5838
6128
|
{
|
|
@@ -6545,6 +6835,14 @@ function ChartReport()
|
|
|
6545
6835
|
status.Redraw=true;
|
|
6546
6836
|
return true;
|
|
6547
6837
|
}
|
|
6838
|
+
else if (buttonData.Type===2) //link
|
|
6839
|
+
{
|
|
6840
|
+
var sendData={ Column:buttonData.Column, Index:buttonData.Index, Stock:buttonData.Stock, Data:buttonData.Data };
|
|
6841
|
+
this.SendClickEvent(JSCHART_EVENT_ID.ON_CLICK_REPORT_LINK, sendData)
|
|
6842
|
+
|
|
6843
|
+
status.Redraw=true;
|
|
6844
|
+
return true;
|
|
6845
|
+
}
|
|
6548
6846
|
|
|
6549
6847
|
return false;
|
|
6550
6848
|
}
|
|
@@ -6799,7 +7097,7 @@ function ChartReport()
|
|
|
6799
7097
|
|
|
6800
7098
|
if (x>=rt.Left && x<=rt.Right && y>=rt.Top && y<=rt.Bottom)
|
|
6801
7099
|
{
|
|
6802
|
-
return { Rect:item.Rect, Stock:item.Stock, Column:item.Column, Index:item.Index, Type:item.Type, Data:item.Data };
|
|
7100
|
+
return { Rect:item.Rect, Stock:item.Stock, Column:item.Column, Index:item.Index, Type:item.Type, Data:item.Data, ColumnIndex:item.ColumnIndex };
|
|
6803
7101
|
}
|
|
6804
7102
|
}
|
|
6805
7103
|
}
|