hqchart 1.1.13577 → 1.1.13588
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 +127 -64
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +2 -1
- package/src/jscommon/umychart.js +177 -3
- package/src/jscommon/umychart.report.js +277 -30
- 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 +553 -52
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +555 -53
|
@@ -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)
|
|
@@ -860,6 +862,50 @@ function JSReportChartContainer(uielement)
|
|
|
860
862
|
this.RequestMemberListData();
|
|
861
863
|
}
|
|
862
864
|
|
|
865
|
+
//更新数据
|
|
866
|
+
this.UpdateFullData=function(data)
|
|
867
|
+
{
|
|
868
|
+
var arySymbol=[];
|
|
869
|
+
if (IFrameSplitOperator.IsNonEmptyArray(data.data))
|
|
870
|
+
{
|
|
871
|
+
//0=证券代码 1=股票名称
|
|
872
|
+
for(var i=0;i<data.data.length;++i)
|
|
873
|
+
{
|
|
874
|
+
var item=data.data[i];
|
|
875
|
+
var symbol=item[0];
|
|
876
|
+
var stock=null;
|
|
877
|
+
if (this.MapStockData.has(symbol))
|
|
878
|
+
{
|
|
879
|
+
stock=this.MapStockData.get(symbol);
|
|
880
|
+
}
|
|
881
|
+
else
|
|
882
|
+
{
|
|
883
|
+
stock=new HQReportItem();
|
|
884
|
+
stock.OriginalSymbol=symbol;
|
|
885
|
+
this.MapStockData.set(symbol, stock);
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
stock.Symbol=this.GetSymbolNoSuffix(symbol);
|
|
889
|
+
stock.Name=item[1];
|
|
890
|
+
this.ReadStockJsonData(stock, item);
|
|
891
|
+
|
|
892
|
+
arySymbol.push(symbol);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
//设置显示数据
|
|
897
|
+
if (IFrameSplitOperator.IsNonEmptyArray(arySymbol))
|
|
898
|
+
{
|
|
899
|
+
for(var i=0;i<arySymbol.length;++i)
|
|
900
|
+
{
|
|
901
|
+
this.Data.Data.push(arySymbol[i]);
|
|
902
|
+
this.SourceData.Data.push(arySymbol[i]);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
this.Draw();
|
|
907
|
+
}
|
|
908
|
+
|
|
863
909
|
//设置全部的数据
|
|
864
910
|
this.SetFullData=function(data)
|
|
865
911
|
{
|
|
@@ -869,6 +915,9 @@ function JSReportChartContainer(uielement)
|
|
|
869
915
|
this.ResetSortStatus();
|
|
870
916
|
this.ResetReportSelectStatus();
|
|
871
917
|
|
|
918
|
+
this.UpdateFullData(data);
|
|
919
|
+
|
|
920
|
+
/*
|
|
872
921
|
//缓存所有数据
|
|
873
922
|
var arySymbol=[];
|
|
874
923
|
if (IFrameSplitOperator.IsNonEmptyArray(data.data))
|
|
@@ -909,6 +958,7 @@ function JSReportChartContainer(uielement)
|
|
|
909
958
|
}
|
|
910
959
|
|
|
911
960
|
this.Draw();
|
|
961
|
+
*/
|
|
912
962
|
}
|
|
913
963
|
|
|
914
964
|
this.RequestMemberListData=function()
|
|
@@ -1753,6 +1803,7 @@ function JSReportChartContainer(uielement)
|
|
|
1753
1803
|
var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
|
|
1754
1804
|
var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
|
|
1755
1805
|
|
|
1806
|
+
var oldMouseOnStatus=this.LastMouseStatus.MouseOnStatus;
|
|
1756
1807
|
this.LastMouseStatus.OnMouseMove=null;
|
|
1757
1808
|
|
|
1758
1809
|
var bDrawTooltip=false;
|
|
@@ -1764,6 +1815,7 @@ function JSReportChartContainer(uielement)
|
|
|
1764
1815
|
if (this.DragColumnWidth) return;
|
|
1765
1816
|
|
|
1766
1817
|
var tabChart=this.GetTabChart();
|
|
1818
|
+
var bDrawTab=false;
|
|
1767
1819
|
if (tabChart)
|
|
1768
1820
|
{
|
|
1769
1821
|
var tabData=tabChart.PtInTab(x,y);
|
|
@@ -1773,9 +1825,18 @@ function JSReportChartContainer(uielement)
|
|
|
1773
1825
|
if (tabChart.MoveOnTabIndex!=index)
|
|
1774
1826
|
{
|
|
1775
1827
|
tabChart.MoveOnTabIndex=index;
|
|
1776
|
-
|
|
1828
|
+
bDrawTab=true;
|
|
1777
1829
|
}
|
|
1778
1830
|
}
|
|
1831
|
+
else
|
|
1832
|
+
{
|
|
1833
|
+
if (tabChart.MoveOnTabIndex>=0)
|
|
1834
|
+
{
|
|
1835
|
+
tabChart.MoveOnTabIndex=-1;
|
|
1836
|
+
bDrawTab=true;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
}
|
|
1779
1840
|
}
|
|
1780
1841
|
|
|
1781
1842
|
this.LastMouseStatus.OnMouseMove={ X:x, Y:y };
|
|
@@ -1793,12 +1854,28 @@ function JSReportChartContainer(uielement)
|
|
|
1793
1854
|
}
|
|
1794
1855
|
else
|
|
1795
1856
|
{
|
|
1796
|
-
var
|
|
1797
|
-
|
|
1857
|
+
var buttonData=report.GetButtonData(x,y);
|
|
1858
|
+
var mouseOnStatus=null;
|
|
1859
|
+
if (buttonData)
|
|
1798
1860
|
{
|
|
1799
1861
|
mouseStatus={ Cursor:"pointer", Name:"Botton"};
|
|
1862
|
+
if (buttonData.Type==1 || buttonData.Type==0 || buttonData.Type==2)
|
|
1863
|
+
{
|
|
1864
|
+
mouseOnStatus={ Index:buttonData.Index, ColumnIndex:buttonData.ColumnIndex };
|
|
1865
|
+
}
|
|
1800
1866
|
}
|
|
1801
1867
|
|
|
1868
|
+
//console.log("[UIOnMouseMove] ", oldMouseOnStatus, mouseOnStatus)
|
|
1869
|
+
if ((!oldMouseOnStatus && mouseOnStatus) || (oldMouseOnStatus && !mouseOnStatus))
|
|
1870
|
+
{
|
|
1871
|
+
bDraw=true;
|
|
1872
|
+
}
|
|
1873
|
+
else if (oldMouseOnStatus && mouseOnStatus)
|
|
1874
|
+
{
|
|
1875
|
+
if (oldMouseOnStatus.Index!=mouseOnStatus.Index || oldMouseOnStatus.ColumnIndex!=mouseOnStatus.ColumnIndex)
|
|
1876
|
+
bDraw=true;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1802
1879
|
var tooltipData=report.GetTooltipData(x,y); //单元格提示信息
|
|
1803
1880
|
if (tooltipData)
|
|
1804
1881
|
{
|
|
@@ -1832,7 +1909,7 @@ function JSReportChartContainer(uielement)
|
|
|
1832
1909
|
|
|
1833
1910
|
if (mouseStatus) this.UIElement.style.cursor=mouseStatus.Cursor;
|
|
1834
1911
|
|
|
1835
|
-
if (bDraw) this.Draw();
|
|
1912
|
+
if (bDraw || bDrawTab) this.Draw();
|
|
1836
1913
|
else if (bDrawTooltip) this.DrawTooltip(this.LastMouseStatus.TooltipStatus);
|
|
1837
1914
|
}
|
|
1838
1915
|
|
|
@@ -3682,6 +3759,7 @@ var REPORT_COLUMN_ID=
|
|
|
3682
3759
|
CUSTOM_CHECKBOX_ID:104, //自定义checkbox
|
|
3683
3760
|
CUSTOM_BUTTON_ID:105, //自定义按钮
|
|
3684
3761
|
CUSTOM_PROGRESS_ID:106, //进度条
|
|
3762
|
+
CUSTOM_LINK_ID:107, //链接
|
|
3685
3763
|
}
|
|
3686
3764
|
|
|
3687
3765
|
var MAP_COLUMN_FIELD=new Map([
|
|
@@ -3852,6 +3930,9 @@ function ChartReport()
|
|
|
3852
3930
|
}
|
|
3853
3931
|
|
|
3854
3932
|
this.CheckBoxConfig=CloneData(g_JSChartResource.Report.CheckBox);
|
|
3933
|
+
this.LinkConfig=CloneData(g_JSChartResource.Report.Link);
|
|
3934
|
+
this.ProgressBarConfig=CloneData(g_JSChartResource.Report.ProgressBar);
|
|
3935
|
+
this.ButtonConfig=CloneData(g_JSChartResource.Report.Button);
|
|
3855
3936
|
|
|
3856
3937
|
//股票代码+股票名称
|
|
3857
3938
|
this.ItemSymbolFontConfig={Size:g_JSChartResource.Report.Item.SymbolFont.Size, Name:g_JSChartResource.Report.Item.SymbolFont.Name};
|
|
@@ -3895,6 +3976,8 @@ function ChartReport()
|
|
|
3895
3976
|
//{ Rect:rtItem, Type: 0=checkedbox, 1=button, 2=link , Stock, Index:index, Column:column }
|
|
3896
3977
|
this.ButtonRect=[];
|
|
3897
3978
|
|
|
3979
|
+
this.LastMouseStatus;
|
|
3980
|
+
|
|
3898
3981
|
this.ReloadResource=function(resource)
|
|
3899
3982
|
{
|
|
3900
3983
|
this.DevicePixelRatio=GetDevicePixelRatio()
|
|
@@ -3985,6 +4068,10 @@ function ChartReport()
|
|
|
3985
4068
|
|
|
3986
4069
|
if (this.Tab) this.Tab.ReloadResource(resource);
|
|
3987
4070
|
if (this.VScrollbar) this.VScrollbar.ReloadResource(resource);
|
|
4071
|
+
|
|
4072
|
+
this.CheckBoxConfig=CloneData(g_JSChartResource.Report.CheckBox);
|
|
4073
|
+
this.LinkConfig=CloneData(g_JSChartResource.Report.Link);
|
|
4074
|
+
this.ProgressBarConfig=CloneData(g_JSChartResource.Report.ProgressBar);
|
|
3988
4075
|
}
|
|
3989
4076
|
|
|
3990
4077
|
this.SetColumn=function(aryColumn)
|
|
@@ -4056,7 +4143,7 @@ function ChartReport()
|
|
|
4056
4143
|
if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
|
|
4057
4144
|
if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
|
|
4058
4145
|
if (item.CheckBox) colItem.CheckBox=CloneData(item.CheckBox);
|
|
4059
|
-
else colItem.CheckBox=
|
|
4146
|
+
else colItem.CheckBox=this.CheckBoxConfig;
|
|
4060
4147
|
}
|
|
4061
4148
|
else if (item.Type==REPORT_COLUMN_ID.CUSTOM_BUTTON_ID)
|
|
4062
4149
|
{
|
|
@@ -4064,6 +4151,7 @@ function ChartReport()
|
|
|
4064
4151
|
if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
|
|
4065
4152
|
if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
|
|
4066
4153
|
if (item.Button) colItem.Button=CloneData(item.Button);
|
|
4154
|
+
else colItem.Button=this.ButtonConfig;
|
|
4067
4155
|
}
|
|
4068
4156
|
else if (item.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID)
|
|
4069
4157
|
{
|
|
@@ -4071,6 +4159,15 @@ function ChartReport()
|
|
|
4071
4159
|
if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
|
|
4072
4160
|
if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
|
|
4073
4161
|
if (item.ProgressBar) colItem.ProgressBar=CloneData(item.ProgressBar);
|
|
4162
|
+
else colItem.ProgressBar=this.ProgressBarConfig;
|
|
4163
|
+
}
|
|
4164
|
+
else if (item.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
|
|
4165
|
+
{
|
|
4166
|
+
if (!IFrameSplitOperator.IsNumber(item.DataIndex) && !IFrameSplitOperator.IsNumber(item.BlockIndex)) continue;
|
|
4167
|
+
if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
|
|
4168
|
+
if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
|
|
4169
|
+
if (item.Link) colItem.Link=CloneData(item.Link);
|
|
4170
|
+
else colItem.Link=this.LinkConfig;
|
|
4074
4171
|
}
|
|
4075
4172
|
else if (item.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID)
|
|
4076
4173
|
{
|
|
@@ -4190,7 +4287,8 @@ function ChartReport()
|
|
|
4190
4287
|
{ Type:REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID, Title:"", TextAlign:"center", FixedWidth:20*GetDevicePixelRatio() },
|
|
4191
4288
|
|
|
4192
4289
|
{ Type:REPORT_COLUMN_ID.CUSTOM_BUTTON_ID, Title:"", TextAlign:"center", FixedWidth:50*GetDevicePixelRatio() },
|
|
4193
|
-
{ Type:REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID, Title:"进度条", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() }
|
|
4290
|
+
{ Type:REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID, Title:"进度条", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
|
|
4291
|
+
{ Type:REPORT_COLUMN_ID.CUSTOM_LINK_ID, Title:"链接地址", TextAlign:"center", MaxText:"擎擎擎擎擎" }
|
|
4194
4292
|
];
|
|
4195
4293
|
|
|
4196
4294
|
for(var i=0;i<DEFAULT_COLUMN.length;++i)
|
|
@@ -4211,12 +4309,13 @@ function ChartReport()
|
|
|
4211
4309
|
this.Canvas.clip();
|
|
4212
4310
|
}
|
|
4213
4311
|
|
|
4214
|
-
this.Draw=function()
|
|
4312
|
+
this.Draw=function(lastMouseStatus)
|
|
4215
4313
|
{
|
|
4216
4314
|
this.ShowSymbol=[];
|
|
4217
4315
|
this.TooltipRect=[];
|
|
4218
4316
|
this.ButtonRect=[];
|
|
4219
4317
|
this.DevicePixelRatio=GetDevicePixelRatio()
|
|
4318
|
+
this.LastMouseStatus=lastMouseStatus;
|
|
4220
4319
|
|
|
4221
4320
|
if (this.GlobalOption) this.GlobalOption.FlashBGCount=0;
|
|
4222
4321
|
|
|
@@ -4248,6 +4347,7 @@ function ChartReport()
|
|
|
4248
4347
|
this.VScrollbar.DrawScrollbar(this.RectClient.Left,this.RectClient.Top+this.HeaderHeight, this.RectClient.Right, bottom-this.BottomToolbarHeight-4);
|
|
4249
4348
|
}
|
|
4250
4349
|
|
|
4350
|
+
this.LastMouseStatus=null;
|
|
4251
4351
|
this.SizeChange=false;
|
|
4252
4352
|
}
|
|
4253
4353
|
|
|
@@ -4887,7 +4987,7 @@ function ChartReport()
|
|
|
4887
4987
|
for(var i=0;i<this.FixedColumn && i<this.Column.length;++i)
|
|
4888
4988
|
{
|
|
4889
4989
|
var item=this.Column[i];
|
|
4890
|
-
this.DrawItem(dataIndex, data, item, left, top, rowType);
|
|
4990
|
+
this.DrawItem(dataIndex, data, item, left, top, rowType, i);
|
|
4891
4991
|
left+=item.Width;
|
|
4892
4992
|
|
|
4893
4993
|
if (left>=chartRight) break;
|
|
@@ -4896,20 +4996,24 @@ function ChartReport()
|
|
|
4896
4996
|
for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i)
|
|
4897
4997
|
{
|
|
4898
4998
|
var item=this.Column[i];
|
|
4899
|
-
this.DrawItem(dataIndex, data, item, left, top, rowType);
|
|
4999
|
+
this.DrawItem(dataIndex, data, item, left, top, rowType, i);
|
|
4900
5000
|
left+=item.Width;
|
|
4901
5001
|
|
|
4902
5002
|
if (left>=chartRight) break;
|
|
4903
5003
|
}
|
|
4904
5004
|
}
|
|
4905
5005
|
|
|
4906
|
-
this.DrawItem=function(index, data, column, left, top, rowType)
|
|
5006
|
+
this.DrawItem=function(index, data, column, left, top, rowType, columnIndex)
|
|
4907
5007
|
{
|
|
4908
5008
|
var itemWidth=column.Width;
|
|
4909
5009
|
var x=left+this.ItemMergin.Left;
|
|
4910
5010
|
var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;
|
|
4911
5011
|
var stock=data.Stock;
|
|
4912
|
-
var drawInfo=
|
|
5012
|
+
var drawInfo=
|
|
5013
|
+
{
|
|
5014
|
+
Text:null, TextColor:column.TextColor , TextAlign:column.TextAlign, Tooltip:null,
|
|
5015
|
+
Index:index, ColumnIndex:columnIndex
|
|
5016
|
+
};
|
|
4913
5017
|
var rtItem={ Left:left, Top:top, Width:column.Width, Height:this.RowHeight };
|
|
4914
5018
|
rtItem.Right=rtItem.Left+rtItem.Width;
|
|
4915
5019
|
rtItem.Bottom=rtItem.Top+rtItem.Height;
|
|
@@ -5172,6 +5276,10 @@ function ChartReport()
|
|
|
5172
5276
|
|
|
5173
5277
|
this.GetCustomProgressBarDrawInfo(data, column, drawInfo);
|
|
5174
5278
|
}
|
|
5279
|
+
else if (column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
|
|
5280
|
+
{
|
|
5281
|
+
this.GetCustomLinkDrawInfo(data, column, drawInfo);
|
|
5282
|
+
}
|
|
5175
5283
|
|
|
5176
5284
|
|
|
5177
5285
|
//拖拽行颜色
|
|
@@ -5198,6 +5306,10 @@ function ChartReport()
|
|
|
5198
5306
|
{
|
|
5199
5307
|
this.DrawProgressBar(drawInfo, left, top, itemWidth);
|
|
5200
5308
|
}
|
|
5309
|
+
else if (column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
|
|
5310
|
+
{
|
|
5311
|
+
this.DrawLinkText(drawInfo, x, top, textWidth);
|
|
5312
|
+
}
|
|
5201
5313
|
else
|
|
5202
5314
|
{
|
|
5203
5315
|
if (data.FlashBG && data.FlashBG.Data && column.ID!=undefined)
|
|
@@ -5231,7 +5343,7 @@ function ChartReport()
|
|
|
5231
5343
|
|
|
5232
5344
|
if (drawInfo.Botton)
|
|
5233
5345
|
{
|
|
5234
|
-
var buttonData={ Stock:stock, Index:index, Column:column, Rect:drawInfo.Botton.Rect, Type:drawInfo.Botton.Type, Data:drawInfo.Data };
|
|
5346
|
+
var buttonData={ Stock:stock, Index:index, ColumnIndex:columnIndex, Column:column, Rect:drawInfo.Botton.Rect, Type:drawInfo.Botton.Type, Data:drawInfo.Data };
|
|
5235
5347
|
this.ButtonRect.push(buttonData);
|
|
5236
5348
|
}
|
|
5237
5349
|
}
|
|
@@ -5529,6 +5641,20 @@ function ChartReport()
|
|
|
5529
5641
|
if (barData.BGColor) drawInfo.BGColor=barData.BGColor;
|
|
5530
5642
|
}
|
|
5531
5643
|
|
|
5644
|
+
this.GetCustomLinkDrawInfo=function(data, column, drawInfo)
|
|
5645
|
+
{
|
|
5646
|
+
var linkData=this.GetExtendData(data, column);
|
|
5647
|
+
if (!linkData) return;
|
|
5648
|
+
|
|
5649
|
+
drawInfo.Text=linkData.Title;
|
|
5650
|
+
drawInfo.Link=column.Link;
|
|
5651
|
+
drawInfo.Enable=true;
|
|
5652
|
+
drawInfo.Data=linkData;
|
|
5653
|
+
drawInfo.MaxText=column.MaxText;
|
|
5654
|
+
if (IFrameSplitOperator.IsBool(linkData.Enable)) drawInfo.Enable=linkData.Enable;
|
|
5655
|
+
if (linkData.TextColor) drawInfo.TextColor=linkData.TextColor;
|
|
5656
|
+
}
|
|
5657
|
+
|
|
5532
5658
|
this.FormaTimeDrawInfo=function(column, stock, drawInfo, data)
|
|
5533
5659
|
{
|
|
5534
5660
|
if (!IFrameSplitOperator.IsNumber(stock.Time)) return;
|
|
@@ -5798,35 +5924,57 @@ function ChartReport()
|
|
|
5798
5924
|
if (!IFrameSplitOperator.IsBool(drawInfo.Checked)) return;
|
|
5799
5925
|
if (!drawInfo.CheckBox) return;
|
|
5800
5926
|
|
|
5801
|
-
|
|
5927
|
+
var config=drawInfo.CheckBox;
|
|
5928
|
+
drawInfo.Font=`${config.Size*this.DevicePixelRatio}px ${config.Family}`;
|
|
5802
5929
|
var textAlign=drawInfo.TextAlign;
|
|
5803
5930
|
var size=drawInfo.CheckBox.Size*this.DevicePixelRatio;
|
|
5804
5931
|
var x=left+drawInfo.CheckBox.Margin.Left;
|
|
5805
5932
|
var y=top+this.RowHeight-drawInfo.CheckBox.Margin.Bottom;
|
|
5933
|
+
|
|
5806
5934
|
if (textAlign=='center') x=left+width/2-size/2;
|
|
5807
|
-
else if (textAlign=='right') x=left+width-
|
|
5935
|
+
else if (textAlign=='right') x=left+width-config.Margin.Right;
|
|
5936
|
+
|
|
5937
|
+
var rtBox={ Left:x, Bottom:y, Width:size, Height:size };
|
|
5938
|
+
rtBox.Right=rtBox.Left+rtBox.Width;
|
|
5939
|
+
rtBox.Top=rtBox.Bottom-rtBox.Height;
|
|
5940
|
+
|
|
5941
|
+
//鼠标在上面
|
|
5942
|
+
var bMouseOn=false;
|
|
5943
|
+
if (drawInfo.Enable && this.LastMouseStatus && this.LastMouseStatus.OnMouseMove)
|
|
5944
|
+
{
|
|
5945
|
+
var xMouse=this.LastMouseStatus.OnMouseMove.X;
|
|
5946
|
+
var yMouse=this.LastMouseStatus.OnMouseMove.Y;
|
|
5947
|
+
if (xMouse>rtBox.Left && xMouse<rtBox.Right && yMouse>rtBox.Top && yMouse<rtBox.Bottom)
|
|
5948
|
+
{
|
|
5949
|
+
bMouseOn=true;
|
|
5950
|
+
this.LastMouseStatus.MouseOnStatus={ Index:drawInfo.Index, ColumnIndex:drawInfo.ColumnIndex, Type:0 };
|
|
5951
|
+
}
|
|
5952
|
+
}
|
|
5808
5953
|
|
|
5809
5954
|
this.Canvas.font=drawInfo.Font;
|
|
5810
5955
|
this.Canvas.textBaseline="bottom";
|
|
5811
5956
|
this.Canvas.textAlign="left";
|
|
5812
5957
|
if (drawInfo.Checked===true)
|
|
5813
5958
|
{
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5959
|
+
var textColor=config.Checked.Color;
|
|
5960
|
+
if (drawInfo.Enable===false) textColor=config.Checked.DisableColor;
|
|
5961
|
+
else if (bMouseOn) textColor=config.Checked.MouseOnColor;
|
|
5962
|
+
|
|
5963
|
+
this.Canvas.fillStyle=textColor;
|
|
5964
|
+
this.Canvas.fillText(config.Checked.Symbol,x,y);
|
|
5817
5965
|
}
|
|
5818
5966
|
else if (drawInfo.Checked===false)
|
|
5819
5967
|
{
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5968
|
+
var textColor=config.Unchecked.Color;
|
|
5969
|
+
if (drawInfo.Enable===false) textColor=config.Unchecked.DisableColor;
|
|
5970
|
+
else if (bMouseOn) textColor=config.Unchecked.MouseOnColor;
|
|
5971
|
+
|
|
5972
|
+
this.Canvas.fillStyle=textColor;
|
|
5973
|
+
this.Canvas.fillText(config.Unchecked.Symbol,x,y);
|
|
5823
5974
|
}
|
|
5824
5975
|
|
|
5825
5976
|
if (drawInfo.Enable)
|
|
5826
5977
|
{
|
|
5827
|
-
var rtBox={ Left:x, Bottom:y, Width:size, Height:size };
|
|
5828
|
-
rtBox.Right=rtBox.Left+rtBox.Width;
|
|
5829
|
-
rtBox.Top=rtBox.Bottom-rtBox.Height;
|
|
5830
5978
|
drawInfo.Botton={ Rect:rtBox, Type:0 };
|
|
5831
5979
|
}
|
|
5832
5980
|
}
|
|
@@ -5835,6 +5983,7 @@ function ChartReport()
|
|
|
5835
5983
|
{
|
|
5836
5984
|
if (!drawInfo.Button) return;
|
|
5837
5985
|
|
|
5986
|
+
var config=drawInfo.Button;
|
|
5838
5987
|
var rtBG=
|
|
5839
5988
|
{
|
|
5840
5989
|
Left:left+drawInfo.Button.Margin.Left, Top:top+drawInfo.Button.Margin.Top,
|
|
@@ -5844,11 +5993,26 @@ function ChartReport()
|
|
|
5844
5993
|
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
5845
5994
|
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
5846
5995
|
|
|
5847
|
-
var bgColor=
|
|
5996
|
+
var bgColor=config.BGColor, textColor=config.TextColor;
|
|
5848
5997
|
if (drawInfo.Enable===false)
|
|
5849
5998
|
{
|
|
5850
|
-
bgColor=
|
|
5851
|
-
textColor=
|
|
5999
|
+
bgColor=config.Disable.BGColor;
|
|
6000
|
+
textColor=config.Disable.TextColor;
|
|
6001
|
+
}
|
|
6002
|
+
else
|
|
6003
|
+
{
|
|
6004
|
+
if (this.LastMouseStatus && this.LastMouseStatus.OnMouseMove && config.MouseOn)
|
|
6005
|
+
{
|
|
6006
|
+
var x=this.LastMouseStatus.OnMouseMove.X;
|
|
6007
|
+
var y=this.LastMouseStatus.OnMouseMove.Y;
|
|
6008
|
+
if (x>rtBG.Left && x<rtBG.Right && y>rtBG.Top && y<rtBG.Bottom)
|
|
6009
|
+
{
|
|
6010
|
+
bgColor=config.MouseOn.BGColor;
|
|
6011
|
+
textColor=config.MouseOn.TextColor;
|
|
6012
|
+
|
|
6013
|
+
this.LastMouseStatus.MouseOnStatus={ Index:drawInfo.Index, ColumnIndex:drawInfo.ColumnIndex, Type:1 };
|
|
6014
|
+
}
|
|
6015
|
+
}
|
|
5852
6016
|
}
|
|
5853
6017
|
|
|
5854
6018
|
this.Canvas.fillStyle=bgColor;
|
|
@@ -5932,6 +6096,81 @@ function ChartReport()
|
|
|
5932
6096
|
}
|
|
5933
6097
|
}
|
|
5934
6098
|
|
|
6099
|
+
this.DrawLinkText=function(drawInfo, left, top, width)
|
|
6100
|
+
{
|
|
6101
|
+
if (!drawInfo.Link || !drawInfo.Text) return;
|
|
6102
|
+
|
|
6103
|
+
var config=drawInfo.Link;
|
|
6104
|
+
var text=drawInfo.Text;
|
|
6105
|
+
var textAlign=drawInfo.TextAlign;
|
|
6106
|
+
var font=config.Font;
|
|
6107
|
+
var color=config.TextColor;
|
|
6108
|
+
|
|
6109
|
+
|
|
6110
|
+
|
|
6111
|
+
this.Canvas.font=font;
|
|
6112
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
6113
|
+
var textHeight=this.Canvas.measureText("擎").width;
|
|
6114
|
+
var x=left;
|
|
6115
|
+
if (width>=textWidth)
|
|
6116
|
+
{
|
|
6117
|
+
if (textAlign=='center') x=left+(width-textWidth)/2;
|
|
6118
|
+
else if (textAlign=='right') x=left+width-textWidth;
|
|
6119
|
+
}
|
|
6120
|
+
else
|
|
6121
|
+
{
|
|
6122
|
+
text=this.TextEllipsis(text, width, drawInfo.MaxText);
|
|
6123
|
+
textWidth=this.Canvas.measureText(text).width;
|
|
6124
|
+
|
|
6125
|
+
//数据截断提示信息
|
|
6126
|
+
drawInfo.Tooltip=
|
|
6127
|
+
{
|
|
6128
|
+
Type:2,
|
|
6129
|
+
Data:{ AryText:[ {Text:drawInfo.Text} ] }
|
|
6130
|
+
}
|
|
6131
|
+
}
|
|
6132
|
+
|
|
6133
|
+
var rtText={Left:x, Bottom:top+this.RowHeight-this.ItemMergin.Bottom, Height:textHeight, Width:textWidth };
|
|
6134
|
+
rtText.Right=rtText.Left+rtText.Width;
|
|
6135
|
+
rtText.Top=rtText.Bottom-rtText.Height;
|
|
6136
|
+
|
|
6137
|
+
var drawLine=false; //下划线
|
|
6138
|
+
if (drawInfo.Enable===false)
|
|
6139
|
+
{
|
|
6140
|
+
color=config.Disable.TextColor;
|
|
6141
|
+
}
|
|
6142
|
+
else if (this.LastMouseStatus && this.LastMouseStatus.OnMouseMove && config.MouseOn)
|
|
6143
|
+
{
|
|
6144
|
+
var x=this.LastMouseStatus.OnMouseMove.X;
|
|
6145
|
+
var y=this.LastMouseStatus.OnMouseMove.Y;
|
|
6146
|
+
if (x>rtText.Left && x<rtText.Right && y>rtText.Top && y<rtText.Bottom)
|
|
6147
|
+
{
|
|
6148
|
+
color=config.MouseOn.TextColor;
|
|
6149
|
+
drawLine=true;
|
|
6150
|
+
this.LastMouseStatus.MouseOnStatus={ Index:drawInfo.Index, ColumnIndex:drawInfo.ColumnIndex, Type:2 };
|
|
6151
|
+
}
|
|
6152
|
+
}
|
|
6153
|
+
|
|
6154
|
+
this.Canvas.textBaseline="bottom";
|
|
6155
|
+
this.Canvas.textAlign="left";
|
|
6156
|
+
this.Canvas.fillStyle=color;
|
|
6157
|
+
this.Canvas.fillText(text,rtText.Left, rtText.Bottom);
|
|
6158
|
+
|
|
6159
|
+
if (drawLine)
|
|
6160
|
+
{
|
|
6161
|
+
this.Canvas.strokeStyle=color;
|
|
6162
|
+
this.Canvas.beginPath();
|
|
6163
|
+
this.Canvas.moveTo(rtText.Left,rtText.Bottom);
|
|
6164
|
+
this.Canvas.lineTo(rtText.Right,rtText.Bottom);
|
|
6165
|
+
this.Canvas.stroke();
|
|
6166
|
+
}
|
|
6167
|
+
|
|
6168
|
+
if (drawInfo.Enable)
|
|
6169
|
+
{
|
|
6170
|
+
drawInfo.Botton={ Rect:rtText, Type:2 };
|
|
6171
|
+
}
|
|
6172
|
+
}
|
|
6173
|
+
|
|
5935
6174
|
//字体由外面设置
|
|
5936
6175
|
this.TextEllipsis=function(text, maxWidth, maxText)
|
|
5937
6176
|
{
|
|
@@ -6644,6 +6883,14 @@ function ChartReport()
|
|
|
6644
6883
|
status.Redraw=true;
|
|
6645
6884
|
return true;
|
|
6646
6885
|
}
|
|
6886
|
+
else if (buttonData.Type===2) //link
|
|
6887
|
+
{
|
|
6888
|
+
var sendData={ Column:buttonData.Column, Index:buttonData.Index, Stock:buttonData.Stock, Data:buttonData.Data };
|
|
6889
|
+
this.SendClickEvent(JSCHART_EVENT_ID.ON_CLICK_REPORT_LINK, sendData)
|
|
6890
|
+
|
|
6891
|
+
status.Redraw=true;
|
|
6892
|
+
return true;
|
|
6893
|
+
}
|
|
6647
6894
|
|
|
6648
6895
|
return false;
|
|
6649
6896
|
}
|
|
@@ -6898,7 +7145,7 @@ function ChartReport()
|
|
|
6898
7145
|
|
|
6899
7146
|
if (x>=rt.Left && x<=rt.Right && y>=rt.Top && y<=rt.Bottom)
|
|
6900
7147
|
{
|
|
6901
|
-
return { Rect:item.Rect, Stock:item.Stock, Column:item.Column, Index:item.Index, Type:item.Type, Data:item.Data };
|
|
7148
|
+
return { Rect:item.Rect, Stock:item.Stock, Column:item.Column, Index:item.Index, Type:item.Type, Data:item.Data, ColumnIndex:item.ColumnIndex };
|
|
6902
7149
|
}
|
|
6903
7150
|
}
|
|
6904
7151
|
}
|