hqchart 1.1.15134 → 1.1.15147

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.15134",
3
+ "version": "1.1.15147",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -727,7 +727,7 @@ function JSDialogModifyDraw()
727
727
 
728
728
  var spanDom=document.createElement("span");
729
729
  spanDom.className="hqchart_drawtool icon-tuodong";
730
- spanDom.classList.add("UMyChart_DrawTool_Span");
730
+ spanDom.classList.add("UMyChart_Draw_Modify_Dialog_Drag_Span");
731
731
  drgDiv.appendChild(spanDom);
732
732
 
733
733
  for(var i=0;i<this.AryButton.length;++i)
@@ -753,7 +753,7 @@ function JSDialogModifyDraw()
753
753
 
754
754
  var spanDom=document.createElement("span");
755
755
  spanDom.className=item.ClassName;
756
- spanDom.classList.add("UMyChart_DrawTool_Span");
756
+ spanDom.classList.add("UMyChart_Draw_Modify_Dialog_Button_Span");
757
757
  divItem.appendChild(spanDom);
758
758
 
759
759
 
@@ -782,7 +782,6 @@ function JSDialogModifyDraw()
782
782
  break;
783
783
  case JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID:
784
784
  this.LockButton=data;
785
- this.LockButton.Span.style['color']="rgb(220,220,220)";
786
785
  break;
787
786
  case JS_DRAWTOOL_MENU_ID.CMD_ZOOM_FONT_ID:
788
787
  this.FontZoomButton=data;
@@ -987,7 +986,23 @@ function JSDialogModifyDraw()
987
986
  if (!this.ChartPicture || !this.HQChart) return;
988
987
  this.ChartPicture.EnableMove=!this.ChartPicture.EnableMove;
989
988
 
990
- if (this.LockButton) this.LockButton.Span.style['color']=this.ChartPicture.EnableMove?"rgb(220,220,220)":"rgb(0,0,0)";
989
+ return this.UpdateLockButtonStyle();
990
+ }
991
+
992
+ this.UpdateLockButtonStyle=function()
993
+ {
994
+ if (!this.LockButton) return;
995
+
996
+ if (this.ChartPicture.EnableMove)
997
+ {
998
+ this.LockButton.Span.classList.remove("UMyChart_Draw_Modify_Dialog_Button_Span");
999
+ this.LockButton.Span.classList.add("UMyChart_Draw_Modify_Dialog_Unlock_Button_Span");
1000
+ }
1001
+ else
1002
+ {
1003
+ this.LockButton.Span.classList.remove("UMyChart_Draw_Modify_Dialog_Unlock_Button_Span");
1004
+ this.LockButton.Span.classList.add("UMyChart_Draw_Modify_Dialog_Button_Span");
1005
+ }
991
1006
  }
992
1007
 
993
1008
  this.ModifyBorderColor=function()
@@ -1172,8 +1187,7 @@ function JSDialogModifyDraw()
1172
1187
 
1173
1188
  if (this.LockButton)
1174
1189
  {
1175
- var item=this.LockButton;
1176
- item.Span.style['color']=this.ChartPicture.EnableMove?"rgb(220,220,220)":"rgb(0,0,0)";
1190
+ this.UpdateLockButtonStyle();
1177
1191
  }
1178
1192
 
1179
1193
  if (this.FontZoomButton)
@@ -25,14 +25,6 @@ function JSDialogSearchIndex()
25
25
  //{ WindowIndex:窗口索引, OpType:1=切换主图指标 2=添加叠加指标 3=新增指标窗口, Title: };
26
26
  this.OpData=null;
27
27
 
28
- this.TitleColor=g_JSChartResource.DialogSearchIndex.TitleColor;
29
- this.TitleBGColor=g_JSChartResource.DialogSearchIndex.TitleBGColor;
30
- this.BGColor=g_JSChartResource.DialogSearchIndex.BGColor;
31
- this.BorderColor=g_JSChartResource.DialogSearchIndex.BorderColor;
32
- this.IndexNameColor=g_JSChartResource.DialogSearchIndex.IndexNameColor;
33
- this.GroupNameColor=g_JSChartResource.DialogSearchIndex.GroupNameColor;
34
- this.InputTextColor=g_JSChartResource.DialogSearchIndex.InputTextColor;
35
-
36
28
  this.MaxRowCount=30; //行
