hqchart 1.1.13385 → 1.1.13389

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.
@@ -1612,8 +1612,8 @@ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOUSE_MOVE);var titleChart=t
1612
1612
  if(titleChart)titleChart.OnMouseMoveEvent=null;this.StartStopDisplayLatest();};this.IsMouseOnClient=function(x,y){var rect={Left:this.Frame.ChartBorder.GetLeft(),Top:this.Frame.ChartBorder.GetTop(),Width:this.Frame.ChartBorder.GetWidth(),Height:this.Frame.ChartBorder.GetHeight()};rect.Right=rect.Left+rect.Width;rect.Bottom=rect.Top+rect.Height;if(x>=rect.Left&&x<=rect.Right&&y>=rect.Top&&y<=rect.Bottom)return true;return false;};this.UIOnContextMenu=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;if(!this.IsShowRightMenu)return;var x=e.clientX-this.UIElement.getBoundingClientRect().left;var y=e.clientY-this.UIElement.getBoundingClientRect().top;if(typeof this.OnRightMenu=='function')this.OnRightMenu(x,y,e);//右键菜单事件
1613
1613
  return false;};this.UIOnDblClick=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash)return;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;this.OnDoubleClick(x,y,e);};//是否在拖拽Y轴上
1614
1614
  this.TryYDrag=function(x,y){if(!this.EnableYDrag)return null;if(!this.EnableYDrag.Left&&!this.EnableYDrag.Right)return null;if(!this.Frame||!this.Frame.PtInFrameY)return null;var dragY=this.Frame.PtInFrameY(x,y);if(!dragY||dragY.Index<0)return null;if(dragY.IsOverlay===true){if(!dragY.Right||!this.EnableYDrag.Right)return null;if(this.Frame.IsEnableOverlayDragY(dragY.Index,dragY.OverlayIndex))return dragY;return null;}if(dragY.Left&&this.EnableYDrag.Left&&this.Frame.IsEnableDragY(dragY.Index)){return dragY;}if(dragY.Right&&this.EnableYDrag.Right&&this.Frame.IsEnableDragY(dragY.Index)){return dragY;}return null;};//是否可以上下拖拽
