hqchart 1.1.13614 → 1.1.13636

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.13614",
3
+ "version": "1.1.13636",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -24558,6 +24558,8 @@ function APIScriptIndex(name,script,args,option, isOverlay)
24558
24558
  if (item.isshow==false) outVarItem.IsShow = false;
24559
24559
  if (item.isexdata==true) outVarItem.IsExData = true;
24560
24560
  if (item.BreakPoint) outVarItem.BreakPoint=item.BreakPoint;
24561
+ if (item.UpColor) outVarItem.UpColor=item.UpColor;
24562
+ if (item.DownColor) outVarItem.DownColor=item.DownColor;
24561
24563
 
24562
24564
  result.push(outVarItem);
24563
24565
  }
@@ -860,6 +860,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
860
860
  if (IFrameSplitOperator.IsBool(option.EnableNewIndex)) chart.EnableNewIndex=option.EnableNewIndex;
861
861
  if (IFrameSplitOperator.IsBool(option.EnableIndexChartDrag)) chart.EnableIndexChartDrag=option.EnableIndexChartDrag;
862
862
  if (IFrameSplitOperator.IsBool(option.EnableVerifyRecvData)) chart.EnableVerifyRecvData=option.EnableVerifyRecvData;
863
+ if (IFrameSplitOperator.IsBool(option.EnableNightDayBG)) chart.EnableNightDayBG=option.EnableNightDayBG;
863
864
 
864
865
  if (option.GlobalOption)
865
866
  {
@@ -2613,6 +2614,9 @@ var JSCHART_EVENT_ID=
2613
2614
  ON_FORMAT_CALL_AUCTION_INDEX_TITLE:153, //集合竞价指标窗口标题内容
2614
2615
 
2615
2616
  ON_FORMAT_KLINE_HIGH_LOW_TITLE:154, //K线最高最低价格式化内容
2617
+ ON_CUSTOM_CORSSCURSOR_POSITION:155, //自定义十字光标X轴的输出的位置
2618
+
2619
+ ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX:156, //日盘夜盘的分界线
2616
2620
  }
2617
2621
 
2618
2622
  var JSCHART_OPERATOR_ID=
@@ -8401,6 +8405,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8401
8405
  if (IFrameSplitOperator.IsBool(windowItem.IsShowIndexName)) frame.IsShowIndexName=windowItem.IsShowIndexName;
8402
8406
  if (IFrameSplitOperator.IsNumber(windowItem.IndexParamSpace)) frame.IndexParamSpace=windowItem.IndexParamSpace;
8403
8407
  if (IFrameSplitOperator.IsNumber(windowItem.IndexTitleSpace)) frame.IndexTitleSpace=windowItem.IndexTitleSpace;
8408
+ if (!IFrameSplitOperator.IsUndefined(windowItem.HorizontalReserved)) frame.HorizontalReserved=windowItem.HorizontalReserved; //Y轴上下预留
8404
8409
  }
8405
8410
 
8406
8411
  if (frameItem)
@@ -10300,7 +10305,7 @@ function IChartFramePainting()
10300
10305
 
10301
10306
  this.YSpecificMaxMin=null; //指定Y轴最大最小值
10302
10307
  this.IsShowBorder = true; //是否显示边框
10303
- this.IsShowTitleArrow=true; //是否显示指标信息上涨下跌箭头
10308
+ this.IsShowTitleArrow=g_JSChartResource.IndexTitle.EnableIndexArrow; //是否显示指标信息上涨下跌箭头
10304
10309
  this.TitleArrowType=g_JSChartResource.IndexTitle.ArrowType; //指标信息上涨下跌箭头类型 0=独立颜色 1=跟指标名字颜色一致
10305
10310
  this.IsShowIndexName=true; //是否显示指标名字
10306
10311
  this.IsShowOverlayIndexName=true; //是否显示叠加指标名字
@@ -12930,6 +12935,8 @@ function MinuteFrame()
12930
12935
  this.BeforeOpenVerticalInfo=[]; //盘前集合竞价X轴
12931
12936
  this.AfterCloseVerticalInfo=[]; //收盘集合竞价X轴
12932
12937
 
12938
+ this.NightDayConfig=CloneData(g_JSChartResource.Minute.NightDay);
12939
+
12933
12940
  this.DrawFrame=function()