37
29
  this.ColCount=3; //列
38
30
  this.MaxGroupCount=20; //分类最多个数
@@ -399,15 +391,7 @@ function JSDialogSearchIndex()
399
391
 
400
392
  this.UpdateStyle=function()
401
393
  {
402
- if (!this.DivDialog) return;
403
-
404
- if (this.BGColor) this.DivDialog.style['background-color']=this.BGColor;
405
- if (this.BorderColor) this.DivDialog.style['border-color']=this.BorderColor;
406
-
407
- if (this.TitleBGColor) this.TitleBox.DivTitle.style['background-color']=this.TitleBGColor;
408
- if (this.TitleColor) this.TitleBox.DivName.style['color']=this.TitleColor;
409
-
410
- if (this.InputTextColor) this.InputDom.style['color']=this.InputTextColor;
394
+
411
395
  };
412
396
 
413
397
  this.ChangeGroup=function(groupID)
@@ -442,7 +426,6 @@ function JSDialogSearchIndex()
442
426
  cell.Span.innerText=item.Group.Name;
443
427
  cell.Span.dataset.groupid=item.Group.ID;
444
428
  cell.Span.dataset.groupname=item.Group.Name;
445
- cell.Span.style.color=this.GroupNameColor;
446
429
 
447
430
  if (cell.Div.style.display=="none") cell.Div.style.display="";
448
431
  }
@@ -468,7 +451,6 @@ function JSDialogSearchIndex()
468
451
  {
469
452
  var indexItem=data.AryIndex[index];
470
453
  cell.Span.innerText=indexItem.Name;
471
- cell.Span.style.color=this.IndexNameColor;
472
454
  if (cell.Td.style.display=="none") cell.Td.style.display="";
473
455
  cell.IndexItem=indexItem;
474
456
  ++index;
@@ -557,17 +539,7 @@ function JSDialogSearchIndex()
557
539
  //配色修改
558
540
  this.ReloadResource=function(option)
559
541
  {
560
- this.TitleColor=g_JSChartResource.DialogSearchIndex.TitleColor;
561
- this.TitleBGColor=g_JSChartResource.DialogSearchIndex.TitleBGColor;
562
- this.BGColor=g_JSChartResource.DialogSearchIndex.BGColor;
563
- this.BorderColor=g_JSChartResource.DialogSearchIndex.BorderColor;
564
- this.IndexNameColor=g_JSChartResource.DialogSearchIndex.IndexNameColor;
565
- this.GroupNameColor=g_JSChartResource.DialogSearchIndex.GroupNameColor;
566
- this.InputTextColor=g_JSChartResource.DialogSearchIndex.InputTextColor;
567
-
568
- if (!this.DivDialog) return;
569
-
570
- this.UpdateStyle();
542
+
571
543
  }
572
544
 
573
545
  }
@@ -878,13 +850,6 @@ function JSDialogModifyIndexParam()
878
850
  this.TitleBox=null; //{ DivTitle, DivName, DivName }
879
851
  this.Style=0; //样式 预留
880
852
 
881
- this.TitleColor=g_JSChartResource.DialogModifyIndexParam.TitleColor;
882
- this.TitleBGColor=g_JSChartResource.DialogModifyIndexParam.TitleBGColor;
883
- this.BGColor=g_JSChartResource.DialogModifyIndexParam.BGColor;
884
- this.BorderColor=g_JSChartResource.DialogModifyIndexParam.BorderColor;
885
- this.ParamNameColor=g_JSChartResource.DialogModifyIndexParam.ParamNameColor;
886
- this.InputTextColor=g_JSChartResource.DialogModifyIndexParam.InputTextColor;
887
-
888
853
  this.MaxRowCount=30; //行
889
854
 
890
855
  this.HQChart=null;
@@ -1142,13 +1107,7 @@ function JSDialogModifyIndexParam()
1142
1107
 
1143
1108
  this.UpdateStyle=function()