1615
- this.TryUpDownDrag=function(x,y){var windowIndex=this.Frame.PtInFrame(x,y);if(windowIndex<0)return null;var item=this.Frame.SubFrame[windowIndex];if(!item||!item.Frame)return null;var frame=item.Frame;if(!frame.YSplitOperator||!frame.YSplitOperator.FixedYMaxMin)return null;return{Index:windowIndex,X:x,Y:y};};this.TryRectSelectDrag=function(x,y){var paint=this.GetRectSelectPaint();if(!paint)return null;if(paint.GetPointCount()<=0)return null;var item=paint.PtInPaint(x,y);return{Item:item,X:x,Y:y};};this.TryClickCrossCursor=function(x,y,e){if(!this.ChartCorssCursor)return;var button=this.ChartCorssCursor.PtInButton(x,y);if(!button)return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);if(event&&event.Callback){var sendData={Button:button,e:e};event.Callback(event,sendData,this);}return true;};this.TryClickButton=function(x,y,e){var button=this.Frame.PtInButtons(x,y);if(button&&this.ClickFrameButton){this.ClickFrameButton(button,e);return true;}button=this.PtInExtendChartButtons(x,y);if(button&&this.ClickExtendChartButton){this.ClickExtendChartButton(button,e);return true;}button=this.PtInDrawPictureButtons(x,y);if(button&&this.ClickDrawPictureButton){this.ClickDrawPictureButton(button,e);return true;}button=this.PtInTitleButtons(x,y);if(button&&this.ClickTitleButton){this.ClickTitleButton(button,e);return true;}return false;};this.TryMouseMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_MOVE);if(!event||!event.Callback)return false;return event.Callback(event,sendData,this);};this.TryClick_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_DOWN);if(!event||!event.Callback)return false;sendData.ChartDrag=null;sendData.Cusrsor=null;event.Callback(event,sendData,this);this.CustomChartDrag=sendData.ChartDrag;this.SetCursor(sendData);};this.TryDragMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_MOVE);if(!event||!event.Callback)return;var e=sendData.e;var drag=sendData.Drag;if(Math.abs(drag.LastMove.Y-e.clientY)<2&&Math.abs(drag.LastMove.X-e.clientX)<2)return;if(event.Callback(event,sendData,this)){drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}};this.TryMouseUp_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_UP);if(!event||!event.Callback)return;event.Callback(event,sendData,this);};this.UIOnMouseDown=function(e){var _this6=this;this.MoveOnChartDrawPicture=null;if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;this.ClickDownPoint={X:e.clientX,Y:e.clientY};this.IsOnTouch=true;this.BorderDrag=null;this.YDrag=null;this.UpDownDrag=null;this.RectSelectDrag=null;this.IndexChartDrag=null;this.CustomChartDrag=null;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;if(this.TryClickButton(x,y,e)){return;}var bDrawDynamicInfo=false;if(this.GlobalOption.SelectedBorder&&this.GlobalOption.SelectedBorder.Mode>=1){var item=this.GlobalOption.SelectedBorder;var frameId=this.Frame.PtInFrame(x,y);if(frameId>=0&&frameId!=item.SelFrame){item.SelFrame=frameId;bDrawDynamicInfo=true;}}var bRedraw=false;if(this.GlobalOption.SelectedXBorder&&this.GlobalOption.SelectedXBorder.Mode>=1){if(this.PtInMulitDayMinute){var item=this.GlobalOption.SelectedXBorder;var selectedDate=this.PtInMulitDayMinute(x,y);if(item.Date!=selectedDate){item.Date=selectedDate;bRedraw=true;}}}if(this.TryClickCrossCursor(x,y,e)){return;}if(this.TryClickChartTooltipData&&this.TryClickChartTooltipData(x,y,e))//预留给外部点击图标什么用的
1616
- {return;}if(this.TryClickLock){//JSConsole.Chart.Log('[uielement.onmousedown] left, top ',e.clientX, e.clientY, this.getBoundingClientRect().left,this.getBoundingClientRect().top);
1615
+ this.TryUpDownDrag=function(x,y){var windowIndex=this.Frame.PtInFrame(x,y);if(windowIndex<0)return null;var item=this.Frame.SubFrame[windowIndex];if(!item||!item.Frame)return null;var frame=item.Frame;if(!frame.YSplitOperator||!frame.YSplitOperator.FixedYMaxMin)return null;return{Index:windowIndex,X:x,Y:y};};this.TryRectSelectDrag=function(x,y){var paint=this.GetRectSelectPaint();if(!paint)return null;if(paint.GetPointCount()<=0)return null;var item=paint.PtInPaint(x,y);return{Item:item,X:x,Y:y};};this.TryClickCrossCursor=function(x,y,e){if(!this.ChartCorssCursor)return;var button=this.ChartCorssCursor.PtInButton(x,y);if(!button)return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);if(event&&event.Callback){var sendData={Button:button,e:e};event.Callback(event,sendData,this);}return true;};this.TryClickButton=function(x,y,e){var button=this.Frame.PtInButtons(x,y);if(button&&this.ClickFrameButton){this.ClickFrameButton(button,e);return true;}button=this.PtInExtendChartButtons(x,y);if(button&&this.ClickExtendChartButton){this.ClickExtendChartButton(button,e);return true;}button=this.PtInDrawPictureButtons(x,y);if(button&&this.ClickDrawPictureButton){this.ClickDrawPictureButton(button,e);return true;}button=this.PtInTitleButtons(x,y);if(button&&this.ClickTitleButton){this.ClickTitleButton(button,e);return true;}return false;};this.TryMouseMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_MOVE);if(!event||!event.Callback)return false;return event.Callback(event,sendData,this);};this.TryClick_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_DOWN);if(!event||!event.Callback)return false;sendData.ChartDrag=null;sendData.Cusrsor=null;event.Callback(event,sendData,this);this.CustomChartDrag=sendData.ChartDrag;this.SetCursor(sendData);};this.TryDragMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_MOVE);if(!event||!event.Callback)return;var e=sendData.e;var drag=sendData.Drag;if(Math.abs(drag.LastMove.Y-e.clientY)<2&&Math.abs(drag.LastMove.X-e.clientX)<2)return;if(event.Callback(event,sendData,this)){drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}};this.TryMouseUp_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_UP);if(!event||!event.Callback)return;event.Callback(event,sendData,this);};this.UIOnMouseDown=function(e){var _this6=this;this.MoveOnChartDrawPicture=null;if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;this.ClickDownPoint={X:e.clientX,Y:e.clientY};this.IsOnTouch=true;this.BorderDrag=null;this.YDrag=null;this.UpDownDrag=null;this.RectSelectDrag=null;this.IndexChartDrag=null;this.CustomChartDrag=null;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;if(this.TryClickButton(x,y,e)){this.IsOnTouch=false;return;}var bDrawDynamicInfo=false;if(this.GlobalOption.SelectedBorder&&this.GlobalOption.SelectedBorder.Mode>=1){var item=this.GlobalOption.SelectedBorder;var frameId=this.Frame.PtInFrame(x,y);if(frameId>=0&&frameId!=item.SelFrame){item.SelFrame=frameId;bDrawDynamicInfo=true;}}var bRedraw=false;if(this.GlobalOption.SelectedXBorder&&this.GlobalOption.SelectedXBorder.Mode>=1){if(this.PtInMulitDayMinute){var item=this.GlobalOption.SelectedXBorder;var selectedDate=this.PtInMulitDayMinute(x,y);if(item.Date!=selectedDate){item.Date=selectedDate;bRedraw=true;}}}if(this.TryClickCrossCursor(x,y,e)){this.IsOnTouch=false;return;}if(this.TryClickChartTooltipData&&this.TryClickChartTooltipData(x,y,e))//预留给外部点击图标什么用的
1616
+ {this.IsOnTouch=false;return;}if(this.TryClickLock){//JSConsole.Chart.Log('[uielement.onmousedown] left, top ',e.clientX, e.clientY, this.getBoundingClientRect().left,this.getBoundingClientRect().top);
1617
1617
  if(this.TryClickLock(x,y))return;}this.HideSelectRect();if(this.ChartPictureMenu)this.ChartPictureMenu.Hide();var paint=this.GetRectSelectPaint();if(paint&&paint.GetPointCount()>0){var item=paint.PtInPaint(x,y);if(item){if(item.Type==4){//this.UIElement.style.cursor="pointer";
1618
1618
  this.SetCursor({Cursor:"pointer"});var obj={X:e.clientX};if(this.GetXDataIndex(obj)){this.RectSelectDrag={DataIndex:obj.DataIndex,Type:item.Type,X:e.clientX};JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] drag sub rect select ",obj);}}else{//this.UIElement.style.cursor="ew-resize";
1619
1619
  this.SetCursor({Cursor:"ew-resize"});this.RectSelectDrag={Index:item.PointIndex,Type:item.Type};JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] drag rect select ",item);}}}if(!this.RectSelectDrag&&this.ClearRectSelect(false))this.Draw();if(this.EnableBorderDrag&&this.Frame){var dragBorder=this.Frame.PtInFrameBorder(x,y);if(dragBorder&&dragBorder.Index>=0){//this.UIElement.style.cursor="n-resize";
@@ -1882,7 +1882,8 @@ for(var i in this.ChartPaint)//框架内图形
1882
1882
  {if(!obj)obj={Format:'image/png',ColorGB:'rgb(255,255,255)'};var imageData=this.SaveToImage(obj.Format,obj.ColorGB);var postData={"Base64":imageData,"BucketName":"downloadcache","Path":"hqchart/hq_snapshot"};var url=g_JSChartResource.Domain+'/API/FileUploadForBase64';JSNetwork.HttpRequest({url:url,method:"POST",dataType:"json",data:postData,success:function success(data){JSConsole.Chart.Log('[JSChartContainer::SaveToImageUrl] recv data',data);var result={Path:data.relativeurl,Domain:'http://127.0.0.1:8087'};result.Url=result.Domain+'/'+result.Path;if(callback)callback(true,result,'');},error:function error(request){JSConsole.Chart.Log('[JSChartContainer::SaveToImageUrl] error ',request);if(callback)callback(false,null,'upload failed');}});};this.ExportDataToCSV=function(data){var strCSV="";var strRow="";var rowCount=0;//标题
1883
1883
  for(var i=0;i<data.length;++i){var item=data[i];strRow+='"'+item.Name+'"';if(i==data.length-1)strRow+="\r\n";else strRow+=",";if(IFrameSplitOperator.IsNonEmptyArray(item.Data))rowCount=Math.max(rowCount,item.Data.length);}strCSV+=strRow;for(var i=0,j=0;i<rowCount;++i){strRow="";for(j=0;j<data.length;++j){var item=data[j];var value=null;if(item.Data&&i<item.Data.length)value=item.Data[i];strRow+='"'+value+'"';if(j==data.length-1)strRow+="\r\n";else strRow+=",";}strCSV+=strRow;}strCSV='\uFEFF'+strCSV;return strCSV;};this.SetLanguage=function(language){var languageID=g_JSChartLocalization.GetLanguageID(language);if(!IFrameSplitOperator.IsNumber(languageID)){console.warn('[JSChartContainer::SetLanguage] language='+language+' error');return;}if(this.LanguageID==languageID)return;this.LanguageID=languageID;if(this.ChartCorssCursor&&this.ChartCorssCursor.StringFormatY)this.ChartCorssCursor.StringFormatY.LanguageID=this.LanguageID;for(var i=0;i<this.TitlePaint.length;++i)//标题
1884
1884
  {var item=this.TitlePaint[i];if(item)item.LanguageID=this.LanguageID;}for(var i=0;i<this.ExtendChartPaint.length;++i)//tooltip 等扩展图形
1885
- {var item=this.ExtendChartPaint[i];if(item)item.LanguageID=this.LanguageID;}if(this.Frame&&this.Frame.SetLanguage)this.Frame.SetLanguage(this.LanguageID);this.Frame.SetSizeChage(true);this.Draw();};this.ReloadTiltePaintResource=function(resource)//重新加载配置
1885
+ {var item=this.ExtendChartPaint[i];if(item)item.LanguageID=this.LanguageID;}if(this.Frame&&this.Frame.SetLanguage)this.Frame.SetLanguage(this.LanguageID);//this.Frame.ClearYCoordinateMaxMin();
1886
+ this.ResetFrameXYSplit();this.Frame.SetSizeChage(true);this.Draw();};this.ReloadTiltePaintResource=function(resource)//重新加载配置
1886
1887
  {for(var i in this.TitlePaint){var item=this.TitlePaint[i];if(item.ReloadResource)item.ReloadResource(resource);}};this.ReloadExtendChartPaintResource=function(resource)//扩展画法重新加载配置
1887
1888
  {for(var i in this.ExtendChartPaint){var item=this.ExtendChartPaint[i];if(item.ReloadResource)item.ReloadResource(resource);}};this.ReloadChartDrawPictureResource=function(resource){if(!IFrameSplitOperator.IsNonEmptyArray(this.ChartDrawPicture))return;for(var i=0;i<this.ChartDrawPicture.length;++i){var item=this.ChartDrawPicture[i];if(item.ReloadResource)item.ReloadResource(resource);}};this.ReloadResource=function(option){this.ReloadBorder(option);this.ReloadTiltePaintResource(option.Resource);this.ReloadChartPaint(option.Resource);this.ReloadFrame(option.Resource);this.ReloadExtendChartPaintResource(option.Resource);this.ReloadChartCorssCursor(option,option.Resource);this.ReloadChartDrawPictureResource(option.Resource);if(option.Update&&this.Update)this.Update({UpdateCursorIndexType:2});//是否立即更新并重绘
1888
1889
  else if(option.Draw==true)this.Draw();//是否立即重绘
@@ -3208,6 +3209,7 @@ this.DrawType=0;// 0=实心K线柱子 1=收盘价线 2=美国线 3=空心K线
3208
3209
  // 15=HLC Area
3209
3210
  // 16=kagi
3210
3211
  // 17=订单流样式4
3212
+ // 18=订单流样式5
3211
3213
  this.CloseLineColor=g_JSChartResource.CloseLineColor;this.CloseLineAreaColor=g_JSChartResource.CloseLineAreaColor;this.CloseLineWidth=g_JSChartResource.CloseLineWidth;this.UpColor=g_JSChartResource.UpBarColor;this.DownColor=g_JSChartResource.DownBarColor;this.UnchagneColor=g_JSChartResource.UnchagneBarColor;//平盘
3212
3214
  this.ColorData;//五彩K线颜色 >0:g_JSChartResource.UpBarColor 其他:g_JSChartResource.DownBarColor
3213
3215
  this.TradeData;//交易系统 包含买卖数据{Buy:, Sell:, Name:指标名称 }
@@ -3357,199 +3359,7 @@ if(isHScreen){var pathBar=new Path2D();pathBar.rect(ToFixedRect(yBarBottom),ToFi
3357
3359
  */};//十字线
3358
3360
  this.DrawColorKBar_Line=function(data,colorData,dataWidth,x,y,left,right,yLow,yHigh,yOpen,yClose,isHScreen){if(dataWidth>=4){if(colorData.Line){this.Canvas.strokeStyle=colorData.Line.Color;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(yHigh),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(yHigh));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));}this.Canvas.stroke();}var barColor;if(colorData.Type==0)//空心柱子
3359
3361
  {if(colorData.Border)barColor=colorData.Border.Color;else if(colorData.BarColor)barColor=colorData.BarColor;}else if(colorData.Type==1)//实心
3360
- {if(colorData.Border)barColor=colorData.Border.Color;else if(colorData.BarColor)barColor=colorData.BarColor;}if(barColor){this.Canvas.strokeStyle=barColor;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(yOpen),ToFixedPoint(left));this.Canvas.lineTo(ToFixedPoint(yOpen),ToFixedPoint(right));}else{this.Canvas.moveTo(ToFixedPoint(left),ToFixedPoint(yOpen));this.Canvas.lineTo(ToFixedPoint(right),ToFixedPoint(yOpen));}this.Canvas.stroke();}}else{if(colorData.Line){var xFixed=left+dataWidth/2;this.Canvas.strokeStyle=colorData.Line.Color;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(yHigh),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(yHigh));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));}this.Canvas.stroke();}}};/*
3361
- this.DrawKBarV2=function(data, colorData, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
3362
- {
3363
- var isDrawBorder=false;
3364
- var isEmptyBar=false;
3365
- if (colorData.border) isDrawBorder=true;
3366
- if (colorData.Type===0) isEmptyBar=true;
3367
-
3368
- if (dataWidth>=4)
3369
- {
3370
- if (isDrawBorder)
3371
- {
3372
- if ((dataWidth%2)!=0) dataWidth-=1;
3373
- }
3374
-
3375
- if (data.High>data.Close) //上影线
3376
- {
3377
- if (colorData.Line)
3378
- {
3379
- this.Canvas.strokeStyle=colorData.Line.Color;
3380
- this.Canvas.beginPath();
3381
- if (isHScreen)
3382
- {
3383
- this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
3384
- this.Canvas.lineTo(ToFixedPoint(Math.max(yClose,yOpen)),ToFixedPoint(x));
3385
- }
3386
- else
3387
- {
3388
- if (isDrawBorder)
3389
- {
3390
- var xFixed=left+dataWidth/2;
3391
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(y));
3392
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(Math.min(yClose,yOpen)));
3393
- }
3394
- else
3395
- {
3396
- this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));
3397
- this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(Math.min(yClose,yOpen)));
3398
- }
3399
- }
3400
- this.Canvas.stroke();
3401
- }
3402
-
3403
- y=yClose;
3404
- }
3405
- else
3406
- {
3407
- y=yClose;
3408
- }
3409
-
3410
- if (isHScreen)
3411
- {
3412
- //实心
3413
- if (!isEmptyBar && colorData.BarColor)
3414
- {
3415
- this.Canvas.fillStyle=colorData.BarColor;
3416
- if (Math.abs(yOpen-y)<1)
3417
- {
3418
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
3419
- }
3420
- else
3421
- {
3422
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
3423
- }
3424
- }
3425
-
3426
- if (colorData.Border) //空心
3427
- {
3428
- if (Math.abs(yOpen-y)<1)
3429
- {
3430
- this.Canvas.fillStyle=colorData.Border.Color;
3431
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
3432
- }
3433
- else
3434
- {
3435
- this.Canvas.strokeStyle=colorData.Border.Color;
3436
- this.Canvas.beginPath();
3437
- this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
3438
- this.Canvas.stroke();
3439
- }
3440
- }
3441
- }
3442
- else
3443
- {
3444
-
3445
- //实心
3446
- if (!isEmptyBar && colorData.BarColor)
3447
- {
3448
- this.Canvas.fillStyle=colorData.BarColor;
3449
- if (Math.abs(yOpen-y)<1)
3450
- {
3451
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1); //高度小于1,统一使用高度1
3452
- }
3453
- else
3454
- {
3455
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(Math.min(y,yOpen)),ToFixedRect(dataWidth),ToFixedRect(Math.abs(yOpen-y)));
3456
- }
3457
- }
3458
-
3459
- if (colorData.Border) //空心
3460
- {
3461
- if (Math.abs(yOpen-y)<1)
3462
- {
3463
- this.Canvas.fillStyle=colorData.Border.Color;
3464
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1); //高度小于1,统一使用高度1
3465
- }
3466
- else
3467
- {
3468
- this.Canvas.strokeStyle=colorData.Border.Color;
3469
- this.Canvas.beginPath();
3470
- this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),ToFixedRect(yOpen-y));
3471
- this.Canvas.stroke();
3472
- }
3473
- }
3474
- }
3475
-
3476
- if (data.Open>data.Low) //下影线
3477
- {
3478
- if (colorData.Line)
3479
- {
3480
- this.Canvas.strokeStyle=colorData.Line.Color;
3481
- this.Canvas.beginPath();
3482
- if (isHScreen)
3483
- {
3484
- this.Canvas.moveTo(ToFixedPoint(Math.min(yClose,yOpen)),ToFixedPoint(x));
3485
- this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
3486
- }
3487
- else
3488
- {
3489
- if (isDrawBorder)
3490
- {
3491
- var xFixed=left+dataWidth/2;
3492
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));
3493
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));
3494
- }
3495
- else
3496
- {
3497
- this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(Math.max(yClose,yOpen)));
3498
- this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));
3499
- }
3500
- }
3501
- this.Canvas.stroke();
3502
- }
3503
- }
3504
- }
3505
- else
3506
- {
3507
- var lineColor;
3508
- if (isEmptyBar && colorData.Border)
3509
- {
3510
- lineColor=colorData.Border.Color;
3511
- }
3512
- else if (!isEmptyBar && colorData.BarColor)
3513
- {
3514
- lineColor=colorData.BarColor;
3515
- }
3516
-
3517
- if (lineColor)
3518
- {
3519
- this.Canvas.strokeStyle=lineColor;
3520
- this.Canvas.beginPath();
3521
- if (isHScreen)
3522
- {
3523
- if (data.High==data.Low)
3524
- {
3525
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
3526
- this.Canvas.lineTo(yLow-1,ToFixedPoint(x));
3527
- }
3528
- else
3529
- {
3530
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
3531
- this.Canvas.lineTo(yLow,ToFixedPoint(x));
3532
- }
3533
- }
3534
- else
3535
- {
3536
- if (data.High==data.Low)
3537
- {
3538
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
3539
- this.Canvas.lineTo(ToFixedPoint(x),yLow+1);
3540
- }
3541
- else
3542
- {
3543
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
3544
- this.Canvas.lineTo(ToFixedPoint(x),yLow);
3545
- }
3546
-
3547
- }
3548
- this.Canvas.stroke();
3549
- }
3550
- }
3551
- }
3552
- */this.DrawVirtualBar=function(data,dataWidth,x,y,left,right,yLow,yHigh,yOpen,yClose,isHScreen){var yTop=Math.min(yHigh,yLow),yBottom=Math.max(yHigh,yLow);this.Canvas.strokeStyle=this.VirtualBarConfig.Color;this.Canvas.setLineDash(this.VirtualBarConfig.LineDash);if(isHScreen){if(dataWidth>=4){this.Canvas.strokeRect(ToFixedPoint(yTop),ToFixedPoint(left),ToFixedRect(yBottom-yTop),ToFixedRect(dataWidth));}else{this.Canvas.beginPath();this.Canvas.moveTo(yTop,ToFixedPoint(x));this.Canvas.lineTo(yBottom,ToFixedPoint(x));this.Canvas.stroke();}}else{if(dataWidth>=4){//this.Canvas.beginPath();
3362
+ {if(colorData.Border)barColor=colorData.Border.Color;else if(colorData.BarColor)barColor=colorData.BarColor;}if(barColor){this.Canvas.strokeStyle=barColor;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(yOpen),ToFixedPoint(left));this.Canvas.lineTo(ToFixedPoint(yOpen),ToFixedPoint(right));}else{this.Canvas.moveTo(ToFixedPoint(left),ToFixedPoint(yOpen));this.Canvas.lineTo(ToFixedPoint(right),ToFixedPoint(yOpen));}this.Canvas.stroke();}}else{if(colorData.Line){var xFixed=left+dataWidth/2;this.Canvas.strokeStyle=colorData.Line.Color;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(yHigh),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(yHigh));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));}this.Canvas.stroke();}}};this.DrawVirtualBar=function(data,dataWidth,x,y,left,right,yLow,yHigh,yOpen,yClose,isHScreen){var yTop=Math.min(yHigh,yLow),yBottom=Math.max(yHigh,yLow);this.Canvas.strokeStyle=this.VirtualBarConfig.Color;this.Canvas.setLineDash(this.VirtualBarConfig.LineDash);if(isHScreen){if(dataWidth>=4){this.Canvas.strokeRect(ToFixedPoint(yTop),ToFixedPoint(left),ToFixedRect(yBottom-yTop),ToFixedRect(dataWidth));}else{this.Canvas.beginPath();this.Canvas.moveTo(yTop,ToFixedPoint(x));this.Canvas.lineTo(yBottom,ToFixedPoint(x));this.Canvas.stroke();}}else{if(dataWidth>=4){//this.Canvas.beginPath();
3553
3363
  this.Canvas.strokeRect(ToFixedPoint(left),ToFixedPoint(yTop),ToFixedRect(dataWidth),ToFixedRect(yBottom-yTop));//this.Canvas.stroke();
3554
3364
  }else{this.Canvas.beginPath();this.Canvas.moveTo(ToFixedPoint(x),yTop);this.Canvas.lineTo(ToFixedPoint(x),yBottom);this.Canvas.stroke();}}this.Canvas.setLineDash([]);};this.DrawRenkoCandle=function()//砖型K线