12934
12941
  {
12935
12942
  if (!this.IsMinSize)
@@ -12941,6 +12948,8 @@ function MinuteFrame()
12941
12948
 
12942
12949
  if (this.BeforeDrawXYCallback) this.BeforeDrawXYCallback(this);
12943
12950
 
12951
+ this.DrawNightDayBG(); //绘制夜盘 日盘背景
12952
+
12944
12953
  this.DrawTitleBG();
12945
12954
  this.DrawHorizontal();
12946
12955
  this.DrawVertical();
@@ -13384,6 +13393,86 @@ function MinuteFrame()
13384
13393
  }
13385
13394
  }
13386
13395
 
13396
+ this.DrawNightDayBG=function()
13397
+ {
13398
+ if (this.DayCount!=1) return;
13399
+ if (!this.HQChart) return;
13400
+ if (!this.HQChart.EnableNightDayBG) return;
13401
+
13402
+ var symbol=this.HQChart.Symbol;
13403
+ if (!symbol) return;
13404
+
13405
+ var xIndex=-1;
13406
+ //获取夜盘和日期的分界线X索引位置
13407
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX)
13408
+ if (!event || !event.Callback) return;
13409
+
13410
+ var sendData={ Symbol:symbol, XIndex:xIndex, MinuteTimeStringData:g_MinuteTimeStringData };
13411
+ event.Callback(event,sendData,this);
13412
+ xIndex=sendData.XIndex;
13413
+ if (xIndex<0) return;
13414
+
13415
+ var border=this.ChartBorder.GetBorder();
13416
+ var x=this.GetXFromIndex(xIndex);
13417
+
13418
+ var rtNight={ Left: border.Left, Top:border.TopEx, Right:x, Bottom:border.Bottom };
13419
+ rtNight.Width=rtNight.Right-rtNight.Left;
13420
+ rtNight.Height=rtNight.Bottom-rtNight.Top;
13421
+
13422
+ this.Canvas.fillStyle = this.NightDayConfig.NightBGColor;
13423
+ this.Canvas.fillRect(rtNight.Left, rtNight.Top, rtNight.Width, rtNight.Height);
13424
+
13425
+ if (this.Identify!=0) return;
13426
+
13427
+ //显示 日盘夜盘文字
13428
+ this.Canvas.font=this.NightDayConfig.Font;
13429
+ this.Canvas.textBaseline = "bottom";
13430
+ this.Canvas.textAlign = 'left';
13431
+ var aryTitle=[{ Title:"夜盘", Position:1, Config:this.NightDayConfig.Night }, { Title:"日盘", Position:0,Config:this.NightDayConfig.Day }];
13432
+ var textHeight= this.Canvas.measureText("擎").width;
13433
+ for(var i=0;i<aryTitle.length;++i)
13434
+ {
13435
+ var item=aryTitle[i];
13436
+ var text=g_JSChartLocalization.GetText(item.Title,this.HQChart.LanguageID);
13437
+ var testWidth = this.Canvas.measureText(text).width;
13438
+ var rtItem=
13439
+ {
13440
+ Width:testWidth+item.Config.Margin.Left+item.Config.Margin.Right,
13441
+ Height:textHeight+item.Config.Margin.Top+item.Config.Margin.Bottom,
13442
+ Bottom:border.Bottom
13443
+ };
13444
+ rtItem.Top=rtItem.Bottom-rtItem.Height;
13445
+
13446
+ if (item.Position===1)
13447
+ {
13448
+ rtItem.Right=x-1;
13449
+ rtItem.Left=rtItem.Right-rtItem.Width;
13450
+ }
13451
+ else
13452
+ {
13453
+ rtItem.Left=x+1;
13454
+ rtItem.Right=rtItem.Left+rtItem.Width;
13455
+ }
13456
+
13457
+ if (item.Config.BGColor)
13458
+ {
13459
+ this.Canvas.fillStyle = item.Config.BGColor;
13460
+ this.Canvas.fillRect(rtItem.Left, rtItem.Top, rtItem.Width, rtItem.Height);
13461
+ }
13462
+
13463
+ if (item.Config.BorderColor)
13464
+ {
13465
+ this.Canvas.strokeStyle = item.Config.BorderColor;
13466
+ this.Canvas.strokeRect(ToFixedPoint(rtItem.Left), ToFixedPoint(rtItem.Top), ToFixedRect(rtItem.Width), ToFixedRect(rtItem.Height));
13467
+ }
13468
+
13469
+
13470
+ this.Canvas.fillStyle = item.Config.Color;
13471
+ this.Canvas.fillText(text, rtItem.Left+item.Config.Margin.Left, rtItem.Bottom-item.Config.Margin.Bottom );
13472
+ }
13473
+
13474
+ }
13475
+
13387
13476
  //选中的画图工具X轴坐标信息
