hqchart 1.1.14804 → 1.1.14809

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.
@@ -6924,6 +6924,8 @@ var JSCHART_EVENT_ID=
6924
6924
  ON_CLICK_CROSSCURSOR_BOTTOM:170, //十字光标底部文字点击
6925
6925
 
6926
6926
  ON_CLICK_CHART_CELL:171, //点击图形单元
6927
+
6928
+ GET_DEFAULT_INDEX_PARAM:172, //获取指标默认参数
6927
6929
  }
6928
6930
 
6929
6931
  var JSCHART_OPERATOR_ID=
@@ -57325,6 +57327,24 @@ IFrameSplitOperator.FormatDateTimeString=function(value,isShowDate,isShowTime)
57325
57327
  return result;
57326
57328
  }
57327
57329
 
57330
+ IFrameSplitOperator.FormatDateTimeStringV2=function(datetime, format, languageID)
57331
+ {
57332
+ if (!datetime) return null;
57333
+
57334
+ switch(format)
57335
+ {
57336
+ case "YYYY-MM-DD":
57337
+ return `${datetime.getFullYear()}-${IFrameSplitOperator.NumberToString(datetime.getMonth()+1)}-${IFrameSplitOperator.NumberToString(datetime.getDate())}`;
57338
+
57339
+ case "HH:MM:SS":
57340
+ return `${IFrameSplitOperator.NumberToString(datetime.getHours())}:${IFrameSplitOperator.NumberToString(datetime.getMinutes())}:${IFrameSplitOperator.NumberToString(datetime.getSeconds())}`;
57341
+ case "HH:MM":
57342
+ return `${IFrameSplitOperator.NumberToString(datetime.getHours())}:${IFrameSplitOperator.NumberToString(datetime.getMinutes())}`;
57343
+ default:
57344
+ return null;
57345
+ }
57346
+ }
57347
+
57328
57348
  //字段颜色格式化
57329
57349
  IFrameSplitOperator.FormatValueColor = function (value, value2)
57330
57350
  {
@@ -137787,7 +137807,7 @@ function JSReportChartContainer(uielement)
137787
137807
  //32=收盘价线 33=K线 35=时间 36=日期字段 38=持仓量 39=结算价 40=昨结算价 41=开仓量 42=平仓量
137788
137808
  //43=1m涨速% 44=3m涨速% 45=5m涨速% 46=10m涨速% 47=15m涨速%
137789
137809
  //80=整行背景色
137790
- //101-199=数值型 201-299=字符型 301-350=进度条 351-400=按钮
137810
+ //101-199=数值型 201-299=字符型 301-350=进度条 351-400=按钮 401-499=日期时间
137791
137811
 
137792
137812
  if (IFrameSplitOperator.IsString(item[1])) stock.Name=item[1];
137793
137813
  if (IFrameSplitOperator.IsNumber(item[2])) stock.YClose=item[2];
@@ -137933,7 +137953,18 @@ function JSReportChartContainer(uielement)
137933
137953
  if (IFrameSplitOperator.IsObject(item[358])) stock.ReserveButton8=item[358];
137934
137954
  if (IFrameSplitOperator.IsObject(item[359])) stock.ReserveButton9=item[359];
137935
137955
  if (IFrameSplitOperator.IsObject(item[360])) stock.ReserveButton10=item[360];
137936
-
137956
+
137957
+ //10个日期时间类型 401-499 { Value:Date, BGColor }
137958
+ if (IFrameSplitOperator.IsObject(item[401])) stock.ReserveDateTime1=item[401];
137959
+ if (IFrameSplitOperator.IsObject(item[402])) stock.ReserveDateTime2=item[402];
137960
+ if (IFrameSplitOperator.IsObject(item[403])) stock.ReserveDateTime3=item[403];
137961
+ if (IFrameSplitOperator.IsObject(item[404])) stock.ReserveDateTime4=item[404];
137962
+ if (IFrameSplitOperator.IsObject(item[405])) stock.ReserveDateTime5=item[405];
137963
+ if (IFrameSplitOperator.IsObject(item[406])) stock.ReserveDateTime6=item[406];
137964
+ if (IFrameSplitOperator.IsObject(item[407])) stock.ReserveDateTime7=item[407];
137965
+ if (IFrameSplitOperator.IsObject(item[408])) stock.ReserveDateTime8=item[408];
137966
+ if (IFrameSplitOperator.IsObject(item[409])) stock.ReserveDateTime9=item[409];
137967
+ if (IFrameSplitOperator.IsObject(item[410])) stock.ReserveDateTime10=item[410];
137937
137968
  }