3555
3365
  {var isHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;if(isHScreen){var border=this.ChartBorder.GetHScreenBorder();var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.BottomEx;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;}var ptMax={X:null,Y:null,Value:null,Align:'left'};var ptMin={X:null,Y:null,Value:null,Align:'left'};this.ShowRange.Start=this.Data.DataOffset;this.ShowRange.End=this.ShowRange.Start;this.ShowRange.DataCount=0;this.ShowRange.ShowCount=xPointCount;this.DrawKRange.Start=this.Data.DataOffset;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth,++this.ShowRange.DataCount){var data=this.Data.Data[i];this.ShowRange.End=i;if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;var yLow=this.GetYFromData(data.Low,false);var yHigh=this.GetYFromData(data.High,false);this.DrawKRange.End=i;if(ptMax.Value==null||ptMax.Value<data.High)//求最大值
@@ -3607,7 +3417,7 @@ this.Canvas.clip();};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMin
3607
3417
  this.PtMin={X:null,Y:null,Value:null,Align:'left'};//清空最小
3608
3418
  this.DrawKRange={Start:null,End:null};this.AryPriceGapCache=[];this.ChartFrame.ChartKLine={Max:null,Min:null};//保存K线上 显示最大最小值坐标
3609
3419
  this.DrawHeatMap();if(!this.IsShow)return;if(this.ChartFrame.IsMinSize&&this.Name=="Self Kline")return;if(ChartData.IsTickPeriod(this.Period))//分笔图