13388
13477
  this.DrawPictureXCoordinate=function(drawPicture, range, option)
13389
13478
  {
@@ -14963,6 +15052,89 @@ function MinuteHScreenFrame()
14963
15052
  return this.GetLeftExtendYFromData(value,isLimit,obj);
14964
15053
  }
14965
15054
 
15055
+ this.DrawNightDayBG=function()
15056
+ {
15057
+ if (this.DayCount!=1) return;
15058
+ if (!this.HQChart) return;
15059
+ if (!this.HQChart.EnableNightDayBG) return;
15060
+
15061
+ var symbol=this.HQChart.Symbol;
15062
+ if (!symbol) return;
15063
+
15064
+ var xIndex=-1;
15065
+ //获取夜盘和日期的分界线X索引位置
15066
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX)
15067
+ if (!event || !event.Callback) return;
15068
+
15069
+ var sendData={ Symbol:symbol, XIndex:xIndex, MinuteTimeStringData:g_MinuteTimeStringData };
15070
+ event.Callback(event,sendData,this);
15071
+ xIndex=sendData.XIndex;
15072
+ if (xIndex<0) return;
15073
+
15074
+ var border=this.ChartBorder.GetHScreenBorder();
15075
+ var y=this.GetXFromIndex(xIndex);
15076
+
15077
+ var rtNight={ Left: border.Left, Top:border.Top, Right:border.RightEx, Bottom:y };
15078
+ rtNight.Width=rtNight.Right-rtNight.Left;
15079
+ rtNight.Height=rtNight.Bottom-rtNight.Top;
15080
+
15081
+ this.Canvas.fillStyle = this.NightDayConfig.NightBGColor;
15082
+ this.Canvas.fillRect(rtNight.Left, rtNight.Top, rtNight.Width, rtNight.Height);
15083
+
15084
+ if (this.Identify!=0) return;
15085
+
15086
+ //显示 日盘夜盘文字
15087
+ this.Canvas.font=this.NightDayConfig.Font;
15088
+ this.Canvas.textBaseline = "bottom";
15089
+ this.Canvas.textAlign = 'left';
15090
+ var aryTitle=[{ Title:"夜盘", Position:1, Config:this.NightDayConfig.Night }, { Title:"日盘", Position:0,Config:this.NightDayConfig.Day }];
15091
+ var textHeight= this.Canvas.measureText("擎").width;
15092
+ for(var i=0;i<aryTitle.length;++i)
15093
+ {
15094
+ var item=aryTitle[i];
15095
+ var text=g_JSChartLocalization.GetText(item.Title,this.HQChart.LanguageID);
15096
+ var testWidth = this.Canvas.measureText(text).width;
15097
+ var rtItem=
15098
+ {
15099
+ Height:testWidth+item.Config.Margin.Left+item.Config.Margin.Right,
15100
+ Width:textHeight+item.Config.Margin.Top+item.Config.Margin.Bottom,
15101
+ Left:border.Left
15102
+ };
15103
+ rtItem.Right=rtItem.Left+rtItem.Width;
15104
+
15105
+ if (item.Position===1)
15106
+ {
15107
+ rtItem.Bottom=y-1;
15108
+ rtItem.Top=rtItem.Bottom-rtItem.Height;
15109
+ }
15110
+ else
15111
+ {
15112
+ rtItem.Top=y+1;
15113
+ rtItem.Bottom=rtItem.Top+rtItem.Height;
15114
+ }
15115
+
15116
+ if (item.Config.BGColor)
15117
+ {
15118
+ this.Canvas.fillStyle = item.Config.BGColor;
15119
+ this.Canvas.fillRect(rtItem.Left, rtItem.Top, rtItem.Width, rtItem.Height);
15120
+ }
15121
+
15122
+ if (item.Config.BorderColor)
15123
+ {
15124
+ this.Canvas.strokeStyle = item.Config.BorderColor;
15125
+ this.Canvas.strokeRect(ToFixedPoint(rtItem.Left), ToFixedPoint(rtItem.Top), ToFixedRect(rtItem.Width), ToFixedRect(rtItem.Height));
15126
+ }
15127
+
15128
+ this.Canvas.fillStyle = item.Config.Color;
15129
+ var xText=rtItem.Left;
15130
+ var yText=rtItem.Top;
15131
+ this.Canvas.save();
15132
+ this.Canvas.translate(xText,yText);
15133
+ this.Canvas.rotate(90 * Math.PI / 180);
15134
+ this.Canvas.fillText(text, item.Config.Margin.Left, -item.Config.Margin.Bottom);
15135
+ this.Canvas.restore();
15136
+ }
15137
+ }
14966
15138
 