1144
1109
  {
1145
- if (!this.DivDialog) return;
1146
-
1147
- if (this.BGColor) this.DivDialog.style['background-color']=this.BGColor;
1148
- if (this.BorderColor) this.DivDialog.style['border-color']=this.BorderColor;
1149
-
1150
- if (this.TitleBGColor) this.TitleBox.DivTitle.style['background-color']=this.TitleBGColor;
1151
- if (this.TitleColor) this.TitleBox.DivName.style['color']=this.TitleColor;
1110
+
1152
1111
  };
1153
1112
 
1154
1113
  this.UpdateParamTable=function(aryText)
@@ -1159,10 +1118,9 @@ function JSDialogModifyIndexParam()
1159
1118
  var item=aryText[index];
1160
1119
  var row=this.AryData[index];
1161
1120
  row.SpanName.innerText=`${item.Name}: `;
1162
- row.SpanName.style.color=this.ParamNameColor;
1121
+
1163
1122
 
1164
1123
  row.Input.value=item.Value;
1165
- row.Input.style.color=this.InputTextColor;
1166
1124
  row.Input.dataset.paramid=item.Index;
1167
1125
 
1168
1126
  if (row.Tr.style.display=="none") row.Tr.style.display="";
@@ -2475,6 +2475,13 @@ JSChart.SetStyle=function(option)
2475
2475
  if (option) g_JSChartResource.SetStyle(option);
2476
2476
  }
2477
2477
 
2478
+
2479
+ //CSS风格
2480
+ JSChart.SetCSSStyle=function(styleID)
2481
+ {
2482
+ document.documentElement.setAttribute('hqchart_style', styleID);
2483
+ }
2484
+
2478
2485
  //value { EN:'', CH:'' }
2479
2486
  JSChart.SetTextResource=function(key,value)
2480
2487
  {
@@ -13584,6 +13591,8 @@ function IChartFramePainting()
13584
13591
 
13585
13592
  this.CalculateLock=function(aryData)
13586
13593
  {
13594
+ if (!this.LockPaint) return;
13595
+
13587
13596
  this.LockPaint.SetData(aryData);
13588
13597
  this.LockPaint.Draw(false);
13589
13598
  }
@@ -13776,7 +13785,14 @@ function AverageWidthFrame()
13776
13785
  this.IndexHelpButton=CloneData(g_JSChartResource.Buttons.IndexHelp);
13777
13786
  }
13778
13787
 
13779
- if (this.DivFrameToolbar) this.DivFrameToolbar.ReloadResource(resource);
13788
+ if (this.ToolbarButtonStyle==1)
13789
+ {
13790
+ this.ClearToolbar();
13791
+ }
13792
+ else
13793
+ {
13794
+ if (this.DivFrameToolbar) this.DivFrameToolbar.ReloadResource(resource);
13795
+ }
13780
13796
  }
13781
13797
 
13782
13798
  this.DrawFrame=function()
@@ -18799,155 +18815,6 @@ function KLineFrame()
18799
18815
  if (!this.DivFrameToolbar) return;
18800
18816
 
18801
18817
  this.DivFrameToolbar.Show(this.Identify);