3610
- {this.Canvas.save();if(this.DrawType==1){this.ClipClient(this.ChartFrame.IsHScreen);this.DrawCloseLine();}else if(this.DrawType==4){this.ClipClient(this.ChartFrame.IsHScreen);this.DrawCloseArea();}else{this.ClipTickClient(this.ChartFrame.IsHScreen);this.DrawTick();}this.Canvas.restore();return;}this.Canvas.save();this.ClipClient(this.ChartFrame.IsHScreen);if(this.DrawType==1){this.DrawCloseLine();this.Canvas.restore();if(this.PriceGap.Enable)this.DrawPriceGap();return;}else if(this.DrawType==2){this.DrawAKLine();}else if(this.DrawType==4){this.DrawCloseArea();}else if(this.DrawType==5){this.DrawOrderFlow();}else if(this.DrawType==7){this.DrawOrderFlow_Style2();}else if(this.DrawType==8){this.DrawOrderFlow_Style3();}else if(this.DrawType==9){this.DrawKBar();}else if(this.DrawType==10){this.DrawRenkoCandle();}else if(this.DrawType==12){this.DrawLineBreak();}else if(this.DrawType==13){this.DrawHighLow();}else if(this.DrawType==14){if(this.FFKChart&&this.FFKChart.Draw){this.FFKChart.Draw(this);}}else if(this.DrawType==15){this.DrawHLCArea();}else if(this.DrawType==16){this.DrawKagi();}else if(this.DrawType==17){this.DrawOrderFlow_Style4();}else{this.DrawKBar();}if(this.TradeIcon)this.DrawTradeIcon();else this.DrawTrade();this.Canvas.restore();if(this.PriceGap.Enable)this.DrawPriceGap();if(this.IsShowMaxMinPrice)//标注最大值最小值
3420
+ {this.Canvas.save();if(this.DrawType==1){this.ClipClient(this.ChartFrame.IsHScreen);this.DrawCloseLine();}else if(this.DrawType==4){this.ClipClient(this.ChartFrame.IsHScreen);this.DrawCloseArea();}else{this.ClipTickClient(this.ChartFrame.IsHScreen);this.DrawTick();}this.Canvas.restore();return;}this.Canvas.save();this.ClipClient(this.ChartFrame.IsHScreen);if(this.DrawType==1){this.DrawCloseLine();this.Canvas.restore();if(this.PriceGap.Enable)this.DrawPriceGap();return;}else if(this.DrawType==2){this.DrawAKLine();}else if(this.DrawType==4){this.DrawCloseArea();}else if(this.DrawType==5){this.DrawOrderFlow();}else if(this.DrawType==7){this.DrawOrderFlow_Style2();}else if(this.DrawType==8){this.DrawOrderFlow_Style3();}else if(this.DrawType==9){this.DrawKBar();}else if(this.DrawType==10){this.DrawRenkoCandle();}else if(this.DrawType==12){this.DrawLineBreak();}else if(this.DrawType==13){this.DrawHighLow();}else if(this.DrawType==14){if(this.FFKChart&&this.FFKChart.Draw){this.FFKChart.Draw(this);}}else if(this.DrawType==15){this.DrawHLCArea();}else if(this.DrawType==16){this.DrawKagi();}else if(this.DrawType==17){this.DrawOrderFlow_Style4();}else if(this.DrawType==18){this.DrawOrderFlow_Style5();}else{this.DrawKBar();}if(this.TradeIcon)this.DrawTradeIcon();else this.DrawTrade();this.Canvas.restore();if(this.PriceGap.Enable)this.DrawPriceGap();if(this.IsShowMaxMinPrice)//标注最大值最小值
3611
3421
  {if(this.ChartFrame.IsHScreen===true)this.HScreenDrawMaxMinPrice(this.PtMax,this.PtMin);else this.DrawMaxMinPrice(this.PtMax,this.PtMin);}if(this.DrawType==14)//自定义图形 标注最大最小值