14967
15139
  }
14968
15140
 
@@ -18889,6 +19061,7 @@ function HQTradeFrame()
18889
19061
  for (var i in this.SubFrame)
18890
19062
  {
18891
19063
  var item = this.SubFrame[i];
19064
+ if (item.Height<=0) continue;
18892
19065
  if (item.Frame.DrawInsideHorizontal) item.Frame.DrawInsideHorizontal();
18893
19066
  }
18894
19067
  }
@@ -49740,8 +49913,8 @@ function ChartCorssCursor()
49740
49913
  }
49741
49914
  }
49742
49915
 
49743
- //X轴 Bottom=10 使用第1个指标框位置
49744
- if ((this.ShowTextMode.Bottom==1 || this.ShowTextMode.Bottom==2 || this.ShowTextMode.Bottom==10) && this.StringFormatX.Operator())
49916
+ //X轴 Bottom==8 自定义
49917
+ if ((this.ShowTextMode.Bottom==1 || this.ShowTextMode.Bottom==2 || this.ShowTextMode.Bottom==8) && this.StringFormatX.Operator())
49745
49918
  {
49746
49919
  var text=this.StringFormatX.Text;
49747
49920
  this.Canvas.font=this.Font;
@@ -49750,49 +49923,53 @@ function ChartCorssCursor()
49750
49923
 
49751
49924
  var yCenter=bottom+2+this.TextHeight/2;
49752
49925
  var yTop=bottom+2;
49926
+ var bShowText=true;
49753
49927
  if (this.ShowTextMode.Bottom==2)
49754
49928
  {
49755
49929
  yCenter=bottom-this.TextHeight/2-2;
49756
49930
  yTop=bottom-this.TextHeight-2;
49757
49931
  }
49758
- else if (this.ShowTextMode.Bottom==10)
49932
+ else if (this.ShowTextMode.Bottom==8)
49759
49933
  {
49760
- var frame=this.Frame.SubFrame[0].Frame;
49761
- if (frame.GetCorssCursorTop)
49934
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_CORSSCURSOR_POSITION);
49935
+ if (event && event.Callback)
49762
49936
  {
49763
- var value=frame.GetCorssCursorTop();
49764
- if (IFrameSplitOperator.IsNumber(value))
49765
- {
49766
- yCenter=value+this.TextHeight/2;
49767
- yTop=value;
49768
- }
49937
+ var sendData={ YCenter:yCenter, YTop:yTop, Height:this.TextHeight, IsShowText:bShowText };
49938
+ event.Callback(event, sendData, this);
49939
+
49940
+ yCenter=sendData.YCenter;
49941
+ yTop=sendData.YTop;
49942
+ bShowText=sendData.IsShowText;
49769
49943
  }
49770
49944
  }
49771
49945
 
49772
49946
  //JSConsole.Chart.Log('[ChartCorssCursor::Draw] ',yCenter);