18802
-
18803
- return;
18804
-
18805
- if (typeof($)=="undefined") return;
18806
-
18807
- if (!this.ChartBorder.UIElement || !this.ChartBorder.UIElement.parentNode) return;
18808
-
18809
- var divToolbar=document.getElementById(this.ToolbarID);
18810
- if (divToolbar && this.SizeChange==false && this.ReDrawToolbar==false) return;
18811
-
18812
- if (!divToolbar)
18813
- {
18814
-
18815
- divToolbar=document.createElement("div");
18816
- divToolbar.className='klineframe-toolbar';
18817
- divToolbar.id=this.ToolbarID;
18818
- divToolbar.oncontextmenu = function() { return false;}; //屏蔽右键系统菜单
18819
- //为divToolbar添加属性identify
18820
- divToolbar.setAttribute("identify",this.Identify.toString());
18821
- this.ChartBorder.UIElement.parentNode.appendChild(divToolbar);
18822
- }
18823
-
18824
- if (!this.ModifyIndex && !this.ChangeIndex && !this.OverlayIndex && !this.CloseIndex && !IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar))
18825
- {
18826
- if (divToolbar.style.display!='none')
18827
- divToolbar.style.display='none';
18828
- return;
18829
- }
18830
-
18831
- //使用外城div尺寸 画图尺寸是被放大的
18832
- var pixelTatio = GetDevicePixelRatio();
18833
- var chartWidth=parseInt(this.ChartBorder.UIElement.parentElement.style.width.replace("px",""));
18834
- var chartHeight=parseInt(this.ChartBorder.UIElement.parentElement.style.height.replace("px",""));
18835
- //JSConsole.Chart.Log('[KLineFrame::DrawToolbar] ',chartWidth,chartHeight,pixelTatio);
18836
-
18837
- var toolbarWidth=100;
18838
- var toolbarHeight=this.ChartBorder.GetTitleHeight();
18839
- var left=chartWidth-(this.ChartBorder.Right/pixelTatio)-toolbarWidth;
18840
- var top=this.ChartBorder.GetTop()/pixelTatio;
18841
-
18842
- if (this.ToolbarRect)
18843
- {
18844
- //尺寸变动移动才重新设置DOM
18845
- if (this.ToolbarRect.Left==left && this.ToolbarRect.Top==top &&
18846
- this.ToolbarRect.Width==toolbarWidth && this.ToolbarRect.Height==toolbarHeight/pixelTatio)
18847
- {
18848
- return;
18849
- }
18850
- }
18851
-
18852
- this.ToolbarRect={ Left:left, Top:top, Width:toolbarWidth, Height:toolbarHeight/pixelTatio };
18853
-
18854
- const modifyButton=`<span class='index_param icon iconfont icon-index_param' id='modifyindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='调整指标参数'></span>`;
18855
- const changeButton=`<span class='index_change icon iconfont icon-change_index' id='changeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='切换指标'></span>`;
18856
- const overlayButton=`<span class='index_overlay icon iconfont icon-overlay_index' id='overlayindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='叠加指标'></span>`;
18857
- const closeButton=`<span class='index_close icon iconfont icon-close' id='closeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='关闭指标窗口'></span>`;
18858
-
18859
- var spanIcon=modifyButton+changeButton+overlayButton;
18860
-
18861
- if (this.Identify!==0 && this.CloseIndex) //第1个窗口不能关闭
18862
- {
18863
- spanIcon+=closeButton;
18864
- }
18865
-
18866
- if (IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar))
18867
- {
18868
- for(var i=0;i<this.CustomToolbar.length;++i)
18869
- {
18870
- var item=this.CustomToolbar[i];
18871
- spanIcon+=item.Html;
18872
- }
18873
- }
18874
-
18875
- //var scrollPos=GetScrollPosition();
18876
- //left = left+scrollPos.Left;
18877
- //top = top+scrollPos.Top;
18878
- divToolbar.style.left = left + "px";
18879
- divToolbar.style.top = top + "px";
18880
- divToolbar.style.width=toolbarWidth+"px"; //宽度先不调整吧
18881
- divToolbar.style.height=(toolbarHeight/pixelTatio)+'px'; //只调整高度
18882
- divToolbar.innerHTML=spanIcon;
18883
-
18884
- var chart=this.ChartBorder.UIElement.JSChartContainer;
18885
- var identify=this.Identify;
18886
- if (!this.ModifyIndex) //隐藏'改参数'
18887
- $("#"+divToolbar.id+" .index_param").hide();
18888
- else if (typeof(this.ModifyIndexEvent)=='function') //绑定点击事件
18889
- $("#"+divToolbar.id+" .index_param").click(
18890
- {
18891
- Chart:this.ChartBorder.UIElement.JSChartContainer,
18892
- Identify:this.Identify
18893
- },this.ModifyIndexEvent);
18894
-
18895
- if (!this.ChangeIndex) //隐藏'换指标'
18896
- {
18897
- $("#"+divToolbar.id+" .index_change").hide();
18898
- }
18899
- else if (typeof(this.ChangeIndexEvent)=='function')
18900
- {
18901
- $("#"+divToolbar.id+" .index_change").click(
18902
- {
18903
- Chart:this.ChartBorder.UIElement.JSChartContainer,
18904
- Identify:this.Identify,
18905
- IsOverlay:false
18906
- },this.ChangeIndexEvent);
18907
- }
18908
-
18909
- if (!this.OverlayIndex)
18910
- {
18911
- $("#"+divToolbar.id+" .index_overlay").hide();
18912
- }
18913
- else
18914
- {
18915
- $("#"+divToolbar.id+" .index_overlay").click(
18916
- {
18917
- Chart:this.ChartBorder.UIElement.JSChartContainer,
18918
- Identify:this.Identify,
18919
- IsOverlay:true
18920
- },this.ChangeIndexEvent);
18921
- }
18922
-
18923
- $("#"+divToolbar.id+" .index_close").click(
18924
- {
18925
- Chart:this.ChartBorder.UIElement.JSChartContainer,
18926
- Identify:this.Identify
18927
- },
18928
- function(event)
18929
- {
18930
- var hqChart=event.data.Chart;
18931
- var id=event.data.Identify;
18932
- hqChart.RemoveIndexWindow(id);
18933
- });
18934
-
18935
-
18936
- if (IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar))
18937
- {
18938
- for(var i=0;i<this.CustomToolbar.length;++i)
18939
- {
18940
- var item=this.CustomToolbar[i];
18941
- $("#"+item.ID).click(
18942
- {
18943
- Chart:this.ChartBorder.UIElement.JSChartContainer,
18944
- Identify:this.Identify,
18945
- ID:item.ID
18946
- },item.Click);
18947
- }
18948
- }
18949
-
18950
- divToolbar.style.display = "block";
18951
18818
  }