3612
3422
  {if(this.FFKChart&&this.FFKChart.DrawMaxMinPrice){this.FFKChart.DrawMaxMinPrice();}}};this.DrawMaxMinPrice=function(ptMax,ptMin){if(ptMax.X==null||ptMax.Y==null||ptMax.Value==null)return;if(ptMin.X==null||ptMin.Y==null||ptMin.Value==null)return;var leftArrow=g_JSChartResource.KLine.MaxMin.LeftArrow;var rightArrow=g_JSChartResource.KLine.MaxMin.RightArrow;var highYOffset=g_JSChartResource.KLine.MaxMin.HighYOffset;var lowYOffset=g_JSChartResource.KLine.MaxMin.LowYOffset;var defaultfloatPrecision=GetfloatPrecision(this.Symbol);this.Canvas.font=this.TextFont;this.Canvas.fillStyle=this.TextColor;var top=this.ChartBorder.GetTopEx();var bottom=this.ChartBorder.GetBottomEx();var ptTop=ptMax;if(this.ChartFrame.CoordinateType==1)//反转坐标
3613
3423
  {if(ptMax.Y<ptMin.Y)ptTop=ptMin;this.Canvas.textBaseline='top';}else{if(ptMax.Y>ptMin.Y)ptTop=ptMin;this.Canvas.textBaseline='bottom';}this.Canvas.textAlign=ptTop.Align;var left=ptTop.Align=='left'?ptTop.X:ptTop.X;if(IFrameSplitOperator.IsNumber(highYOffset))ptTop.Y+=highYOffset;var text=ptTop.Value.toFixed(defaultfloatPrecision);if(ptTop.Align=='left')text=leftArrow+text;else text=text+rightArrow;if(ptTop.Y>top-2){this.Canvas.fillText(text,left,ptTop.Y);this.ChartFrame.ChartKLine.Max={X:left,Y:ptTop.Y,Text:{BaseLine:'bottom'}};}var ptBottom=ptMin;if(this.ChartFrame.CoordinateType==1){if(ptMin.Y>ptMax.Y)ptBottom=ptMax;this.Canvas.textBaseline='bottom';}else{if(ptMax.Y>ptMin.Y)ptTop=ptMin;this.Canvas.textBaseline='top';}this.Canvas.textAlign=ptBottom.Align;var left=ptBottom.Align=='left'?ptBottom.X:ptBottom.X;if(IFrameSplitOperator.IsNumber(lowYOffset))ptBottom.Y+=lowYOffset;var text=ptMin.Value.toFixed(defaultfloatPrecision);if(ptBottom.Align=='left')text=leftArrow+text;else text=text+rightArrow;if(ptBottom.Y<bottom+1){this.Canvas.fillText(text,left,ptBottom.Y);this.ChartFrame.ChartKLine.Min={X:left,Y:ptBottom.Y,Text:{BaseLine:'top'}};}};this.HScreenDrawMaxMinPrice=function(ptMax,ptMin)//横屏模式下显示最大最小值
@@ -3701,7 +3511,9 @@ var max=orderFlow.Summary.VolMaxMin.Max,min=orderFlow.Summary.VolMaxMin.Min;for(
3701
3511
  {this.Canvas.fillStyle=item.Vol.Color;if(item.Vol.Font){var itemFont=this.GetDynamicOrderFlowFont(cellHeight,barWidth/2,item.Vol.Font);this.Canvas.font=itemFont;this.Canvas.fillText(text,xKLine.Center+textXOffset,yPrice);this.Canvas.font=textFont;}else{this.Canvas.fillText(item.Vol.Text,rtDraw.Left+2,yPrice);}}preItem={Price:item.Price,Rect:rtDraw};}else if(IFrameSplitOperator.IsNumber(item.Vol.Value)){var barWidth=xKLine.Right-xKLine.Left;var volWidth=barWidth*(item.Vol.Value-min)/(max-min);var rect={Left:xKLine.Left,Right:xKLine.Right,Bottom:yPrice+cellHeight/2,Top:yPrice-cellHeight/2};rect.Right=rect.Left+volWidth;if(preItem&&item.Price>preItem.Price){rect.Bottom=preItem.Rect.Top-volBarSpace;}rect.Width=rect.Right-rect.Left;rect.Height=rect.Bottom-rect.Top;var rtDraw={Left:ToFixedRect(rect.Left),Top:ToFixedRect(rect.Top),Width:ToFixedRect(rect.Width),Height:ToFixedRect(rect.Height)};rtDraw.Bottom=rtDraw.Top+rtDraw.Height;rtDraw.Right=rtDraw.Left+rtDraw.Width;if(rtDraw.Width<1)rtDraw.Width=1;if(item.Vol.BG)//背景色
3702
3512
  {this.Canvas.fillStyle=item.Vol.BG;this.Canvas.fillRect(rtDraw.Left,rtDraw.Top,rtDraw.Width,rtDraw.Height);}if(item.Vol.BorderColor)//边框
3703
3513
  {this.Canvas.strokeStyle=item.Vol.BorderColor;this.Canvas.strokeRect(ToFixedPoint(rtDraw.Left),ToFixedPoint(rtDraw.Top),rtDraw.Width,rtDraw.Height);}if(item.Vol.Text&&this.IsShowOrderText)//文字
3704
- {this.Canvas.fillStyle=item.Vol.Color;if(item.Vol.Font){var itemFont=this.GetDynamicOrderFlowFont(cellHeight,barWidth/2,item.Vol.Font);this.Canvas.font=itemFont;this.Canvas.fillText(text,xKLine.Center+textXOffset,yPrice);this.Canvas.font=textFont;}else{this.Canvas.fillText(item.Vol.Text,rtDraw.Left+2,yPrice);}}preItem={Price:item.Price,Rect:rtDraw};}else{continue;}}}};//////////////////////////////////////////////////////////////
3514
+ {this.Canvas.fillStyle=item.Vol.Color;if(item.Vol.Font){var itemFont=this.GetDynamicOrderFlowFont(cellHeight,barWidth/2,item.Vol.Font);this.Canvas.font=itemFont;this.Canvas.fillText(text,xKLine.Center+textXOffset,yPrice);this.Canvas.font=textFont;}else{this.Canvas.fillText(item.Vol.Text,rtDraw.Left+2,yPrice);}}preItem={Price:item.Price,Rect:rtDraw};}else{continue;}}}};////////////////////////////////////////////////////////////////////////////////
3515
+ //订单流样式5
3516
+ this.DrawOrderFlow_Style5=function(){};//////////////////////////////////////////////////////////////
3705
3517
  // high low bar
3706
3518
  //
3707
3519
  ///////////////////////////////////////////////////////////////
@@ -13330,7 +13142,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13330
13142
  this.ExecuteScript(item,data);}this.Status=0;}};this.OnExecuteFinish=function(data,indexInfo,jsExectute,jobInfo){var message={Data:data,IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.FINISH_EXECUTE_SCRIPT,JobInfo:jobInfo};postMessage(message);};this.OnExecuteError=function(error,indexInfo,jobData){var message={IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.ERROR_EXECUTE_SCRIPT,Error:error};postMessage(message);};}/********************************************************************************
13331
13143
  * 版本信息输出
13332
13144
  *
13333
- */var HQCHART_VERSION="1.1.13384";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13145
+ */var HQCHART_VERSION="1.1.13388";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13334
13146
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13335
13147
  // BaseIndex:BaseIndex,
13336
13148
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13385",
3
+ "version": "1.1.13389",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -3371,6 +3371,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3371
3371
 
3372
3372
  if (this.TryClickButton(x,y,e))
3373
3373
  {
3374
+ this.IsOnTouch=false;
3374
3375
  return;
3375
3376
  }
3376
3377
 
@@ -3403,11 +3404,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3403
3404
 
3404
3405
  if (this.TryClickCrossCursor(x,y, e))
3405
3406
  {
3407
+ this.IsOnTouch=false;
3406
3408
  return;
3407
3409
  }
3408
3410
 
3409
3411
  if (this.TryClickChartTooltipData && this.TryClickChartTooltipData(x,y,e)) //预留给外部点击图标什么用的
3410
3412
  {
3413
+ this.IsOnTouch=false;
3411
3414
  return;
3412
3415
  }
3413
3416
 
@@ -7794,6 +7797,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7794
7797
 
7795
7798
  if (this.Frame && this.Frame.SetLanguage) this.Frame.SetLanguage(this.LanguageID);
7796
7799
 
7800
+ //this.Frame.ClearYCoordinateMaxMin();
7801
+ this.ResetFrameXYSplit();
7797
7802
  this.Frame.SetSizeChage(true);
7798
7803
  this.Draw();
7799
7804
  }
@@ -23479,6 +23484,7 @@ function ChartKLine()
23479
23484
  // 15=HLC Area
23480
23485
  // 16=kagi
23481
23486
  // 17=订单流样式4