49773
- if (x-textWidth/2<3) //左边位置不够了, 顶着左边画
49774
- {
49775
- this.DrawTextBGRect(x-1,yTop,textWidth,this.TextHeight);
49776
- this.Canvas.textAlign="left";
49777
- this.Canvas.textBaseline="middle";
49778
- this.Canvas.fillStyle=this.TextColor;
49779
- this.Canvas.fillText(text,x+1,yCenter,textWidth);
49780
- }
49781
- else if (x+textWidth/2>=right)
49782
- {
49783
- this.DrawTextBGRect(right-textWidth,yTop,textWidth,this.TextHeight);
49784
- this.Canvas.textAlign="right";
49785
- this.Canvas.textBaseline="middle";
49786
- this.Canvas.fillStyle=this.TextColor;
49787
- this.Canvas.fillText(text,right-2,yCenter,textWidth);
49788
- }
49789
- else
49947
+ if (bShowText)
49790
49948
  {
49791
- this.DrawTextBGRect(x-textWidth/2,yTop,textWidth,this.TextHeight);
49792
- this.Canvas.textAlign="center";
49793
- this.Canvas.textBaseline="middle";
49794
- this.Canvas.fillStyle=this.TextColor;
49795
- this.Canvas.fillText(text,x,yCenter,textWidth);
49949
+ if (x-textWidth/2<3) //左边位置不够了, 顶着左边画
49950
+ {
49951
+ this.DrawTextBGRect(x-1,yTop,textWidth,this.TextHeight);
49952
+ this.Canvas.textAlign="left";
49953
+ this.Canvas.textBaseline="middle";
49954
+ this.Canvas.fillStyle=this.TextColor;
49955
+ this.Canvas.fillText(text,x+1,yCenter,textWidth);
49956
+ }
49957
+ else if (x+textWidth/2>=right)
49958
+ {
49959
+ this.DrawTextBGRect(right-textWidth,yTop,textWidth,this.TextHeight);
49960
+ this.Canvas.textAlign="right";
49961
+ this.Canvas.textBaseline="middle";
49962
+ this.Canvas.fillStyle=this.TextColor;
49963
+ this.Canvas.fillText(text,right-2,yCenter,textWidth);
49964
+ }
49965
+ else
49966
+ {
49967
+ this.DrawTextBGRect(x-textWidth/2,yTop,textWidth,this.TextHeight);
49968
+ this.Canvas.textAlign="center";
49969
+ this.Canvas.textBaseline="middle";
49970
+ this.Canvas.fillStyle=this.TextColor;
49971
+ this.Canvas.fillText(text,x,yCenter,textWidth);
49972
+ }
49796
49973
  }
49797
49974
  }
49798
49975
 
@@ -50295,8 +50472,8 @@ function ChartCorssCursor()
50295
50472
  }
50296
50473
  }
50297
50474
 
50298
- //X轴 Bottom=10 使用第1个指标框位置
50299
- if ((this.ShowTextMode.Bottom===1 || this.ShowTextMode.Bottom==10) && this.StringFormatX.Operator())
50475
+ //X轴 Bottom=8 自定义X轴文字位置
50476
+ if ((this.ShowTextMode.Bottom===1 || this.ShowTextMode.Bottom==8) && this.StringFormatX.Operator())
50300
50477
  {
50301
50478
  var text=this.StringFormatX.Text;
50302
50479
  this.Canvas.font=this.Font;
@@ -50304,64 +50481,67 @@ function ChartCorssCursor()
50304
50481
  this.Canvas.fillStyle=this.TextBGColor;
50305
50482
  var textWidth=this.Canvas.measureText(text).width+4; //前后各空2个像素
50306
50483
  var xText=left;
50307
-
50308
- if (this.ShowTextMode.Bottom==10)
50484
+ var bShowText=true;
50485
+ if (this.ShowTextMode.Bottom==8)
50309
50486
  {
50310
- var frame=this.Frame.SubFrame[0].Frame;
50311
- if (frame.GetCorssCursorTop)
50487
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_CORSSCURSOR_POSITION);
50488
+ if (event && event.Callback)
50312
50489
  {
50313
- var value=frame.GetCorssCursorTop();
50314
- if (IFrameSplitOperator.IsNumber(value))
50315
- {
50316
- xText=value;
50317
- }
50490
+ var sendData={ XText:xText, Height:this.TextHeight, IsShowText:bShowText };
50491
+ event.Callback(event, sendData, this);
50492
+
50493
+ xText=sendData.XText;
50494
+ bShowText=sendData.IsShowText;
50318
50495
  }
50319
50496
  }
50320
50497
 