137938
137969
 
137939
137970
 
@@ -140780,6 +140811,18 @@ var REPORT_COLUMN_ID=
140780
140811
  RESERVE_BUTTON9_ID:459, //ReserveButton9:
140781
140812
  RESERVE_BUTTON10_ID:460, //ReserveButton10:
140782
140813
 
140814
+
140815
+ //预留日期时间类型 10个 501-599
140816
+ RESERVE_DATETIME1_ID:501, //ReserveDateTime1;
140817
+ RESERVE_DATETIME2_ID:502,
140818
+ RESERVE_DATETIME3_ID:503,
140819
+ RESERVE_DATETIME4_ID:504,
140820
+ RESERVE_DATETIME5_ID:505,
140821
+ RESERVE_DATETIME6_ID:506,
140822
+ RESERVE_DATETIME7_ID:507,
140823
+ RESERVE_DATETIME8_ID:508,
140824
+ RESERVE_DATETIME9_ID:509,
140825
+ RESERVE_DATETIME10_ID:510,
140783
140826
  }
140784
140827
 
140785
140828
 
@@ -140876,6 +140919,17 @@ var MAP_COLUMN_FIELD=new Map([
140876
140919
  [REPORT_COLUMN_ID.RESERVE_BUTTON8_ID,"ReserveButton8"],
140877
140920
  [REPORT_COLUMN_ID.RESERVE_BUTTON9_ID,"ReserveButton9"],
140878
140921
  [REPORT_COLUMN_ID.RESERVE_BUTTON10_ID,"ReserveButton10"],
140922
+
140923
+ [REPORT_COLUMN_ID.RESERVE_DATETIME1_ID,"ReserveDateTime1"],
140924
+ [REPORT_COLUMN_ID.RESERVE_DATETIME2_ID,"ReserveDateTime2"],
140925
+ [REPORT_COLUMN_ID.RESERVE_DATETIME3_ID,"ReserveDateTime3"],
140926
+ [REPORT_COLUMN_ID.RESERVE_DATETIME4_ID,"ReserveDateTime4"],
140927
+ [REPORT_COLUMN_ID.RESERVE_DATETIME5_ID,"ReserveDateTime5"],
140928
+ [REPORT_COLUMN_ID.RESERVE_DATETIME6_ID,"ReserveDateTime6"],
140929
+ [REPORT_COLUMN_ID.RESERVE_DATETIME7_ID,"ReserveDateTime7"],
140930
+ [REPORT_COLUMN_ID.RESERVE_DATETIME8_ID,"ReserveDateTime8"],
140931
+ [REPORT_COLUMN_ID.RESERVE_DATETIME9_ID,"ReserveDateTime9"],
140932
+ [REPORT_COLUMN_ID.RESERVE_DATETIME10_ID,"ReserveDateTime10"],
140879
140933
  ]);
140880
140934
 
140881
140935
  function ChartReport()
@@ -141273,6 +141327,10 @@ function ChartReport()
141273
141327
  if (item.Format) colItem.Format=item.Format; //数据格式化设置{ Type:1=原始 2=千分位分割 3=万亿转换, ExFloatPrecision:万亿转换以后的小数位数 }
141274
141328
  if (item.StringFormat) colItem.StringFormat=item.StringFormat; //"{0}%" 输出增加固定字符
141275
141329
  }