23487
+ // 18=订单流样式5
23482
23488
 
23483
23489
  this.CloseLineColor=g_JSChartResource.CloseLineColor;
23484
23490
  this.CloseLineAreaColor=g_JSChartResource.CloseLineAreaColor;
@@ -25141,200 +25147,7 @@ function ChartKLine()
25141
25147
  }
25142
25148
  }
25143
25149
 
25144
- /*
25145
- this.DrawKBarV2=function(data, colorData, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
25146
- {
25147
- var isDrawBorder=false;
25148
- var isEmptyBar=false;
25149
- if (colorData.border) isDrawBorder=true;
25150
- if (colorData.Type===0) isEmptyBar=true;
25151
-
25152
- if (dataWidth>=4)
25153
- {
25154
- if (isDrawBorder)
25155
- {
25156
- if ((dataWidth%2)!=0) dataWidth-=1;
25157
- }
25158
-
25159
- if (data.High>data.Close) //上影线
25160
- {
25161
- if (colorData.Line)
25162
- {
25163
- this.Canvas.strokeStyle=colorData.Line.Color;
25164
- this.Canvas.beginPath();
25165
- if (isHScreen)
25166
- {
25167
- this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
25168
- this.Canvas.lineTo(ToFixedPoint(Math.max(yClose,yOpen)),ToFixedPoint(x));
25169
- }
25170
- else
25171
- {
25172
- if (isDrawBorder)
25173
- {
25174
- var xFixed=left+dataWidth/2;
25175
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(y));
25176
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(Math.min(yClose,yOpen)));
25177
- }
25178
- else
25179
- {
25180
- this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));
25181
- this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(Math.min(yClose,yOpen)));
25182
- }
25183
- }
25184
- this.Canvas.stroke();
25185
- }
25186
-
25187
- y=yClose;
25188
- }
25189
- else
25190
- {
25191
- y=yClose;
25192
- }
25193
-
25194
- if (isHScreen)
25195
- {
25196
- //实心
25197
- if (!isEmptyBar && colorData.BarColor)
25198
- {
25199
- this.Canvas.fillStyle=colorData.BarColor;
25200
- if (Math.abs(yOpen-y)<1)
25201
- {
25202
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
25203
- }
25204
- else
25205
- {
25206
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
25207
- }
25208
- }
25209
-
25210
- if (colorData.Border) //空心
25211
- {
25212
- if (Math.abs(yOpen-y)<1)
25213
- {
25214
- this.Canvas.fillStyle=colorData.Border.Color;
25215
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
25216
- }
25217
- else
25218
- {
25219
- this.Canvas.strokeStyle=colorData.Border.Color;
25220
- this.Canvas.beginPath();
25221
- this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
25222
- this.Canvas.stroke();
25223
- }
25224
- }
25225
- }
25226
- else
25227
- {
25228
-
25229
- //实心
25230
- if (!isEmptyBar && colorData.BarColor)
25231
- {
25232
- this.Canvas.fillStyle=colorData.BarColor;
25233
- if (Math.abs(yOpen-y)<1)
25234
- {
25235
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1); //高度小于1,统一使用高度1
25236
- }
25237
- else
25238
- {
25239
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(Math.min(y,yOpen)),ToFixedRect(dataWidth),ToFixedRect(Math.abs(yOpen-y)));
25240
- }
25241
- }
25242
-
25243
- if (colorData.Border) //空心
25244
- {
25245
- if (Math.abs(yOpen-y)<1)
25246
- {
25247
- this.Canvas.fillStyle=colorData.Border.Color;
25248
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1); //高度小于1,统一使用高度1
25249
- }
25250
- else
25251
- {
25252
- this.Canvas.strokeStyle=colorData.Border.Color;
25253
- this.Canvas.beginPath();
25254
- this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),ToFixedRect(yOpen-y));
25255
- this.Canvas.stroke();
25256
- }
25257
- }
25258
- }
25259
-
25260
- if (data.Open>data.Low) //下影线
25261
- {
25262
- if (colorData.Line)
25263
- {
25264
- this.Canvas.strokeStyle=colorData.Line.Color;
25265
- this.Canvas.beginPath();
25266
- if (isHScreen)
25267
- {
25268
- this.Canvas.moveTo(ToFixedPoint(Math.min(yClose,yOpen)),ToFixedPoint(x));
25269
- this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
25270
- }
25271
- else
25272
- {
25273
- if (isDrawBorder)
25274
- {
25275
- var xFixed=left+dataWidth/2;
25276
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));
25277
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));
25278
- }
25279
- else
25280
- {
25281
- this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(Math.max(yClose,yOpen)));
25282
- this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));
25283
- }
25284
- }
25285
- this.Canvas.stroke();
25286
- }
25287
- }
25288
- }
25289
- else
25290
- {
25291
- var lineColor;
25292
- if (isEmptyBar && colorData.Border)
25293
- {
25294
- lineColor=colorData.Border.Color;
25295
- }
25296
- else if (!isEmptyBar && colorData.BarColor)
25297
- {
25298
- lineColor=colorData.BarColor;
25299
- }
25300
-
25301
- if (lineColor)
25302
- {
25303
- this.Canvas.strokeStyle=lineColor;
25304
- this.Canvas.beginPath();
25305
- if (isHScreen)
25306
- {
25307
- if (data.High==data.Low)
25308
- {
25309
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
25310
- this.Canvas.lineTo(yLow-1,ToFixedPoint(x));
25311
- }
25312
- else
25313
- {
25314
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
25315
- this.Canvas.lineTo(yLow,ToFixedPoint(x));
25316
- }
25317
- }
25318
- else
25319
- {
25320
- if (data.High==data.Low)
25321
- {
25322
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
25323
- this.Canvas.lineTo(ToFixedPoint(x),yLow+1);
25324
- }
25325
- else
25326
- {
25327
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
25328
- this.Canvas.lineTo(ToFixedPoint(x),yLow);
25329
- }
25330
-
25331
- }
25332
- this.Canvas.stroke();
25333
- }
25334
- }
25335
- }
25336
- */
25337
-
25150
+
25338
25151
  this.DrawVirtualBar=function(data, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
25339
25152
  {
25340
25153
  var yTop=Math.min(yHigh,yLow), yBottom=Math.max(yHigh,yLow);
@@ -26290,6 +26103,10 @@ function ChartKLine()
26290
26103
  {
26291
26104
  this.DrawOrderFlow_Style4();
26292
26105
  }
26106
+ else if (this.DrawType==18)
26107
+ {
26108
+ this.DrawOrderFlow_Style5();
26109
+ }
26293
26110
  else
26294
26111
  {
26295
26112
  this.DrawKBar();
@@ -27969,6 +27786,13 @@ function ChartKLine()
27969
27786
  }
27970
27787
  }
27971
27788
 
27789
+ ////////////////////////////////////////////////////////////////////////////////
27790
+ //订单流样式5
27791
+ this.DrawOrderFlow_Style5=function()
27792
+ {
27793
+
27794
+ }
27795
+
27972
27796
  //////////////////////////////////////////////////////////////
27973
27797
  // high low bar
27974
27798
  //
@@ -7263,6 +7263,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7263
7263
 
7264
7264
  if (this.TryClickButton(x,y,e))
7265
7265
  {
7266
+ this.IsOnTouch=false;
7266
7267
  return;
7267
7268
  }
7268
7269
 
@@ -7295,11 +7296,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7295
7296
 
7296
7297
  if (this.TryClickCrossCursor(x,y, e))
7297
7298
  {
7299
+ this.IsOnTouch=false;
7298
7300
  return;
7299
7301
  }
7300
7302
 
7301
7303
  if (this.TryClickChartTooltipData && this.TryClickChartTooltipData(x,y,e)) //预留给外部点击图标什么用的
7302
7304
  {
7305
+ this.IsOnTouch=false;
7303
7306
  return;
7304
7307
  }
7305
7308
 
@@ -11686,6 +11689,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11686
11689
 
11687
11690
  if (this.Frame && this.Frame.SetLanguage) this.Frame.SetLanguage(this.LanguageID);
11688
11691
 
11692
+ //this.Frame.ClearYCoordinateMaxMin();
11693
+ this.ResetFrameXYSplit();
11689
11694
  this.Frame.SetSizeChage(true);
11690
11695
  this.Draw();
11691
11696
  }