50321
- if (y-textWidth/2<3) //左边位置不够了, 顶着左边画
50498
+ if (bShowText)
50322
50499
  {
50323
- var yText=y;
50324
- this.Canvas.save();
50325
- this.Canvas.translate(xText, yText);
50326
- this.Canvas.rotate(90 * Math.PI / 180); //数据和框子旋转180度
50500
+ if (y-textWidth/2<3) //左边位置不够了, 顶着左边画
50501
+ {
50502
+ var yText=y;
50503
+ this.Canvas.save();
50504
+ this.Canvas.translate(xText, yText);
50505
+ this.Canvas.rotate(90 * Math.PI / 180); //数据和框子旋转180度
50327
50506
 
50328
- this.Canvas.fillRect(0,0,textWidth,this.TextHeight);
50329
- this.Canvas.textAlign="left";
50330
- this.Canvas.textBaseline="middle";
50331
- this.Canvas.fillStyle=this.TextColor;
50332
- this.Canvas.fillText(text,2,this.TextHeight/2,textWidth);
50507
+ this.Canvas.fillRect(0,0,textWidth,this.TextHeight);
50508
+ this.Canvas.textAlign="left";
50509
+ this.Canvas.textBaseline="middle";
50510
+ this.Canvas.fillStyle=this.TextColor;
50511
+ this.Canvas.fillText(text,2,this.TextHeight/2,textWidth);
50333
50512
 
50334
- this.Canvas.restore();
50335
- }
50336
- else if (y+textWidth/2>=bottom)
50337
- {
50338
- var yText=y;
50339
- this.Canvas.save();
50340
- this.Canvas.translate(xText, yText);
50341
- this.Canvas.rotate(90 * Math.PI / 180); //数据和框子旋转180度
50513
+ this.Canvas.restore();
50514
+ }
50515
+ else if (y+textWidth/2>=bottom)
50516
+ {
50517
+ var yText=y;
50518
+ this.Canvas.save();
50519
+ this.Canvas.translate(xText, yText);
50520
+ this.Canvas.rotate(90 * Math.PI / 180); //数据和框子旋转180度
50342
50521
 
50343
- this.Canvas.fillRect(-textWidth,0,textWidth,this.TextHeight);
50344
- this.Canvas.textAlign="right";
50345
- this.Canvas.textBaseline="middle";
50346
- this.Canvas.fillStyle=this.TextColor;
50347
- this.Canvas.fillText(text,-2,this.TextHeight/2,textWidth);
50522
+ this.Canvas.fillRect(-textWidth,0,textWidth,this.TextHeight);
50523
+ this.Canvas.textAlign="right";
50524
+ this.Canvas.textBaseline="middle";
50525
+ this.Canvas.fillStyle=this.TextColor;
50526
+ this.Canvas.fillText(text,-2,this.TextHeight/2,textWidth);
50348
50527
 
50349
- this.Canvas.restore();
50350
- }
50351
- else
50352
- {
50353
- var yText=y;
50354
- this.Canvas.save();
50355
- this.Canvas.translate(xText, yText);
50356
- this.Canvas.rotate(90 * Math.PI / 180); //数据和框子旋转180度
50528
+ this.Canvas.restore();
50529
+ }
50530
+ else
50531
+ {
50532
+ var yText=y;
50533
+ this.Canvas.save();
50534
+ this.Canvas.translate(xText, yText);
50535
+ this.Canvas.rotate(90 * Math.PI / 180); //数据和框子旋转180度
50357
50536
 
50358
- this.Canvas.fillRect(-textWidth/2,0,textWidth,this.TextHeight);
50359
- this.Canvas.textAlign="center";
50360
- this.Canvas.textBaseline="middle";
50361
- this.Canvas.fillStyle=this.TextColor;
50362
- this.Canvas.fillText(text,0,this.TextHeight/2,textWidth);
50537
+ this.Canvas.fillRect(-textWidth/2,0,textWidth,this.TextHeight);
50538
+ this.Canvas.textAlign="center";
50539
+ this.Canvas.textBaseline="middle";
50540
+ this.Canvas.fillStyle=this.TextColor;
50541
+ this.Canvas.fillText(text,0,this.TextHeight/2,textWidth);
50363
50542
 
50364
- this.Canvas.restore();
50543
+ this.Canvas.restore();
50544
+ }
50365
50545
  }
50366
50546
  }
50367
50547
 
@@ -66825,6 +67005,14 @@ function JSChartResource()
66825
67005
  Point:{ Color:"rgb(65,105,225)", Radius:2*GetDevicePixelRatio() },
66826
67006
  };
66827
67007
 
67008
+ this.Minute.NightDay=
67009
+ {
67010
+ NightBGColor:"rgba(0,0,0,0.2)",
67011
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
67012
+ Day: { Color:"rgb(0,0,0)", BGColor:"rgb(179,179,179)", BorderColor:"rgb(179,179,179)", Margin:{ Left:5, Top:2, Bottom:2, Right:5 } },
67013
+ Night: { Color:"rgb(0,0,0)", BGColor:"rgb(179,179,179)", BorderColor:"rgb(179,179,179)", Margin:{ Left:5, Top:2, Bottom:2, Right:5 } },
67014
+ }
67015
+
66828
67016
  this.DefaultTextColor="rgb(43,54,69)"; //图形中默认的字体颜色
66829
67017
  this.DefaultTextFont=14*GetDevicePixelRatio() +'px 微软雅黑'; //图形中默认的字体