141330
+ else if (this.IsReserveDateTime(item.Type))
141331
+ {
141332
+ if (item.DateTimeFormat) colItem.DateTimeFormat=item.DateTimeFormat; //日期格式化
141333
+ }
141276
141334
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID)
141277
141335
  {
141278
141336
  if (!IFrameSplitOperator.IsNumber(item.DataIndex) && !IFrameSplitOperator.IsNumber(item.BlockIndex)) return null;
@@ -141516,6 +141574,18 @@ function ChartReport()
141516
141574
  { Type:REPORT_COLUMN_ID.RESERVE_BUTTON8_ID, Title:"按钮8", TextAlign:"center", FixedWidth:50*GetDevicePixelRatio() },
141517
141575
  { Type:REPORT_COLUMN_ID.RESERVE_BUTTON9_ID, Title:"按钮9", TextAlign:"center", FixedWidth:50*GetDevicePixelRatio() },
141518
141576
  { Type:REPORT_COLUMN_ID.RESERVE_BUTTON10_ID, Title:"按钮10", TextAlign:"center", FixedWidth:50*GetDevicePixelRatio() },
141577
+
141578
+
141579
+ { Type:REPORT_COLUMN_ID.RESERVE_DATETIME1_ID, Title:"日期1", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999-99-99", DateTimeFormat:"YYYY-MM-DD" },
141580
+ { Type:REPORT_COLUMN_ID.RESERVE_DATETIME2_ID, Title:"日期2", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999-99-99", DateTimeFormat:"YYYY-MM-DD" },
141581
+ { Type:REPORT_COLUMN_ID.RESERVE_DATETIME3_ID, Title:"日期3", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999-99-99", DateTimeFormat:"YYYY-MM-DD" },
141582
+ { Type:REPORT_COLUMN_ID.RESERVE_DATETIME4_ID, Title:"日期4", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999-99-99", DateTimeFormat:"YYYY-MM-DD" },
141583
+ { Type:REPORT_COLUMN_ID.RESERVE_DATETIME5_ID, Title:"日期5", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999-99-99", DateTimeFormat:"YYYY-MM-DD" },
141584
+ { Type:REPORT_COLUMN_ID.RESERVE_DATETIME6_ID, Title:"日期6", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999-99-99", DateTimeFormat:"YYYY-MM-DD" },
141585
+ { Type:REPORT_COLUMN_ID.RESERVE_DATETIME7_ID, Title:"日期7", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999-99-99", DateTimeFormat:"YYYY-MM-DD" },
141586
+ { Type:REPORT_COLUMN_ID.RESERVE_DATETIME8_ID, Title:"日期8", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999-99-99", DateTimeFormat:"YYYY-MM-DD" },
141587
+ { Type:REPORT_COLUMN_ID.RESERVE_DATETIME9_ID, Title:"日期9", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999-99-99", DateTimeFormat:"YYYY-MM-DD" },
141588
+ { Type:REPORT_COLUMN_ID.RESERVE_DATETIME10_ID, Title:"日期10", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999-99-99", DateTimeFormat:"YYYY-MM-DD" },
141519
141589
 
141520
141590
  ];
141521
141591
 
@@ -142810,6 +142880,11 @@ function ChartReport()
142810
142880
  this.FormatReserveString(column, stock, drawInfo);
142811
142881
  this.FormatDrawInfoEvent(stock, data, column, drawInfo);
142812
142882
  }
142883
+ else if (this.IsReserveDateTime(column.Type))
142884
+ {
142885
+ this.FormatReserveDateTime(column, stock, drawInfo);
142886
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
142887
+ }
142813
142888
  else if (this.IsReserveProgressBarColumn(column.Type))
142814
142889
  {
142815
142890
  this.FormatReserveProgressBar(column, stock, drawInfo);
@@ -142979,6 +143054,18 @@ function ChartReport()
142979
143054
  return ARARY_TYPE.includes(value);
142980
143055
  }
142981
143056
 
143057
+ this.IsReserveDateTime=function(value)
143058
+ {
143059
+ var ARARY_TYPE=
143060
+ [
143061
+ REPORT_COLUMN_ID.RESERVE_DATETIME1_ID,REPORT_COLUMN_ID.RESERVE_DATETIME2_ID,REPORT_COLUMN_ID.RESERVE_DATETIME3_ID,REPORT_COLUMN_ID.RESERVE_DATETIME4_ID,
143062
+ REPORT_COLUMN_ID.RESERVE_DATETIME5_ID,REPORT_COLUMN_ID.RESERVE_DATETIME6_ID,REPORT_COLUMN_ID.RESERVE_DATETIME7_ID,REPORT_COLUMN_ID.RESERVE_DATETIME8_ID,
143063
+ REPORT_COLUMN_ID.RESERVE_DATETIME9_ID,REPORT_COLUMN_ID.RESERVE_DATETIME10_ID
143064
+ ];
143065
+
143066
+ return ARARY_TYPE.includes(value);
143067
+ }
143068
+
142982
143069
 
142983
143070
 
142984
143071
  this.DrawCustomText=function(drawInfo, column, left, top, cellWidth)
@@ -143411,6 +143498,21 @@ function ChartReport()
143411
143498
  }
143412
143499
  }
143413
143500
 
143501
+ this.FormatReserveDateTime=function(column, data, drawInfo)
143502
+ {
143503
+ if (column.DefaultText) drawInfo.Text=column.DefaultText;
143504
+
143505
+ var fieldName=MAP_COLUMN_FIELD.get(column.Type);
143506
+ if (!data || !fieldName) return;
143507
+
143508
+ var item=data[fieldName];
143509
+ if (!IFrameSplitOperator.IsObject(item)) return;
143510
+
143511
+ if (item.DateTime) drawInfo.Text=IFrameSplitOperator.FormatDateTimeStringV2(item.DateTime,column.DateTimeFormat);
143512
+ if (item.TextColor) drawInfo.TextColor=item.TextColor;
143513
+ if (item.BGColor) drawInfo.BGColor=item.BGColor;
143514
+ }
143515
+
143414
143516
  this.FormatReserveProgressBar=function(column, data, drawInfo)
143415
143517
  {
143416
143518
  var fieldName=MAP_COLUMN_FIELD.get(column.Type);
@@ -159674,7 +159776,8 @@ function JSDialogModifyIndexParam()
159674
159776
 
159675
159777
  this.AryData=[];
159676
159778
  this.IndexData=null; //指标数据 { WindowsIndex:, Type:1=主图 2=叠加, Identify, IndexScript: }
159677
- this.Arguments=[]; //参数备份
159779
+ this.Arguments=[]; //默认参数
159780
+ this.EnableRestoreParam=true; //是否允许“恢复默认"
159678
159781
 
159679
159782
  this.RestoreFocusDelay=800;
159680
159783
 
@@ -159685,6 +159788,7 @@ function JSDialogModifyIndexParam()
159685
159788
  {
159686
159789
  if (IFrameSplitOperator.IsNumber(option.Style)) this.Style=option.Style;
159687
159790
  if (IFrameSplitOperator.IsNumber(option.MaxRowCount)) this.MaxRowCount=option.MaxRowCount;
159791
+ if (IFrameSplitOperator.IsBool(option.EnableRestoreParam)) this.EnableRestoreParam=option.EnableRestoreParam;
159688
159792
  }
159689
159793
  }
159690
159794
 
@@ -159725,7 +159829,7 @@ function JSDialogModifyIndexParam()
159725
159829
 
159726
159830
  this.OnClickColseButton=function(e)
159727
159831
  {
159728
- this.RestoreParam(); //还原参数
159832
+ //this.RestoreParam(); //还原参数
159729
159833
  this.Close(e);
159730
159834
  }
159731
159835
 
@@ -159756,7 +159860,8 @@ function JSDialogModifyIndexParam()
159756
159860
  this.SetIndexData=function(data)
159757
159861
  {
159758
159862
  this.IndexData=data;
159759
- this.BackupParam();
159863
+ this.GetDefaultParam();
159864
+ //this.BackupParam();
159760
159865
  }
159761
159866
 
159762
159867
  this.OnMouseDownTitle=function(e)
@@ -159834,31 +159939,6 @@ function JSDialogModifyIndexParam()
159834
159939
  table.className="UMyChart_ModifyIndexParam_Table";
159835
159940
  divTable.appendChild(table);
159836
159941
 
159837
- /*
159838
- var thead=document.createElement("thead");
159839
- table.appendChild(thead);
159840
-
159841
- var trDom=document.createElement("tr");
159842
- trDom.className='UMyChart_ModifyIndexParam_head_Tr';
159843
- thead.appendChild(trDom);
159844
-
159845
- var thDom=document.createElement("th");
159846
- thDom.className="UMyChart_ModifyIndexParam_Th";
159847
- thDom.innerText="变量";
159848
- trDom.appendChild(thDom);
159849
-
159850
- var thDom=document.createElement("th");
159851
- thDom.className="UMyChart_ModifyIndexParam_Th";
159852
- thDom.innerText="数值";
159853
- trDom.appendChild(thDom);
159854
-
159855
- var thDom=document.createElement("th");
159856
- thDom.className="UMyChart_ModifyIndexParam_Th";
159857
- thDom.innerText="说明";
159858
- trDom.appendChild(thDom);
159859
- */
159860
-
159861
-
159862
159942
  var tbody=document.createElement("tbody");
159863
159943
  tbody.className="UMyChart_ModifyIndexParam_Tbody";
159864
159944
  table.appendChild(tbody);
@@ -159875,17 +159955,29 @@ function JSDialogModifyIndexParam()
159875
159955
  divButton.className='UMyChart_ModifyIndexParam_Button_Div';
159876
159956
  divFrame.appendChild(divButton);
159877
159957
 
159878
- var btnRestore=document.createElement("button");
159879
- //btnRestore.className="UMyChart_ModifyIndexParam_button";
159880
- btnRestore.innerText="恢复默认";
159881
- btnRestore.addEventListener("mousedown", (e)=>{ this.OnClickRestoreButton(e); });
159882
- divButton.appendChild(btnRestore);
159958
+ if (this.EnableRestoreParam)
159959
+ {
159960
+ var btnRestore=document.createElement("button");
159961
+ //btnRestore.className="UMyChart_ModifyIndexParam_button";
159962
+ btnRestore.innerText="恢复默认";
159963
+ btnRestore.addEventListener("mousedown", (e)=>{ this.OnClickRestoreButton(e); });
159964
+ divButton.appendChild(btnRestore);
159965
+ }
159966
+
159883
159967
 
159968
+ /*
159884
159969
  var btnOk=document.createElement("button");
159885
159970
  //btnOk.className="UMyChart_ModifyIndexParam_button";
159886
159971
  btnOk.innerText="确认";
159887
159972
  btnOk.addEventListener("mousedown", (e)=>{ this.OnClickOkButton(e); })
159888
159973
  divButton.appendChild(btnOk);
159974
+ */
159975
+
159976
+ var btnOk=document.createElement("button");
159977
+ //btnOk.className="UMyChart_ModifyIndexParam_button";
159978
+ btnOk.innerText="关闭";
159979
+ btnOk.addEventListener("mousedown", (e)=>{ this.Close(e); })
159980
+ divButton.appendChild(btnOk);
159889
159981
 
159890
159982
  document.body.appendChild(divDom);
159891
159983
 
@@ -160027,6 +160119,41 @@ function JSDialogModifyIndexParam()
160027
160119
  }
160028
160120
  }
160029
160121
 
160122
+ this.GetDefaultParam=function()
160123
+ {
160124
+ this.Arguments=[];
160125
+ if (!this.IndexData || !this.IndexData.IndexScript) return;
160126
+ var indexScript=this.IndexData.IndexScript;
160127
+
160128
+ var args=[];
160129
+ if (indexScript.ID)
160130
+ {
160131
+ var scriptData = new JSIndexScript();
160132
+ var indexInfo = scriptData.Get(indexScript.ID);
160133
+ if (indexInfo) args=indexInfo.Args;
160134
+ }
160135
+
160136
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.GET_DEFAULT_INDEX_PARAM);
160137
+ if (event && event.Callback)
160138
+ {
160139
+ var sendData={ IndexData:this.IndexData, Args:args.slice(), PreventDefault:false };
160140
+ event.Callback(event, sendData, this);
160141
+
160142
+ if (sendData.PreventDefault) return;
160143
+
160144
+ args=sendData.Args;
160145
+ }
160146
+
160147
+ if (IFrameSplitOperator.IsNonEmptyArray(args))
160148
+ {
160149
+ for(var i=0;i<args.length;++i)
160150
+ {
160151
+ var item=args[i];
160152
+ this.Arguments.push({Name:item.Name, Value:item.Value, Index:i});
160153
+ }
160154
+ }
160155
+ }
160156
+
160030
160157
  this.OnParamMouseUp=function(e)
160031
160158
  {
160032
160159
  var input=e.target;
@@ -160193,7 +160320,7 @@ function HQChartScriptWorker()
160193
160320
 
160194
160321
 
160195
160322
 
160196
- var HQCHART_VERSION="1.1.14803";
160323
+ var HQCHART_VERSION="1.1.14807";
160197
160324
 
160198
160325
  function PrintHQChartVersion()
160199
160326
  {