@@ -27371,6 +27376,7 @@ function ChartKLine()
27371
27376
  // 15=HLC Area
27372
27377
  // 16=kagi
27373
27378
  // 17=订单流样式4
27379
+ // 18=订单流样式5
27374
27380
 
27375
27381
  this.CloseLineColor=g_JSChartResource.CloseLineColor;
27376
27382
  this.CloseLineAreaColor=g_JSChartResource.CloseLineAreaColor;
@@ -29033,200 +29039,7 @@ function ChartKLine()
29033
29039
  }
29034
29040
  }
29035
29041
 
29036
- /*
29037
- this.DrawKBarV2=function(data, colorData, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
29038
- {
29039
- var isDrawBorder=false;
29040
- var isEmptyBar=false;
29041
- if (colorData.border) isDrawBorder=true;
29042
- if (colorData.Type===0) isEmptyBar=true;
29043
-
29044
- if (dataWidth>=4)
29045
- {
29046
- if (isDrawBorder)
29047
- {
29048
- if ((dataWidth%2)!=0) dataWidth-=1;
29049
- }
29050
-
29051
- if (data.High>data.Close) //上影线
29052
- {
29053
- if (colorData.Line)
29054
- {
29055
- this.Canvas.strokeStyle=colorData.Line.Color;
29056
- this.Canvas.beginPath();
29057
- if (isHScreen)
29058
- {
29059
- this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
29060
- this.Canvas.lineTo(ToFixedPoint(Math.max(yClose,yOpen)),ToFixedPoint(x));
29061
- }
29062
- else
29063
- {
29064
- if (isDrawBorder)
29065
- {
29066
- var xFixed=left+dataWidth/2;
29067
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(y));
29068
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(Math.min(yClose,yOpen)));
29069
- }
29070
- else
29071
- {
29072
- this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));
29073
- this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(Math.min(yClose,yOpen)));
29074
- }
29075
- }
29076
- this.Canvas.stroke();
29077
- }
29078
-
29079
- y=yClose;
29080
- }
29081
- else
29082
- {
29083
- y=yClose;
29084
- }
29085
-
29086
- if (isHScreen)
29087
- {
29088
- //实心
29089
- if (!isEmptyBar && colorData.BarColor)
29090
- {
29091
- this.Canvas.fillStyle=colorData.BarColor;
29092
- if (Math.abs(yOpen-y)<1)
29093
- {
29094
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
29095
- }
29096
- else
29097
- {
29098
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
29099
- }
29100
- }
29101
-
29102
- if (colorData.Border) //空心
29103
- {
29104
- if (Math.abs(yOpen-y)<1)
29105
- {
29106
- this.Canvas.fillStyle=colorData.Border.Color;
29107
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
29108
- }
29109
- else
29110
- {
29111
- this.Canvas.strokeStyle=colorData.Border.Color;
29112
- this.Canvas.beginPath();
29113
- this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
29114
- this.Canvas.stroke();
29115
- }
29116
- }
29117
- }
29118
- else
29119
- {
29120
-
29121
- //实心
29122
- if (!isEmptyBar && colorData.BarColor)
29123
- {
29124
- this.Canvas.fillStyle=colorData.BarColor;
29125
- if (Math.abs(yOpen-y)<1)
29126
- {
29127
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1); //高度小于1,统一使用高度1
29128
- }
29129
- else
29130
- {
29131
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(Math.min(y,yOpen)),ToFixedRect(dataWidth),ToFixedRect(Math.abs(yOpen-y)));
29132
- }
29133
- }
29134
-
29135
- if (colorData.Border) //空心
29136
- {
29137
- if (Math.abs(yOpen-y)<1)
29138
- {
29139
- this.Canvas.fillStyle=colorData.Border.Color;
29140
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1); //高度小于1,统一使用高度1
29141
- }
29142
- else
29143
- {
29144
- this.Canvas.strokeStyle=colorData.Border.Color;
29145
- this.Canvas.beginPath();
29146
- this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),ToFixedRect(yOpen-y));
29147
- this.Canvas.stroke();
29148
- }
29149
- }
29150
- }
29151
-
29152
- if (data.Open>data.Low) //下影线
29153
- {
29154
- if (colorData.Line)
29155
- {
29156
- this.Canvas.strokeStyle=colorData.Line.Color;
29157
- this.Canvas.beginPath();
29158
- if (isHScreen)
29159
- {
29160
- this.Canvas.moveTo(ToFixedPoint(Math.min(yClose,yOpen)),ToFixedPoint(x));
29161
- this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
29162
- }
29163
- else
29164
- {
29165
- if (isDrawBorder)
29166
- {
29167
- var xFixed=left+dataWidth/2;
29168
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));
29169
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));
29170
- }
29171
- else
29172
- {
29173
- this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(Math.max(yClose,yOpen)));
29174
- this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));
29175
- }
29176
- }
29177
- this.Canvas.stroke();
29178
- }
29179
- }
29180
- }
29181
- else
29182
- {
29183
- var lineColor;
29184
- if (isEmptyBar && colorData.Border)
29185
- {
29186
- lineColor=colorData.Border.Color;
29187
- }
29188
- else if (!isEmptyBar && colorData.BarColor)
29189
- {
29190
- lineColor=colorData.BarColor;
29191
- }
29192
-
29193
- if (lineColor)
29194
- {
29195
- this.Canvas.strokeStyle=lineColor;
29196
- this.Canvas.beginPath();
29197
- if (isHScreen)
29198
- {
29199
- if (data.High==data.Low)
29200
- {
29201
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
29202
- this.Canvas.lineTo(yLow-1,ToFixedPoint(x));
29203
- }
29204
- else
29205
- {
29206
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
29207
- this.Canvas.lineTo(yLow,ToFixedPoint(x));
29208
- }
29209
- }
29210
- else
29211
- {
29212
- if (data.High==data.Low)
29213
- {
29214
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
29215
- this.Canvas.lineTo(ToFixedPoint(x),yLow+1);
29216
- }
29217
- else
29218
- {
29219
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
29220
- this.Canvas.lineTo(ToFixedPoint(x),yLow);
29221
- }
29222
-
29223
- }
29224
- this.Canvas.stroke();
29225
- }
29226
- }
29227
- }
29228
- */
29229
-
29042
+
29230
29043
  this.DrawVirtualBar=function(data, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
29231
29044
  {
29232
29045
  var yTop=Math.min(yHigh,yLow), yBottom=Math.max(yHigh,yLow);
@@ -30182,6 +29995,10 @@ function ChartKLine()
30182
29995
  {
30183
29996
  this.DrawOrderFlow_Style4();
30184
29997
  }
29998
+ else if (this.DrawType==18)
29999
+ {
30000
+ this.DrawOrderFlow_Style5();
30001
+ }
30185
30002
  else
30186
30003
  {
30187
30004
  this.DrawKBar();
@@ -31861,6 +31678,13 @@ function ChartKLine()
31861
31678
  }
31862
31679
  }
31863
31680
 
31681
+ ////////////////////////////////////////////////////////////////////////////////
31682
+ //订单流样式5
31683
+ this.DrawOrderFlow_Style5=function()
31684
+ {
31685
+
31686
+ }
31687
+
31864
31688
  //////////////////////////////////////////////////////////////
31865
31689
  // high low bar
31866
31690
  //
@@ -133626,7 +133450,7 @@ function ScrollBarBGChart()
133626
133450
 
133627
133451
 
133628
133452
 
133629
- var HQCHART_VERSION="1.1.13384";
133453
+ var HQCHART_VERSION="1.1.13388";
133630
133454
 
133631
133455
  function PrintHQChartVersion()
133632
133456
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13384";
8
+ var HQCHART_VERSION="1.1.13388";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -7307,6 +7307,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7307
7307
 
7308
7308
  if (this.TryClickButton(x,y,e))
7309
7309
  {
7310
+ this.IsOnTouch=false;
7310
7311
  return;
7311
7312
  }
7312
7313
 
@@ -7339,11 +7340,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7339
7340
 
7340
7341
  if (this.TryClickCrossCursor(x,y, e))
7341
7342
  {
7343
+ this.IsOnTouch=false;
7342
7344
  return;
7343
7345
  }
7344
7346
 
7345
7347
  if (this.TryClickChartTooltipData && this.TryClickChartTooltipData(x,y,e)) //预留给外部点击图标什么用的
7346
7348
  {
7349
+ this.IsOnTouch=false;
7347
7350
  return;
7348
7351
  }
7349
7352
 
@@ -11730,6 +11733,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11730
11733
 
11731
11734
  if (this.Frame && this.Frame.SetLanguage) this.Frame.SetLanguage(this.LanguageID);
11732
11735
 
11736
+ //this.Frame.ClearYCoordinateMaxMin();
11737
+ this.ResetFrameXYSplit();
11733
11738
  this.Frame.SetSizeChage(true);
11734
11739
  this.Draw();
11735
11740
  }