66830
67018
  this.TitleFont=13*GetDevicePixelRatio() +'px 微软雅黑'; //指标显示,tooltip显示字体
@@ -66847,6 +67035,7 @@ function JSChartResource()
66847
67035
  },
66848
67036
 
66849
67037
  ArrowType:0,
67038
+ EnableIndexArrow:true, //指标数值是否带上涨下跌箭头
66850
67039
 
66851
67040
  NameArrow:{ Color:"rgb(43,54,69)", Space:2, Symbol:'▼' },
66852
67041
  }
@@ -68108,6 +68297,29 @@ function JSChartResource()
68108
68297
  if (item.Point.Radius) this.Minute.After.Point.Radius=item.Point.Radius;
68109
68298
  }
68110
68299
  }
68300
+
68301
+ if (style.Minute.NightDay)
68302
+ {
68303
+ var item=style.Minute.NightDay;
68304
+ if (item.NightBGColor) this.Minute.NightDay.NightBGColor=item.NightBGColor;
68305
+ if (item.Font) this.Minute.NightDay.Font=item.Font;
68306
+ if (item.Day)
68307
+ {
68308
+ var subItem=item.Day;
68309
+ if (subItem.Color) this.Minute.NightDay.Day.Color=subItem.Color;
68310
+ if (subItem.BGColor) this.Minute.NightDay.Day.BGColor=subItem.BGColor;
68311
+ if (subItem.BorderColor) this.Minute.NightDay.Day.BorderColor=subItem.BorderColor;
68312
+ CopyMarginConfig(this.Minute.NightDay.Day.Margin,subItem.Margin);
68313
+ }
68314
+ if (item.Night)
68315
+ {
68316
+ var subItem=item.Night;
68317
+ if (subItem.Color) this.Minute.NightDay.Night.Color=subItem.Color;
68318
+ if (subItem.BGColor) this.Minute.NightDay.Night.BGColor=subItem.BGColor;
68319
+ if (subItem.BorderColor) this.Minute.NightDay.Night.BorderColor=subItem.BorderColor;
68320
+ CopyMarginConfig(this.Minute.NightDay.Night.Margin,subItem.Margin);
68321
+ }
68322
+ }
68111
68323
  }
68112
68324
 
68113
68325
  if (style.DefaultTextColor) this.DefaultTextColor = style.DefaultTextColor;
@@ -68148,6 +68360,7 @@ function JSChartResource()
68148
68360
  }
68149
68361
 
68150
68362
  if (IFrameSplitOperator.IsNumber(item.ArrowType)) this.IndexTitle.ArrowType=item.ArrowType;
68363
+ if (IFrameSplitOperator.IsBool(item.EnableIndexArrow)) this.IndexTitle.EnableIndexArrow=item.EnableIndexArrow;
68151
68364
 
68152
68365
  if (item.NameArrow)
68153
68366
  {
@@ -69318,7 +69531,11 @@ function JSChartLocalization()
69318
69531
  ["Toolbar-"+JSCHART_BUTTON_ID.CHIP_LONG, {CN:"远期成本分布", EN:"Long chip", TC:"远期成本分布"}],
69319
69532
  ["Toolbar-"+JSCHART_BUTTON_ID.CHIP_DEFULT, {CN:"默认筹码分布", EN:"Default chip", TC:"默认筹码分布"}],
69320
69533
  ["Toolbar-"+JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE, {CN:"删除", EN:"Delete", TC:"删除"}],
69321
- ["Toolbar-"+JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING, {CN:"设置", EN:"Setting", TC:"设置"}]
69534
+ ["Toolbar-"+JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING, {CN:"设置", EN:"Setting", TC:"设置"}],
69535
+
69536
+ //日盘|夜盘
69537
+ ["日盘",{CN:'日盘', EN:'Day', TC:'日盤'}],
69538
+ ["夜盘",{CN:'夜盘', EN:'Night', TC:'夜盤'} ]
69322
69539
  ]);
69323
69540
 
69324
69541
  this.GetText=function(key,language)
@@ -70931,6 +71148,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
70931
71148
  this.ChartCorssCursor.StringFormatY.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
70932
71149
  this.ChartCorssCursor.StringFormatY.LanguageID=this.LanguageID;
70933
71150
  this.ChartCorssCursor.StringFormatY.ExtendChartPaint=this.ExtendChartPaint;
71151
+ this.ChartCorssCursor.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
70934
71152
 
70935
71153
  //创建等待提示