18952
18819
 
18953
18820
  //手绘,不用DOM,使用DOM太麻烦了
@@ -78047,30 +77914,6 @@ function JSChartResource()
78047
77914
  }
78048
77915
  };
78049
77916
 
78050
- //指标搜索
78051
- this.DialogSearchIndex=
78052
- {
78053
- BGColor:'rgb(250,250,250)', //背景色
78054
- BorderColor:'rgb(20,20,20)', //边框颜色
78055
- TitleColor:'rgb(250,250,250)', //标题颜色
78056
- TitleBGColor:"rgb(200, 66, 69)", //标题背景颜色
78057
-
78058
- IndexNameColor:"rgb(0,0,0)", //数值名称
78059
- GroupNameColor:"rgb(0,0,0)",
78060
- InputTextColor:"rgb(0,0,0)"
78061
- };
78062
-
78063
- this.DialogModifyIndexParam=
78064
- {
78065
- BGColor:'rgb(250,250,250)', //背景色
78066
- BorderColor:'rgb(20,20,20)', //边框颜色
78067
- TitleColor:'rgb(250,250,250)', //标题颜色
78068
- TitleBGColor:"rgb(200, 66, 69)", //标题背景颜色
78069
-
78070
- ParamNameColor:"rgb(0,0,0)", //数值名称
78071
- InputTextColor:"rgb(0,0,0)"
78072
- };
78073
-
78074
77917
  //弹幕
78075
77918
  this.Barrage= {
78076
77919
  Font:16*GetDevicePixelRatio() +'px 微软雅黑', //字体
@@ -79295,20 +79138,6 @@ function JSChartResource()
79295
79138
  }
79296
79139
  }
79297
79140
 
79298
- if (style.DialogSearchIndex)
79299
- {
79300
- var item=style.DialogSearchIndex;
79301
-
79302
- if (item.BGColor) this.DialogSearchIndex.BGColor=item.BGColor;
79303
- if (item.BorderColor) this.DialogSearchIndex.BorderColor=item.BorderColor;
79304
- if (item.TitleColor) this.DialogSearchIndex.TitleColor=item.TitleColor;
79305
- if (item.TitleBGColor) this.DialogSearchIndex.TitleBGColor=item.TitleBGColor;
79306
-
79307
- if (item.IndexNameColor) this.DialogSearchIndex.IndexNameColor=item.IndexNameColor;
79308
- if (item.GroupNameColor) this.DialogSearchIndex.GroupNameColor=item.GroupNameColor;
79309
- if (item.InputTextColor) this.DialogSearchIndex.InputTextColor=item.InputTextColor;
79310
- }
79311
-
79312
79141
  if (style.MinuteInfo)
79313
79142
  {
79314
79143
  var item=style.MinuteInfo;