@@ -27415,6 +27420,7 @@ function ChartKLine()
27415
27420
  // 15=HLC Area
27416
27421
  // 16=kagi
27417
27422
  // 17=订单流样式4
27423
+ // 18=订单流样式5
27418
27424
 
27419
27425
  this.CloseLineColor=g_JSChartResource.CloseLineColor;
27420
27426
  this.CloseLineAreaColor=g_JSChartResource.CloseLineAreaColor;
@@ -29077,200 +29083,7 @@ function ChartKLine()
29077
29083
  }
29078
29084
  }
29079
29085
 
29080
- /*
29081
- this.DrawKBarV2=function(data, colorData, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
29082
- {
29083
- var isDrawBorder=false;
29084
- var isEmptyBar=false;
29085
- if (colorData.border) isDrawBorder=true;
29086
- if (colorData.Type===0) isEmptyBar=true;
29087
-
29088
- if (dataWidth>=4)
29089
- {
29090
- if (isDrawBorder)
29091
- {
29092
- if ((dataWidth%2)!=0) dataWidth-=1;
29093
- }
29094
-
29095
- if (data.High>data.Close) //上影线
29096
- {
29097
- if (colorData.Line)
29098
- {
29099
- this.Canvas.strokeStyle=colorData.Line.Color;
29100
- this.Canvas.beginPath();
29101
- if (isHScreen)
29102
- {
29103
- this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
29104
- this.Canvas.lineTo(ToFixedPoint(Math.max(yClose,yOpen)),ToFixedPoint(x));
29105
- }
29106
- else
29107
- {
29108
- if (isDrawBorder)
29109
- {
29110
- var xFixed=left+dataWidth/2;
29111
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(y));
29112
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(Math.min(yClose,yOpen)));
29113
- }
29114
- else
29115
- {
29116
- this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));
29117
- this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(Math.min(yClose,yOpen)));
29118
- }
29119
- }
29120
- this.Canvas.stroke();
29121
- }
29122
-
29123
- y=yClose;
29124
- }
29125
- else
29126
- {
29127
- y=yClose;
29128
- }
29129
-
29130
- if (isHScreen)
29131
- {
29132
- //实心
29133
- if (!isEmptyBar && colorData.BarColor)
29134
- {
29135
- this.Canvas.fillStyle=colorData.BarColor;
29136
- if (Math.abs(yOpen-y)<1)
29137
- {
29138
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
29139
- }
29140
- else
29141
- {
29142
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
29143
- }
29144
- }
29145
-
29146
- if (colorData.Border) //空心
29147
- {
29148
- if (Math.abs(yOpen-y)<1)
29149
- {
29150
- this.Canvas.fillStyle=colorData.Border.Color;
29151
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
29152
- }
29153
- else
29154
- {
29155
- this.Canvas.strokeStyle=colorData.Border.Color;
29156
- this.Canvas.beginPath();
29157
- this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
29158
- this.Canvas.stroke();
29159
- }
29160
- }
29161
- }
29162
- else
29163
- {
29164
-
29165
- //实心
29166
- if (!isEmptyBar && colorData.BarColor)
29167
- {
29168
- this.Canvas.fillStyle=colorData.BarColor;
29169
- if (Math.abs(yOpen-y)<1)
29170
- {
29171
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1); //高度小于1,统一使用高度1
29172
- }
29173
- else
29174
- {
29175
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(Math.min(y,yOpen)),ToFixedRect(dataWidth),ToFixedRect(Math.abs(yOpen-y)));
29176
- }
29177
- }
29178
-
29179
- if (colorData.Border) //空心
29180
- {
29181
- if (Math.abs(yOpen-y)<1)
29182
- {
29183
- this.Canvas.fillStyle=colorData.Border.Color;
29184
- this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1); //高度小于1,统一使用高度1
29185
- }
29186
- else
29187
- {
29188
- this.Canvas.strokeStyle=colorData.Border.Color;
29189
- this.Canvas.beginPath();
29190
- this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),ToFixedRect(yOpen-y));
29191
- this.Canvas.stroke();
29192
- }
29193
- }
29194
- }
29195
-
29196
- if (data.Open>data.Low) //下影线
29197
- {
29198
- if (colorData.Line)
29199
- {
29200
- this.Canvas.strokeStyle=colorData.Line.Color;
29201
- this.Canvas.beginPath();
29202
- if (isHScreen)
29203
- {
29204
- this.Canvas.moveTo(ToFixedPoint(Math.min(yClose,yOpen)),ToFixedPoint(x));
29205
- this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
29206
- }
29207
- else
29208
- {
29209
- if (isDrawBorder)
29210
- {
29211
- var xFixed=left+dataWidth/2;
29212
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));
29213
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));
29214
- }
29215
- else
29216
- {
29217
- this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(Math.max(yClose,yOpen)));
29218
- this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));
29219
- }
29220
- }
29221
- this.Canvas.stroke();
29222
- }
29223
- }
29224
- }
29225
- else
29226
- {
29227
- var lineColor;
29228
- if (isEmptyBar && colorData.Border)
29229
- {
29230
- lineColor=colorData.Border.Color;
29231
- }
29232
- else if (!isEmptyBar && colorData.BarColor)
29233
- {
29234
- lineColor=colorData.BarColor;
29235
- }
29236
-
29237
- if (lineColor)
29238
- {
29239
- this.Canvas.strokeStyle=lineColor;
29240
- this.Canvas.beginPath();
29241
- if (isHScreen)
29242
- {
29243
- if (data.High==data.Low)
29244
- {
29245
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
29246
- this.Canvas.lineTo(yLow-1,ToFixedPoint(x));
29247
- }
29248
- else
29249
- {
29250
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
29251
- this.Canvas.lineTo(yLow,ToFixedPoint(x));
29252
- }
29253
- }
29254
- else
29255
- {
29256
- if (data.High==data.Low)
29257
- {
29258
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
29259
- this.Canvas.lineTo(ToFixedPoint(x),yLow+1);
29260
- }
29261
- else
29262
- {
29263
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
29264
- this.Canvas.lineTo(ToFixedPoint(x),yLow);
29265
- }
29266
-
29267
- }
29268
- this.Canvas.stroke();
29269
- }
29270
- }
29271
- }
29272
- */
29273
-
29086
+
29274
29087
  this.DrawVirtualBar=function(data, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
29275
29088
  {
29276
29089
  var yTop=Math.min(yHigh,yLow), yBottom=Math.max(yHigh,yLow);
@@ -30226,6 +30039,10 @@ function ChartKLine()
30226
30039
  {
30227
30040
  this.DrawOrderFlow_Style4();
30228
30041
  }
30042
+ else if (this.DrawType==18)
30043
+ {
30044
+ this.DrawOrderFlow_Style5();
30045
+ }
30229
30046
  else
30230
30047
  {
30231
30048
  this.DrawKBar();
@@ -31905,6 +31722,13 @@ function ChartKLine()
31905
31722
  }
31906
31723
  }
31907
31724
 
31725
+ ////////////////////////////////////////////////////////////////////////////////
31726
+ //订单流样式5
31727
+ this.DrawOrderFlow_Style5=function()
31728
+ {
31729
+
31730
+ }
31731
+
31908
31732
  //////////////////////////////////////////////////////////////
31909
31733
  // high low bar
31910
31734
  //
@@ -137567,7 +137391,7 @@ function HQChartScriptWorker()
137567
137391
 
137568
137392
 
137569
137393
 
137570
- var HQCHART_VERSION="1.1.13384";
137394
+ var HQCHART_VERSION="1.1.13388";
137571
137395
 
137572
137396
  function PrintHQChartVersion()
137573
137397
  {