70936
71154
  this.ChartSplashPaint = new ChartSplashPaint();
@@ -77836,6 +78054,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
77836
78054
 
77837
78055
  this.ZoomStepPixel=50;
77838
78056
  this.BaselineType=0; //基准线类型 0=最新昨收盘 1=多日前昨收盘
78057
+ this.EnableNightDayBG=false; //是否启动夜盘背景色
77839
78058
 
77840
78059
  //集合竞价设置 obj={ Left:true/false, Right:true/false, MultiDay:{Left:, Right:} }
77841
78060
  this.SetCallCationDataBorder=function(obj)
@@ -79538,6 +79757,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
79538
79757
  this.ChartCorssCursor.StringFormatY.LanguageID=this.LanguageID;
79539
79758
  this.ChartCorssCursor.StringFormatY.ShareAfterVol=this.ShareAfterVol;
79540
79759
  this.ChartCorssCursor.CallAcutionXOperator=new CallAcutionXOperator();
79760
+ this.ChartCorssCursor.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
79541
79761
 
79542
79762
 
79543
79763
  //创建等待提示
@@ -79625,6 +79845,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
79625
79845
  frame.GlobalOption=this.GlobalOption;
79626
79846
  if (i<2) frame.ChartBorder.TitleHeight=0;
79627
79847
  frame.XPointCount=243;
79848
+ frame.HQChart=this;
79849
+ frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
79628
79850
 
79629
79851
  if (i>=2)
79630
79852
  {
@@ -79714,6 +79936,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
79714
79936
  frame.Identify=id; //窗口序号
79715
79937
  frame.XPointCount=243;
79716
79938
  frame.GlobalOption=this.GlobalOption;
79939
+ frame.HQChart=this;
79940
+ frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
79717
79941
 
79718
79942
 
79719
79943
  if (id>=2)
@@ -85147,6 +85371,7 @@ function KLineChartHScreenContainer(uielement)
85147
85371
  this.ChartCorssCursor.StringFormatY=g_DivTooltipDataForamt.Create("CorssCursor_YStringFormat");
85148
85372
  this.ChartCorssCursor.StringFormatY.LanguageID=this.LanguageID;
85149
85373
  this.ChartCorssCursor.StringFormatY.ExtendChartPaint=this.ExtendChartPaint;
85374
+ this.ChartCorssCursor.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
85150
85375
 
85151
85376
  //创建等待提示
85152
85377
  this.ChartSplashPaint = new ChartSplashPaint();
@@ -85292,6 +85517,7 @@ function MinuteChartHScreenContainer(uielement)
85292
85517
  this.ChartCorssCursor.StringFormatY=g_DivTooltipDataForamt.Create("CorssCursor_YStringFormat");
85293
85518
  this.ChartCorssCursor.StringFormatY.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
85294
85519
  this.ChartCorssCursor.CallAcutionXOperator=new CallAcutionXOperator();
85520
+ this.ChartCorssCursor.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
85295
85521
 
85296
85522
  //创建等待提示
85297
85523
  this.ChartSplashPaint = new ChartSplashPaint();
@@ -85345,6 +85571,8 @@ function MinuteChartHScreenContainer(uielement)
85345
85571
  frame.Identify=i;
85346
85572
  if (i<2) frame.ChartBorder.TitleHeight=0;
85347
85573
  frame.XPointCount=243;
85574
+ frame.HQChart=this;
85575
+ frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
85348
85576
 
85349
85577
  var DEFAULT_HORIZONTAL=[9,8,7,6,5,4,3,2,1];
85350
85578
  frame.HorizontalMax=DEFAULT_HORIZONTAL[0];
@@ -81,6 +81,13 @@ function GetBlackStyle()
81
81
  {
82
82
  BGColor:"rgba(105,105,105,0.5)",
83
83
  AvPriceColor:'rgb(248,248,255)' //均线
84
+ },
85
+ NightDay:
86
+ {
87
+ NightBGColor:"rgb(22,22,22)",
88
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
89
+ Day: { Color:"rgb(153,153,153)", BGColor:"rgb(51,51,51)", BorderColor:"rgb(51,51,51)", Margin:{ Left:5, Top:2, Bottom:2, Right:5 } },
90
+ Night: { Color:"rgb(153,153,153)", BGColor:"rgb(51,51,51)", BorderColor:"rgb(51,51,51)", Margin:{ Left:5, Top:2, Bottom:2, Right:5 } },
84
91
  }
85
92
  },
86
93