hqchart 1.1.13732 → 1.1.13740
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/umychart.vue.js +19 -17
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +27 -2
- package/src/jscommon/umychart.js +74 -39
- package/src/jscommon/umychart.resource/font/drawtool/demo_index.html +49 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.css +11 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.js +1 -1
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.json +14 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.ttf +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff2 +0 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +75 -40
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +102 -42
package/lib/umychart.vue.js
CHANGED
|
@@ -1502,7 +1502,8 @@ ON_CREATE_RIGHT_MENU:152,//创建右键菜单
|
|
|
1502
1502
|
ON_FORMAT_CALL_AUCTION_INDEX_TITLE:153,//集合竞价指标窗口标题内容
|
|
1503
1503
|
ON_FORMAT_KLINE_HIGH_LOW_TITLE:154,//K线最高最低价格式化内容
|
|
1504
1504
|
ON_CUSTOM_CORSSCURSOR_POSITION:155,//自定义十字光标X轴的输出的位置
|
|
1505
|
-
ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX:156
|
|
1505
|
+
ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX:156,//日盘夜盘的分界线
|
|
1506
|
+
ON_CUSTOM_MINUTE_BG:157//自定义分时图背景颜色
|
|
1506
1507
|
};var JSCHART_OPERATOR_ID={OP_SCROLL_LEFT:1,//往左移动
|
|
1507
1508
|
OP_SCROLL_RIGHT:2,//往右移动
|
|
1508
1509
|
OP_ZOOM_OUT:3,//缩小
|
|
@@ -1708,18 +1709,18 @@ this.SelectChartDrawPicture=null;if(this.BorderDrag){}else if(this.YDrag||this.R
|
|
|
1708
1709
|
var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==2)this.SetChartDrawPictureThirdPoint(drag.Click.X,drag.Click.Y);else{this.SetChartDrawPictureFirstPoint(drag.Click.X,drag.Click.Y);//只有1个点 直接完成
|
|
1709
1710
|
if(this.FinishChartDrawPicturePoint()){if(drawPicture.IsDrawMain)this.Draw();else this.DrawDynamicInfo();}}if(drawPictureActive.Select.Guid&&(!this.CurrentChartDrawPicture||drawPictureActive.Select.Guid!=this.CurrentChartDrawPicture.Guid)){if(drawPictureActive.Select.Chart.IsDrawMain)this.Draw();}}else//是否在画图工具上
|
|
1710
1711
|
{var drawPictrueData={};drawPictrueData.X=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;drawPictrueData.Y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;if(this.GetChartDrawPictureByPoint(drawPictrueData)){if(this.EnableEraseChartDrawPicture)//擦掉画线
|
|
1711
|
-
{this.CurrentChartDrawPicture=null;this.SelectChartDrawPicture=null;this.ClearChartDrawPicture(drawPictrueData.ChartDrawPicture);}else
|
|
1712
|
+
{this.CurrentChartDrawPicture=null;this.SelectChartDrawPicture=null;this.ClearChartDrawPicture(drawPictrueData.ChartDrawPicture);}else{this.UpDownDrag=null;//画图优先
|
|
1712
1713
|
this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;//当前已有选中的,需要刷下
|
|
1713
1714
|
var bDraw=false;if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart&&drawPictureActive.Select.Chart.IsDrawMain)bDraw=true;else if(drawPictrueData.ChartDrawPicture.IsDrawMain)bDraw=true;if(bDraw)this.Draw();drawPictrueData.ChartDrawPicture.Status=20;drawPictrueData.ChartDrawPicture.ValueToPoint();drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;//this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
|
|
1714
1715
|
//this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
|
|
1715
|
-
this.SelectChartDrawPicture.DragInfo={Click:{X:e.clientX,Y:e.clientY}};}
|
|
1716
|
+
this.SelectChartDrawPicture.DragInfo={Click:{X:e.clientX,Y:e.clientY}};}var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE);//选中画图工具事件
|
|
1716
1717
|
if(event&&event.Callback){var sendData={DrawPicture:drawPictrueData.ChartDrawPicture};event.Callback(event,sendData,this);}else{this.OnSelectChartPicture(drawPictrueData.ChartDrawPicture);//选中画图工具事件
|
|
1717
1718
|
}}else{if(this.ClickChartTimer!=null){clearTimeout(this.ClickChartTimer);this.ClickChartTimer=null;}var self=this;var ptClick={X:this.ClickDownPoint.X,Y:this.ClickDownPoint.Y};this.ClickChartTimer=setTimeout(function(){self.TryClickPaintEvent(JSCHART_EVENT_ID.ON_CLICK_CHART_PAINT,ptClick,e);},250);var bSelectedChartChanged=false;if(this.SelectedChart.EnableSelected){var selectChart=this.PtInChart(x,y);if(selectChart){if(this.SelectedChart.Selected.Identify!=selectChart.Identify){this.SelectedChart.Selected.Identify=selectChart.Identify;this.SelectedChart.Selected.Chart=selectChart.Chart;bSelectedChartChanged=true;}if(this.EnableIndexChartDrag){this.IndexChartDrag={SelectedChart:selectChart,LastMove:{X:x,Y:y},Click:{X:x,Y:y}};this.IndexChartDrag.Info=this.GetSelectedChartInfo(selectChart);if(this.IndexChartDrag.Info)this.IndexChartDrag.Info.FrameID=this.Frame.PtInFrame(x,y);}}else{if(this.SelectedChart.Selected.Identify){this.SelectedChart.Selected.Identify=null;this.SelectedChart.Selected.Chart=null;bSelectedChartChanged=true;}}}else{if(this.SelectedChart.Selected.Identify){this.SelectedChart.Selected.Identify=null;bSelectedChartChanged=true;}}if(drawPictureActive.Select.Guid!=null&&this.SelectChartDrawPicture==null||bSelectedChartChanged){var drawType=0;if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart&&drawPictureActive.Select.Chart.IsDrawMain)drawType=1;if(bSelectedChartChanged){var chart=selectedChart.Chart;if(chart&&chart.SetSelectedStatus){chart.SetSelectedStatus(0);drawType=1;}chart=this.SelectedChart.Selected.Chart;if(chart&&chart.SetSelectedStatus){chart.SetSelectedStatus(1);drawType=1;}}if(drawType==1)this.Draw();else this.DrawDynamicInfo();}else if(bRedraw){this.Draw();}else if(bDrawDynamicInfo){this.DrawDynamicInfo();}}}if(!this.SelectChartDrawPicture)this.CloseModifyDrawDialog();//当前没有选中画图 隐藏画图修改框
|
|
1718
1719
|
document.onmousemove=function(e){_this7.DocOnMouseMove(e);};document.onmouseup=function(e){_this7.DocOnMouseUp(e);};};this.DocOnMouseMove=function(e){//加载数据中,禁用鼠标事件
|
|
1719
1720
|
if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash)return;var drag=this.MouseDrag;if(!drag)return;var moveSetp=Math.abs(drag.LastMove.X-e.clientX);var moveSetpY=Math.abs(drag.LastMove.Y-e.clientY);var isDragSelectRect=this.RectSelectDrag&&this.RectSelectDrag.Index>=0;var isDragSubSelectRect=this.RectSelectDrag&&this.RectSelectDrag.Type==4;if(drag.CurrentMove){drag.CurrentMove.X=e.clientX;drag.CurrentMove.Y=e.clientY;}if(this.BorderDrag&&this.BorderDrag.Index>=0)//边框拖动
|
|
1720
1721
|
{if(Math.abs(drag.LastMove.Y-e.clientY)<5)return;var yMove=e.clientY-drag.LastMove.Y;this.OnMoveFromeBorder(this.BorderDrag.Index,yMove);drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}else if(this.YDrag&&this.YDrag.Index>=0)//Y轴缩放
|
|
1721
1722
|
{if(moveSetpY<5)return;var yMove=e.clientY-drag.LastMove.Y;//this.UIElement.style.cursor="n-resize";
|
|
1722
|
-
JSConsole.Chart.Log("[JSChartContainer::DocOnMouseMove] YDrag ",this.YDrag,yMove);this.OnZoomUpDownFrameY(this.YDrag,yMove);drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}else if(this.IndexChartDrag&&this.IndexChartDrag.SelectedChart){if(Math.abs(drag.LastMove.Y-e.clientY)<2&&Math.abs(drag.LastMove.X-e.clientX)<2)return;var chartMove=this.GetExtendChartByClassName("DragMovePaint");if(chartMove&&chartMove.Chart){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;chartMove.Chart.Point={X:x,Y:y};chartMove.Chart.IsShow=true;chartMove.Chart.Info=this.IndexChartDrag.Info;this.DrawDynamicInfo();}this.IndexChartDrag.LastMove.X=x;this.IndexChartDrag.LastMove.Y=y;drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}else if(this.CustomChartDrag){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var sendData={X:x,Y:y,e:e,ChartDrag:this.CustomChartDrag,Drag:drag};this.TryDragMove_CustomChartDrag(sendData);}else if(this.CurrentChartDrawPicture){var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==1||drawPicture.Status==2){if(Math.abs(drag.LastMove.X-e.clientX)<5&&Math.abs(drag.LastMove.Y-e.clientY)<5)return;if(this.SetChartDrawPictureSecondPoint(e.clientX,e.clientY)){this.DrawDynamicInfo();}}else if(drawPicture.Status==3){if(this.SetChartDrawPictureThirdPoint(e.clientX,e.clientY)){this.DrawDynamicInfo();}}else if(drawPicture.Status==20)//画图工具移动
|
|
1723
|
+
JSConsole.Chart.Log("[JSChartContainer::DocOnMouseMove] YDrag ",this.YDrag,yMove);this.OnZoomUpDownFrameY(this.YDrag,yMove);drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}else if(this.IndexChartDrag&&this.IndexChartDrag.SelectedChart){if(Math.abs(drag.LastMove.Y-e.clientY)<2&&Math.abs(drag.LastMove.X-e.clientX)<2)return;var chartMove=this.GetExtendChartByClassName("DragMovePaint");if(chartMove&&chartMove.Chart){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;chartMove.Chart.Point={X:x,Y:y};chartMove.Chart.IsShow=true;chartMove.Chart.Info=this.IndexChartDrag.Info;this.DrawDynamicInfo();}this.IndexChartDrag.LastMove.X=x;this.IndexChartDrag.LastMove.Y=y;drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}else if(this.CustomChartDrag){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var sendData={X:x,Y:y,e:e,ChartDrag:this.CustomChartDrag,Drag:drag};this.TryDragMove_CustomChartDrag(sendData);}else if(this.CurrentChartDrawPicture&&this.CurrentChartDrawPicture.EnableMove===true){var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==1||drawPicture.Status==2){if(Math.abs(drag.LastMove.X-e.clientX)<5&&Math.abs(drag.LastMove.Y-e.clientY)<5)return;if(this.SetChartDrawPictureSecondPoint(e.clientX,e.clientY)){this.DrawDynamicInfo();}}else if(drawPicture.Status==3){if(this.SetChartDrawPictureThirdPoint(e.clientX,e.clientY)){this.DrawDynamicInfo();}}else if(drawPicture.Status==20)//画图工具移动
|
|
1723
1724
|
{if(Math.abs(drag.LastMove.X-e.clientX)<5&&Math.abs(drag.LastMove.Y-e.clientY)<1)return;if(this.SelectChartDrawPicture){if(this.SelectChartDrawPicture.EnableCtrlMove){if(!e.ctrlKey)return;}}if(this.SelectChartDrawPicture&&this.SelectChartDrawPicture.DragInfo)this.SelectChartDrawPicture.DragInfo.Move={X:e.clientX,Y:e.client};if(this.MoveChartDrawPicture(e.clientX-drag.LastMove.X,e.clientY-drag.LastMove.Y,false,drag)){this.DrawDynamicInfo();}}drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}else if(this.DragMode==1||isDragSelectRect||isDragSubSelectRect)//数据上下左右拖拽
|
|
1724
1725
|
{this.OnDragMode_One({X:moveSetp,Y:moveSetpY},e);}else if(this.DragMode==2)//区间选择
|
|
1725
1726
|
{var yMoveSetp=Math.abs(drag.LastMove.Y-e.clientY);if(moveSetp<5&&yMoveSetp<5)return;this.SetCursor({Cursor:"default"});var ptStart=this.PointAbsoluteToRelative(drag.Click.X,drag.Click.Y);var ptEnd=this.PointAbsoluteToRelative(e.clientX,e.clientY);this.ShowDragSelectRect(ptStart,ptEnd);drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}};this.OnDragMode_One=function(moveData,e){var moveSetp=moveData.X;var moveSetpY=moveData.Y;var drag=this.MouseDrag;if(moveSetp<5&&moveSetpY<5)return;var bNeedDraw=false;var bUpDownY=false;if(moveSetpY>=5){if(this.UpDownDrag&&this.UpDownDrag.Index>=0){var yMove=e.clientY-drag.LastMove.Y;JSConsole.Chart.Log("[JSChartContainer::OnDragMode_One] UpDownDrag ",this.UpDownDrag,yMove);//this.UIElement.style.cursor="pointer";
|
|
@@ -1769,8 +1770,7 @@ var selectedChart={Chart:this.SelectedChart.Selected.Chart,Identify:this.Selecte
|
|
|
1769
1770
|
this.PhoneTouchInfo={Start:{X:touches[0].clientX,Y:touches[0].clientY},End:{X:touches[0].clientX,Y:touches[0].clientY}};if(this.SelectChartDrawPicture)this.SelectChartDrawPicture.IsSelected=false;this.SelectChartDrawPicture=null;var isDrawPictrue=false;if(this.CurrentChartDrawPicture)//画图工具模式
|
|
1770
1771
|
{var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==2)this.SetChartDrawPictureThirdPoint(drag.Click.X,drag.Click.Y,true);else{this.SetChartDrawPictureFirstPoint(drag.Click.X,drag.Click.Y,true);//只有1个点 直接完成
|
|
1771
1772
|
if(this.FinishChartDrawPicturePoint()){if(drawPicture.IsDrawMain)this.Draw();else this.DrawDynamicInfo({Corss:false,Tooltip:false});}}if(e.cancelable)e.preventDefault();return;}else{var pt=this.PointAbsoluteToRelative(touches[0].clientX,touches[0].clientY,true);var drawPictrueData={X:pt.X,Y:pt.Y};var pixelTatio=GetDevicePixelRatio();//鼠标移动坐标是原始坐标 需要乘以放大倍速
|
|
1772
|
-
if(this.GetChartDrawPictureByPoint(drawPictrueData)){
|
|
1773
|
-
{drawPictrueData.ChartDrawPicture.Status=20;drawPictrueData.ChartDrawPicture.ValueToPoint();drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;drawPictrueData.ChartDrawPicture.IsSelected=true;this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;}else{this.CurrentChartDrawPicture=null;this.SelectChartDrawPicture=null;}var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE);//选中画图工具事件
|
|
1773
|
+
if(this.GetChartDrawPictureByPoint(drawPictrueData)){drawPictrueData.ChartDrawPicture.Status=20;drawPictrueData.ChartDrawPicture.ValueToPoint();drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;drawPictrueData.ChartDrawPicture.IsSelected=true;this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE);//选中画图工具事件
|
|
1774
1774
|
if(event&&event.Callback){var sendData={DrawPicture:drawPictrueData.ChartDrawPicture};event.Callback(event,sendData,this);}var drawType=0;if(drawPictrueData.ChartDrawPicture.IsDrawMain)drawType=1;else if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart&&drawPictureActive.Select.Chart.IsDrawMain)drawType=1;if(drawType==1)this.Draw();if(e.cancelable)e.preventDefault();return;}}if(bStartTimer){//长按2秒,十字光标
|
|
1775
1775
|
var self=this;this.DragTimer=setTimeout(function(){self.IsPress=true;if(drag.Click.X==drag.LastMove.X&&drag.Click.Y==drag.LastMove.Y)//手指没有移动,出现十字光标
|
|
1776
1776
|
{var mouseDrag=self.MouseDrag;self.MouseDrag=null;if(self.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID)self.TouchStatus.CorssCursorShow=true;//十字显示
|
|
@@ -1780,7 +1780,7 @@ if(self.EnableClickModel===true)self.ClickModel.IsShowCorssCursor=true;self.Move
|
|
|
1780
1780
|
}else if(this.IsClickShowCorssCursor){this.MoveCorssCursor(drag.Click,e);}this.TouchEvent({EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH,FunctionName:"OnTouchStart"},e);var drawType=0;if(drawPictureActive.Select.Guid!=null){if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart)drawType=1;}if(drawType==1)this.Draw();}else if(this.IsPhonePinching(e)){var phonePinch={"Start":{},"Last":{}};var touches=this.GetToucheData(e,this.IsForceLandscape);phonePinch.Start={X:touches[0].pageX,Y:touches[0].pageY,X2:touches[1].pageX,Y2:touches[1].pageY};phonePinch.Last={X:touches[0].pageX,Y:touches[0].pageY,X2:touches[1].pageX,Y2:touches[1].pageY};this.PhonePinch=phonePinch;this.SelectChartDrawPicture=null;}};this.OnTouchMove=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var touches=this.GetToucheData(e,this.IsForceLandscape);if(this.IsPhoneDragging(e)){var drag=this.MouseDrag;if(drag==null){if(this.IsForceLandscape)y=uielement.getBoundingClientRect().width-touches[0].clientY;//强制横屏Y计算
|
|
1781
1781
|
if(!this.ChartDrawOption.IsLockScreen)this.MoveCorssCursor({X:touches[0].clientX,Y:touches[0].clientY},e);}else{var moveAngle=this.GetMoveAngle(drag.LastMove,{X:touches[0].clientX,Y:touches[0].clientY});var moveSetp=Math.abs(drag.LastMove.X-touches[0].clientX);var moveUpDown=Math.abs(drag.LastMove.Y-touches[0].clientY);moveSetp=parseInt(moveSetp);var isMoveCorssCursor=this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID&&this.TouchStatus.CorssCursorShow==true;//是否移动十字光标
|
|
1782
1782
|
if(this.VerticalDrag){if(this.VerticalDrag.IsDrag===true)isMoveCorssCursor=false;else isMoveCorssCursor=true;}if(this.EnableClickModel){if(this.ClickModel.IsShowCorssCursor===true)isMoveCorssCursor=true;else isMoveCorssCursor=false;}//JSConsole.Chart.Log(`[JSChartContainer::OnTouchMove] moveAngle=${moveAngle} , moveUpDown=${moveUpDown}, moveSetp=${moveSetp}`);
|
|
1783
|
-
if(this.CurrentChartDrawPicture){var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==1||drawPicture.Status==2){if(moveSetp<5&&moveUpDown<5)return;if(this.SetChartDrawPictureSecondPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==3){if(this.SetChartDrawPictureThirdPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==20)//画图工具移动
|
|
1783
|
+
if(this.CurrentChartDrawPicture&&this.CurrentChartDrawPicture.EnableMove===true){var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==1||drawPicture.Status==2){if(moveSetp<5&&moveUpDown<5)return;if(this.SetChartDrawPictureSecondPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==3){if(this.SetChartDrawPictureThirdPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==20)//画图工具移动
|
|
1784
1784
|
{if(moveSetp<5&&moveUpDown<5)return;if(this.MoveChartDrawPicture(touches[0].clientX-drag.LastMove.X,touches[0].clientY-drag.LastMove.Y,true)){this.DrawDynamicInfo();}}drag.LastMove.X=touches[0].clientX;drag.LastMove.Y=touches[0].clientY;}else if(isMoveCorssCursor)//点击模式下 十字光标显示 左右移动十字光标
|
|
1785
1785
|
{var mouseDrag=this.MouseDrag;this.MouseDrag=null;this.MoveCorssCursor(drag.Click,e);//移动十字光标
|
|
1786
1786
|
}else if(this.DragMode==1||isMoveCorssCursor==false)//数据左右拖拽
|
|
@@ -2390,6 +2390,7 @@ this.BeforeCloseIcon=CloneData(g_JSChartResource.Minute.Before.CloseIcon);this.I
|
|
|
2390
2390
|
this.BeforeOpenVerticalInfo=[];//盘前集合竞价X轴
|
|
2391
2391
|
this.AfterCloseVerticalInfo=[];//收盘集合竞价X轴
|
|
2392
2392
|
this.NightDayConfig=CloneData(g_JSChartResource.Minute.NightDay);this.DrawFrame=function(){if(!this.IsMinSize){this.SplitXYCoordinate();this.DrawBeforeDataBG();this.YInsideOffset=0;if(this.BeforeDrawXYCallback)this.BeforeDrawXYCallback(this);this.DrawNightDayBG();//绘制夜盘 日盘背景
|
|
2393
|
+
this.DrawCustomBG();//绘制自定义背景色
|
|
2393
2394
|
this.DrawTitleBG();this.DrawHorizontal();this.DrawVertical();}if(this.SizeChange==true||this.ReDrawToolbar==true){this.DrawToolbar();//大小变动才画工具条
|
|
2394
2395
|
this.ReDrawToolbar=false;}};//画边框
|
|
2395
2396
|
this.SuperDrawBorder=this.DrawBorder;this.DrawBorder=function(){if(!this.IsShowBorder)return;if(this.IsMinSize)return;this.SuperDrawBorder();if(this.Identify==1)//走势图和成交量中间用粗线分割开
|
|
@@ -2422,7 +2423,7 @@ this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed
|
|
|
2422
2423
|
this.DrawBeforeDataBG=function(){var border=this.ChartBorder.GetBorder();if(border.DayBorder){this.DrawMultiDayBeforeDataBG(border);return;}if(this.ChartBorder.LeftExtendWidth<10&&this.ChartBorder.RightExtendWidth<10)return;//if (this.Identify>=2) return;
|
|
2423
2424
|
var top=ToFixedPoint(border.Top);var bottom=ToFixedPoint(border.Bottom);this.Canvas.fillStyle=this.BeforeBGColor;if(this.ChartBorder.LeftExtendWidth>10)//盘前
|
|
2424
2425
|
{var left=ToFixedPoint(border.Left);var right=ToFixedPoint(this.ChartBorder.GetLeft());var width=right-left;var height=bottom-top;this.Canvas.fillRect(left,top,width,height);this.DrawCallAuctionVertical(this.BeforeOpenVerticalInfo,this.YSplitOperator.BeforeOpenData,border,true);}if(this.ChartBorder.RightExtendWidth>10)//盘后
|
|
2425
|
-
{this.Canvas.fillStyle=this.AfterBGColor;var left=ToFixedPoint(this.ChartBorder.GetRight());var right=ToFixedPoint(border.Right);var width=right-left;var height=bottom-top;this.Canvas.fillRect(left,top,width,height);}};this.DrawNightDayBG=function(){if(this.DayCount!=1)return;if(!this.HQChart)return;if(!this.HQChart.EnableNightDayBG)return;var symbol=this.HQChart.Symbol;if(!symbol)return;var xIndex=-1;//获取夜盘和日期的分界线X索引位置
|
|
2426
|
+
{this.Canvas.fillStyle=this.AfterBGColor;var left=ToFixedPoint(this.ChartBorder.GetRight());var right=ToFixedPoint(border.Right);var width=right-left;var height=bottom-top;this.Canvas.fillRect(left,top,width,height);}};this.DrawCustomBG=function(){if(!this.HQChart)return;if(this.IsHScreen)return;var symbol=this.HQChart.Symbol;if(!symbol)return;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_MINUTE_BG);if(!event||!event.Callback)return;var aryDay=null;if(this.DayCount>1){if(!IFrameSplitOperator.IsNonEmptyArray(this.HQChart.DayData))return;aryDay=[];for(var i=this.HQChart.DayData.length-1;i>=0;--i){aryDay.push({Date:this.HQChart.DayData[i].Date,BGColor:null});}}else if(this.DayCount==1){if(!IFrameSplitOperator.IsPlusNumber(this.HQChart.DataStatus.LatestDate))return;aryDay=[{Date:this.HQChart.DataStatus.LatestDate,BGColor:null}];}if(!IFrameSplitOperator.IsNonEmptyArray(aryDay))return;var sendData={XPointCount:this.XPointCount,DayCount:this.DayCount,MinuteCount:this.MinuteCount,AryDay:aryDay,PreventDefault:false};event.Callback(event,sendData,this);if(sendData.PreventDefault)return;var border=this.ChartBorder.GetBorder();for(var i=0;i<aryDay.length;++i){var item=aryDay[i];if(!item.BGColor)continue;var start=i*this.MinuteCount;var end=start+this.MinuteCount-1;var xStart=this.GetXFromIndex(start);var xEnd=this.GetXFromIndex(end);var rtDay={Left:xStart,Top:border.Top,Right:xEnd,Bottom:border.Bottom};rtDay.Width=rtDay.Right-rtDay.Left;rtDay.Height=rtDay.Bottom-rtDay.Top;this.Canvas.fillStyle=item.BGColor;this.Canvas.fillRect(rtDay.Left,rtDay.Top,rtDay.Width,rtDay.Height);}};this.DrawNightDayBG=function(){if(this.DayCount!=1)return;if(!this.HQChart)return;if(!this.HQChart.EnableNightDayBG)return;var symbol=this.HQChart.Symbol;if(!symbol)return;var xIndex=-1;//获取夜盘和日期的分界线X索引位置
|
|
2426
2427
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX);if(!event||!event.Callback)return;var sendData={Symbol:symbol,XIndex:xIndex,MinuteTimeStringData:g_MinuteTimeStringData};event.Callback(event,sendData,this);xIndex=sendData.XIndex;if(xIndex<0)return;var border=this.ChartBorder.GetBorder();var x=this.GetXFromIndex(xIndex);var rtNight={Left:border.Left,Top:border.TopEx,Right:x,Bottom:border.Bottom};rtNight.Width=rtNight.Right-rtNight.Left;rtNight.Height=rtNight.Bottom-rtNight.Top;this.Canvas.fillStyle=this.NightDayConfig.NightBGColor;this.Canvas.fillRect(rtNight.Left,rtNight.Top,rtNight.Width,rtNight.Height);if(this.Identify!=0)return;//显示 日盘夜盘文字
|
|
2427
2428
|
this.Canvas.font=this.NightDayConfig.Font;this.Canvas.textBaseline="bottom";this.Canvas.textAlign='left';var aryTitle=[{Title:"夜盘",Position:1,Config:this.NightDayConfig.Night},{Title:"日盘",Position:0,Config:this.NightDayConfig.Day}];var textHeight=this.Canvas.measureText("擎").width;for(var i=0;i<aryTitle.length;++i){var item=aryTitle[i];var text=g_JSChartLocalization.GetText(item.Title,this.HQChart.LanguageID);var testWidth=this.Canvas.measureText(text).width;var rtItem={Width:testWidth+item.Config.Margin.Left+item.Config.Margin.Right,Height:textHeight+item.Config.Margin.Top+item.Config.Margin.Bottom,Bottom:border.Bottom};rtItem.Top=rtItem.Bottom-rtItem.Height;if(item.Position===1){rtItem.Right=x-1;rtItem.Left=rtItem.Right-rtItem.Width;}else{rtItem.Left=x+1;rtItem.Right=rtItem.Left+rtItem.Width;}if(item.Config.BGColor){this.Canvas.fillStyle=item.Config.BGColor;this.Canvas.fillRect(rtItem.Left,rtItem.Top,rtItem.Width,rtItem.Height);}if(item.Config.BorderColor){this.Canvas.strokeStyle=item.Config.BorderColor;this.Canvas.strokeRect(ToFixedPoint(rtItem.Left),ToFixedPoint(rtItem.Top),ToFixedRect(rtItem.Width),ToFixedRect(rtItem.Height));}this.Canvas.fillStyle=item.Config.Color;this.Canvas.fillText(text,rtItem.Left+item.Config.Margin.Left,rtItem.Bottom-item.Config.Margin.Bottom);}};//选中的画图工具X轴坐标信息
|
|
2428
2429
|
this.DrawPictureXCoordinate=function(drawPicture,range,option){if(this.IsHScreen)return;if(!range)return;if(!IFrameSplitOperator.IsNonEmptyArray(range.Points))return;var border=this.GetBorder();var left=border.Left;var right=border.Right;this.Canvas.font=this.DrawPicture.Font;var fontHeight=this.GetFontHeight();if(range.X){var xRange=range.X;var xLeft=xRange.Min.X;var xRight=xRange.Max.X;if(xLeft<left)xLeft=left;if(xRight>right)xRight=right;this.Canvas.fillStyle=this.DrawPicture.BGColor;this.Canvas.fillRect(xLeft,border.Bottom,xRight-xLeft,fontHeight);}for(var i=0;i<range.Points.length;++i){var item=range.Points[i];if(item.X<left||item.X>right)continue;var index=parseInt(this.GetXData(item.X));var kItem=this.GetKItem(index,option);if(kItem){//var text=IFrameSplitOperator.FormatDateString(kItem.Date,null);
|
|
@@ -7940,9 +7941,9 @@ var touches=this.GetToucheData(e,this.IsForceLandscape);var pt=this.PointAbsolut
|
|
|
7940
7941
|
{var pt=self.PointAbsoluteToRelative(drag.Click.X,drag.Click.Y,true);var x=pt.X;var y=pt.Y;self.OnMouseMove(x,y,e);}};if(this.ChartDrawOption.IsLockScreen){this.MouseDrag=drag;if(this.SelectChartDrawPicture)this.SelectChartDrawPicture.IsSelected=false;this.SelectChartDrawPicture=null;if(this.CurrentChartDrawPicture)//画图工具模式
|
|
7941
7942
|
{var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==2)this.SetChartDrawPictureThirdPoint(drag.Click.X,drag.Click.Y,true);else{this.SetChartDrawPictureFirstPoint(drag.Click.X,drag.Click.Y,true);//只有1个点 直接完成
|
|
7942
7943
|
if(this.FinishChartDrawPicturePoint())this.DrawDynamicInfo({Corss:false,Tooltip:false});}if(e.cancelable)e.preventDefault();return;}else{var drawPictrueData={};var pixelTatio=GetDevicePixelRatio();//鼠标移动坐标是原始坐标 需要乘以放大倍速
|
|
7943
|
-
drawPictrueData.X=touches[0].clientX-uielement.getBoundingClientRect().left;drawPictrueData.Y=touches[0].clientY-uielement.getBoundingClientRect().top;if(this.GetChartDrawPictureByPoint(drawPictrueData)){
|
|
7944
|
+
drawPictrueData.X=touches[0].clientX-uielement.getBoundingClientRect().left;drawPictrueData.Y=touches[0].clientY-uielement.getBoundingClientRect().top;if(this.GetChartDrawPictureByPoint(drawPictrueData)){drawPictrueData.ChartDrawPicture.Status=20;drawPictrueData.ChartDrawPicture.ValueToPoint();drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;drawPictrueData.ChartDrawPicture.IsSelected=true;this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE);//选中画图工具事件
|
|
7944
7945
|
if(event&&event.Callback){var sendData={DrawPicture:drawPictrueData.ChartDrawPicture};event.Callback(event,sendData,this);}if(e.cancelable)e.preventDefault();return;}}}else{if(this.EnableScrollUpDown==true){this.DragTimer=setTimeout(function(){self.IsPress=true;if(drag.Click.X==drag.LastMove.X&&drag.Click.Y==drag.LastMove.Y){var mouseDrag=self.MouseDrag;self.MouseDrag=null;T_ShowCorssCursor();self.PreventTouchEvent(e);}},800);}this.MouseDrag=drag;this.PhoneTouchInfo={Start:{X:touches[0].clientX,Y:touches[0].clientY},End:{X:touches[0].clientX,Y:touches[0].clientY}};this.SelectChartDrawPicture=null;if(this.EnableScrollUpDown==false)T_ShowCorssCursor();//移动十字光标
|
|
7945
|
-
else if(this.IsClickShowCorssCursor)T_ShowCorssCursor();}if(this.EnableZoomIndexWindow){this.PhoneDBClick.AddTouchStart(touches[0].clientX,touches[0].clientY,Date.now());JSConsole.Chart.Log("[MinuteChartContainer::OnTouchStart] PhoneDBClick ",this.PhoneDBClick);}this.TouchEvent({EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH,FunctionName:"OnTouchStart"},e);}else if(this.IsPhonePinching(e)){var phonePinch={"Start":{},"Last":{}};var touches=this.GetToucheData(e,this.IsForceLandscape);phonePinch.Start={"X":touches[0].pageX,"Y":touches[0].pageY,"X2":touches[1].pageX,"Y2":touches[1].pageY};phonePinch.Last={"X":touches[0].pageX,"Y":touches[0].pageY,"X2":touches[1].pageX,"Y2":touches[1].pageY};this.PhonePinch=phonePinch;this.SelectChartDrawPicture=null;}};this.OnTouchMove=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var touches=this.GetToucheData(e,this.IsForceLandscape);if(this.IsPhoneDragging(e)){var drag=this.MouseDrag;if(drag==null){var pixelTatio=GetDevicePixelRatio();var x=touches[0].clientX-uielement.getBoundingClientRect().left*pixelTatio;var y=touches[0].clientY-uielement.getBoundingClientRect().top*pixelTatio;this.OnMouseMove(x,y,e);}else{var moveAngle=this.GetMoveAngle(drag.LastMove,{X:touches[0].clientX,Y:touches[0].clientY});var moveSetp=Math.abs(drag.LastMove.X-touches[0].clientX);var moveUpDown=Math.abs(drag.LastMove.Y-touches[0].clientY);moveSetp=parseInt(moveSetp);if(this.CurrentChartDrawPicture){var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==1||drawPicture.Status==2){if(moveSetp<5&&moveUpDown<5)return;if(this.SetChartDrawPictureSecondPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==3){if(this.SetChartDrawPictureThirdPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==20)//画图工具移动
|
|
7946
|
+
else if(this.IsClickShowCorssCursor)T_ShowCorssCursor();}if(this.EnableZoomIndexWindow){this.PhoneDBClick.AddTouchStart(touches[0].clientX,touches[0].clientY,Date.now());JSConsole.Chart.Log("[MinuteChartContainer::OnTouchStart] PhoneDBClick ",this.PhoneDBClick);}this.TouchEvent({EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH,FunctionName:"OnTouchStart"},e);}else if(this.IsPhonePinching(e)){var phonePinch={"Start":{},"Last":{}};var touches=this.GetToucheData(e,this.IsForceLandscape);phonePinch.Start={"X":touches[0].pageX,"Y":touches[0].pageY,"X2":touches[1].pageX,"Y2":touches[1].pageY};phonePinch.Last={"X":touches[0].pageX,"Y":touches[0].pageY,"X2":touches[1].pageX,"Y2":touches[1].pageY};this.PhonePinch=phonePinch;this.SelectChartDrawPicture=null;}};this.OnTouchMove=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var touches=this.GetToucheData(e,this.IsForceLandscape);if(this.IsPhoneDragging(e)){var drag=this.MouseDrag;if(drag==null){var pixelTatio=GetDevicePixelRatio();var x=touches[0].clientX-uielement.getBoundingClientRect().left*pixelTatio;var y=touches[0].clientY-uielement.getBoundingClientRect().top*pixelTatio;this.OnMouseMove(x,y,e);}else{var moveAngle=this.GetMoveAngle(drag.LastMove,{X:touches[0].clientX,Y:touches[0].clientY});var moveSetp=Math.abs(drag.LastMove.X-touches[0].clientX);var moveUpDown=Math.abs(drag.LastMove.Y-touches[0].clientY);moveSetp=parseInt(moveSetp);if(this.CurrentChartDrawPicture&&this.CurrentChartDrawPicture.EnableMove===true){var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==1||drawPicture.Status==2){if(moveSetp<5&&moveUpDown<5)return;if(this.SetChartDrawPictureSecondPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==3){if(this.SetChartDrawPictureThirdPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==20)//画图工具移动
|
|
7946
7947
|
{if(moveSetp<5&&moveUpDown<5)return;if(this.MoveChartDrawPicture(touches[0].clientX-drag.LastMove.X,touches[0].clientY-drag.LastMove.Y,true)){this.DrawDynamicInfo();}}drag.LastMove.X=touches[0].clientX;drag.LastMove.Y=touches[0].clientY;}else{//上下滚动
|
|
7947
7948
|
if((moveUpDown>0&&moveSetp<=3||moveAngle<=this.TouchMoveMinAngle)&&this.EnableScrollUpDown==true){this.StopDragTimer();return;}this.PreventTouchEvent(e);this.MouseDrag=null;var pixelTatio=GetDevicePixelRatio();var x=touches[0].clientX-uielement.getBoundingClientRect().left*pixelTatio;var y=touches[0].clientY-uielement.getBoundingClientRect().top*pixelTatio;this.OnMouseMove(x,y,e);}}if(this.PhoneTouchInfo){this.PhoneTouchInfo.End.X=touches[0].clientX;this.PhoneTouchInfo.End.Y=touches[0].clientY;}}else if(this.IsPhonePinching(e)){this.PreventTouchEvent(e);var phonePinch=this.PhonePinch;if(!phonePinch)return;var yHeight=Math.abs(touches[0].pageY-touches[1].pageY);var yLastHeight=Math.abs(phonePinch.Last.Y-phonePinch.Last.Y2);var yStep=yHeight-yLastHeight;var xHeight=Math.abs(touches[0].pageX-touches[1].pageX);var xLastHeight=Math.abs(phonePinch.Last.X-phonePinch.Last.X2);var xStep=xHeight-xLastHeight;var minStep=this.ZoomStepPixel;if(Math.abs(xStep)>minStep){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MINUTE_TOUCH_ZOOM);if(event&&event.Callback){var data={XStep:xStep,YStep:yStep,PreventDefault:false};event.Callback(event,data,this);if(data.PreventDefault){this.PhonePinch=null;this.StopDragTimer();return;}}}phonePinch.Last={"X":touches[0].pageX,"Y":touches[0].pageY,"X2":touches[1].pageX,"Y2":touches[1].pageY};}if(this.EnableScrollUpDown==false){e.preventDefault();}else{if(drag==null){this.PreventTouchEvent(e);//十字光标出来了,阻止消息
|
|
7948
7949
|
}else{this.StopDragTimer();//上下推动图片,停止定时器,消息传递下去
|
|
@@ -13684,7 +13685,8 @@ JSPopMenu.SEPARATOR_LINE_NAME="MENU_SEPARATOR";//分割线
|
|
|
13684
13685
|
*/var JS_DRAWTOOL_MENU_ID={CMD_SELECTED_ID:1,CMD_CHANGE_LINE_COLOR_ID:2,CMD_DELETE_ALL_DRAW_CHART_ID:3,CMD_ERASE_DRAW_CHART_ID:4,CMD_ENABLE_MAGNET_ID:5,//画图工具磁体功能
|
|
13685
13686
|
CMD_DELETE_DRAW_CHART_ID:6,CMD_CHANGE_FONT_COLOR_ID:7,//切换字体颜色
|
|
13686
13687
|
CMD_CHANGE_BG_COLOR_ID:8,//切换背景色
|
|
13687
|
-
CMD_CHANGE_BORDER_COLOR_ID:9
|
|
13688
|
+
CMD_CHANGE_BORDER_COLOR_ID:9,//边框颜色
|
|
13689
|
+
CMD_LOCK_DRAW_CHART_ID:10//上锁
|
|
13688
13690
|
};function JSDialogDrawTool(){this.AryChartGroup=[{Title:"线段",AryChart:[{Title:'线段',ClassName:'hqchart_drawtool icon-draw_line',Type:0,Data:{ID:"线段"}},{Title:'线段信息',ClassName:'hqchart_drawtool icon-infoline',Type:0,Data:{ID:"InfoLine"}},{Title:'射线',ClassName:'hqchart_drawtool icon-draw_rays',Type:0,Data:{ID:"射线"}},{Title:"趋势线角度",ClassName:"hqchart_drawtool icon-qushixianjiaodu",Type:0,Data:{ID:"TrendAngle"}},{Title:'标价线',ClassName:'hqchart_drawtool icon-price_line',Type:0,Data:{ID:"标价线"}},{Title:'垂直线',ClassName:'hqchart_drawtool icon-vertical_line',Type:0,Data:{ID:"垂直线"}},{Title:'十字线',ClassName:'hqchart_drawtool icon-tubiao_shizixian',Type:0,Data:{ID:"十字线"}},{Title:'箭头',ClassName:'hqchart_drawtool icon-bottom-arrow-solid',Type:0,Data:{ID:"箭头"}},{Title:'大箭头',ClassName:'hqchart_drawtool icon-big_arrow',Type:0,Data:{ID:"ArrowMarker"}},{Title:'趋势线',ClassName:'hqchart_drawtool icon-draw_trendline',Type:0,Data:{ID:"趋势线"}},{Title:'水平线',ClassName:'hqchart_drawtool icon-draw_hline',Type:0,Data:{ID:"水平线"}},{Title:'水平射线',ClassName:'hqchart_drawtool icon-tubiao_shuipingshexian',Type:0,Data:{ID:"水平射线"}},{Title:'涂鸦线段',ClassName:'hqchart_drawtool icon-draw_line',Type:0,Data:{ID:"涂鸦线段"}},{Title:'阻速线',ClassName:'hqchart_drawtool icon-draw_resline',Type:0,Data:{ID:"阻速线"}},{Title:'通达信阻速线',ClassName:'hqchart_drawtool icon-draw_resline',Type:0,Data:{ID:"阻速线2"}},{Title:'江恩角度线',ClassName:'hqchart_drawtool icon-jiangenjiaoduxian',Type:0,Data:{ID:"江恩角度线"}},{Title:'通达信江恩角度线',ClassName:'hqchart_drawtool icon-jiangenjiaoduxian',Type:0,Data:{ID:"江恩角度线2"}}]},{Title:"通道",AryChart:[{Title:'平行线',ClassName:'hqchart_drawtool icon-draw_parallel_lines',Type:0,Data:{ID:"平行线"}},{Title:'水平线段',ClassName:'hqchart_drawtool icon-draw_hlinesegment',Type:0,Data:{ID:"水平线段"}},{Title:'平行射线',ClassName:'hqchart_drawtool icon-draw_p_rays_lines',Type:0,Data:{ID:"平行射线"}},{Title:'平行通道',ClassName:'hqchart_drawtool icon-draw_parallelchannel',Type:0,Data:{ID:"平行通道"}},{Title:'价格通道线',ClassName:'hqchart_drawtool icon-draw_pricechannel',Type:0,Data:{ID:"价格通道线"}},{Title:'箱型线',ClassName:'hqchart_drawtool icon-draw_box',Type:0,Data:{ID:"箱型线"}},{Title:"不相交通道",ClassName:"hqchart_drawtool icon-buxiangjiaojiao",Type:0,Data:{ID:"DisjointChannel"}},{Title:"平滑顶/底",ClassName:"hqchart_drawtool icon-tubiao_buxiangjiaotongdao",Type:0,Data:{ID:"FlatTop"}},{Title:"波段线",ClassName:'hqchart_drawtool icon-draw_waveband',Type:0,Data:{ID:"波段线"}},{Title:"百分比线",ClassName:'hqchart_drawtool icon-PercentageLine',Type:0,Data:{ID:"百分比线"}},{Title:"黄金分割",ClassName:'hqchart_drawtool icon-GoldenSection',Type:0,Data:{ID:"黄金分割"}},{Title:"线形回归线",ClassName:'hqchart_drawtool icon-linear_3',Type:0,Data:{ID:"线形回归线"}},{Title:"线形回归带",ClassName:'hqchart_drawtool icon-linear_1',Type:0,Data:{ID:"线形回归带"}},{Title:"延长线形回归带",ClassName:'hqchart_drawtool icon-linear_2',Type:0,Data:{ID:"延长线形回归带"}}]},{Title:"形状",AryChart:[{Title:'圆弧线',ClassName:'hqchart_drawtool icon-draw_arc',Type:0,Data:{ID:"圆弧线"}},{Title:'矩形',ClassName:'hqchart_drawtool icon-rectangle',Type:0,Data:{ID:"矩形"}},{Title:'平行四边形',ClassName:'hqchart_drawtool icon-draw_quadrangle',Type:0,Data:{ID:"平行四边形"}},{Title:'三角形',ClassName:'hqchart_drawtool icon-draw_triangle',Type:0,Data:{ID:"三角形"}},{Title:'圆',ClassName:'hqchart_drawtool icon-draw_circle',Type:0,Data:{ID:"圆"}},{Title:'对称角度',ClassName:'hqchart_drawtool icon-draw_symangle',Type:0,Data:{ID:"对称角度"}}]},{Title:"波浪线",AryChart:[{Title:'M头W底',ClassName:'hqchart_drawtool icon-draw_wavemw',Type:0,Data:{ID:"M头W底"}},{Title:'头肩型',ClassName:'hqchart_drawtool icon-draw_head_shoulders_bt',Type:0,Data:{ID:"头肩型"}},{Title:'波浪尺',ClassName:'hqchart_drawtool icon-waveruler',Type:0,Data:{ID:"波浪尺"}},{Title:'AB波浪尺',ClassName:'hqchart_drawtool icon-waveruler',Type:0,Data:{ID:"AB波浪尺"}}]},{Title:"斐波那契",AryChart:[{Title:'斐波那契周期线',ClassName:'hqchart_drawtool icon-feibonaqizhouqixian',Type:0,Data:{ID:"斐波那契周期线"}},{Title:'斐波那契楔形',ClassName:'hqchart_drawtool icon-feibonaqiqixing',Type:0,Data:{ID:"FibWedge"}},{Title:'斐波那契回撤',ClassName:'hqchart_drawtool icon-feibonaqihuiche',Type:0,Data:{ID:"FibRetracement"}},{Title:'斐波那契速度阻力扇',ClassName:'hqchart_drawtool icon-feibonaqisuduzulishan',Type:0,Data:{ID:"FibSpeedResistanceFan"}}]},{Title:"测量工具",AryChart:[{Title:'价格范围',ClassName:'hqchart_drawtool icon-shijianfanwei',Type:0,Data:{ID:"PriceRange"}},{Title:'时间范围',ClassName:'hqchart_drawtool icon-jiagefanwei',Type:0,Data:{ID:"DateRange"}},{Title:"价格和时间范围",ClassName:"hqchart_drawtool icon-jiagefanwei",Type:0,Data:{ID:"DatePriceRange"}},{Title:"监测线",ClassName:"hqchart_drawtool icon-jiance",Type:0,Data:{ID:"MonitorLine"}}]},{Title:"文字",AryChart:[{Title:"文字",ClassName:'hqchart_drawtool icon-draw_text',Type:0,Data:{ID:"文本"}},{Title:"锚点文字",ClassName:'hqchart_drawtool icon-maodianwenzi',Type:0,Data:{ID:"AnchoredText"}},{Title:"注释",ClassName:'hqchart_drawtool icon-maodian ',Type:0,Data:{ID:"Note"}},{Title:'价格标签',ClassName:'hqchart_drawtool icon-Tooltip',Type:0,Data:{ID:"PriceLabel"}},{Title:'价格注释',ClassName:'hqchart_drawtool icon-tooltiptext',Type:0,Data:{ID:"PriceNote"}},{Title:'向上箭头',ClassName:'iconfont icon-arrow_up',Type:0,Data:{ID:"icon-arrow_up"}},{Title:'向下箭头',ClassName:'iconfont icon-arrow_down',Type:0,Data:{ID:"icon-arrow_down"}},{Title:'向左箭头',ClassName:'iconfont icon-arrow_left',Type:0,Data:{ID:"icon-arrow_left"}},{Title:'向右箭头',ClassName:'iconfont icon-arrow_right',Type:0,Data:{ID:"icon-arrow_right"}}]}];this.ToolConfig={Title:"工具",AryTool:[{Title:"选中",ClassName:'hqchart_drawtool icon-arrow',Type:1,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_SELECTED_ID}},{Title:'尺子',ClassName:'hqchart_drawtool icon-ruler',Type:0,Data:{ID:"尺子"}},{Title:"磁铁",ClassName:'hqchart_drawtool icon-xifu',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_ENABLE_MAGNET_ID}},{Title:"点击切换颜色",ClassName:'hqchart_drawtool icon-fangkuai',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID}},{Title:"擦除画线",ClassName:'hqchart_drawtool icon-a-xiangpicachuxiangpica',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_ERASE_DRAW_CHART_ID}},{Title:"删除所有画线",ClassName:'hqchart_drawtool icon-recycle_bin',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_ALL_DRAW_CHART_ID}}]};this.DivDialog=null;this.AryDivChart=[];this.HQChart=null;this.LineColor='rgb(255,140,0)';this.LineColorIndex=0;this.RandomLineColor=["rgb(255,69,0)","rgb(0,191,255)","rgb(255,0,255)","rgb(255,105,180)"];this.LineWidth=1*GetDevicePixelRatio();this.ColumnCount=5;this.DragTitle=null;this.Inital=function(hqchart){this.LineColor=g_JSChartResource.DrawPicture.LineColor[0];this.RandomLineColor.splice(0,0,this.LineColor);this.HQChart=hqchart;};this.Create=function(){var _this78=this;var divDom=document.createElement("div");divDom.className='UMyChart_DrawTool_Dialog_Div';var divTitle=document.createElement("div");divTitle.className='UMyChart_DrawTool_Title_Div';divTitle.innerText="画图工具";divTitle.onmousedown=function(e){_this78.OnMouseDownTitle(e);};var divClose=document.createElement("div");divClose.className='UMyChart_DrawTool_Close_Div';divClose.innerText="x";divClose.onmousedown=function(e){_this78.Close(e);};divTitle.appendChild(divClose);divDom.appendChild(divTitle);var table=document.createElement("table");table.className="UMyChart_DrawTool_Table";divDom.appendChild(table);var tbody=document.createElement("tbody");tbody.className="UMyChart_DrawTool_Tbody";table.appendChild(tbody);for(var i=0;i<this.AryChartGroup.length;++i){var item=this.AryChartGroup[i];if(!IFrameSplitOperator.IsNonEmptyArray(item.AryChart))continue;this.CreateChartGroupItem(item,tbody);var trDom=document.createElement("tr");trDom.className='UMyChart_DrawTool_Group_End_Tr';tbody.appendChild(trDom);}//工具栏
|
|
13689
13691
|
this.CreateToolGroup(tbody);this.DivDialog=divDom;document.body.appendChild(divDom);};this.Destroy=function(){this.AryDivChart=[];if(this.DivDialog)document.body.removeChild(this.DivDialog);this.DivDialog=null;};this.CreateChartGroupItem=function(groupItem,tbody){var trDom=document.createElement("tr");trDom.className='UMyChart_DrawTool_Group_Tr';tbody.appendChild(trDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_DrawTool_Group_Td";tdDom.innerText=groupItem.Title;tdDom.colSpan=this.ColumnCount;trDom.appendChild(tdDom);var chartCount=groupItem.AryChart.length;for(var i=0,j=0;i<chartCount;){var trDom=document.createElement("tr");trDom.className='UMyChart_DrawTool_Tr';for(j=0;j<this.ColumnCount&&i<chartCount;++j,++i){var item=groupItem.AryChart[i];this.CreateChartItem(item,trDom);}tbody.appendChild(trDom);}};this.CreateChartItem=function(item,trDom){var _this79=this;var tdDom=document.createElement("td");tdDom.className="UMyChart_DrawTool_Td";tdDom.title=item.Title;trDom.appendChild(tdDom);var spanDom=document.createElement("span");spanDom.className=item.ClassName;spanDom.classList.add("UMyChart_DrawTool_Span");tdDom.appendChild(spanDom);var data={Item:item,TD:tdDom,Span:spanDom};tdDom.onmousedown=function(e){_this79.OnClickItem(e,data);};//点击
|
|
13690
13692
|
this.AryDivChart.push(data);};this.OnClickItem=function(e,data){console.log('[JSDialogDrawTool::OnClickChartItem] ',data);if(!data.Item||!data.Item.Data)return;var type=data.Item.Type;var id=data.Item.Data.ID;if(type==2&&id==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID){this.OnChangeLineColor(data);}else if(type==2&&id==JS_DRAWTOOL_MENU_ID.CMD_DELETE_ALL_DRAW_CHART_ID){this.DeleteAllChart();}else if(type==2&&id==JS_DRAWTOOL_MENU_ID.CMD_ERASE_DRAW_CHART_ID){this.ClearAllSelectedChart();this.ClearCurrnetDrawPicture();this.EnableEraseChart(true);}else if(type==1&&id==JS_DRAWTOOL_MENU_ID.CMD_SELECTED_ID){this.ClearAllSelectedChart();this.ClearCurrnetDrawPicture();this.EnableEraseChart(false);}else if(type==2&&id==JS_DRAWTOOL_MENU_ID.CMD_ENABLE_MAGNET_ID){this.ChangeMagnet(data);}else if(type==0){this.ClearAllSelectedChart();this.EnableEraseChart(false);data.Span.classList.remove("UMyChart_DrawTool_Span");data.Span.classList.add("UMyChart_DrawTool_Span_Selected");this.CreateDrawPicture(data);}};//清空选中状态
|
|
@@ -13702,18 +13704,18 @@ var x=labelInfo.AryPoint[1].X-labelInfo.AryPoint[0].X;var y=labelInfo.AryPoint[1
|
|
|
13702
13704
|
//
|
|
13703
13705
|
////////////////////////////////////////////////////////////////////////////////////
|
|
13704
13706
|
function JSDialogModifyDraw(){this.DivDialog=null;this.HQChart;this.ChartPicture;//按钮
|
|
13705
|
-
this.ColorButton=null;this.BGColorButton=null;this.FontColorButton=null;this.BorderColorButton=null;this.RandomLineColor=["rgb(255,69,0)","rgb(173,255,47)","rgb(238,154,73)","rgb(255,105,180)"];//线段颜色
|
|
13707
|
+
this.ColorButton=null;this.BGColorButton=null;this.FontColorButton=null;this.BorderColorButton=null;this.LockButton=null;this.RandomLineColor=["rgb(255,69,0)","rgb(173,255,47)","rgb(238,154,73)","rgb(255,105,180)"];//线段颜色
|
|
13706
13708
|
this.RandomBGColor=["rgba(210,251,209,0.8)","rgb(217,217,253)","rgb(255,208,204)","rgb(252,249,206)"];//背景颜色
|
|
13707
13709
|
this.RandomFontColor=["rgb(0,0,0)","rgb(255, 0, 0)","rgb(20, 255, 0)","rgb(255, 0, 255)"];//文字颜色
|
|
13708
13710
|
this.RandomBorderColor=["rgb(0,0,0)","rgb(5, 246, 143)","rgb(139, 137, 137)","rgb(255, 20, 147)"];//边框颜色
|
|
13709
|
-
this.AryButton=[{Title:"修改线段颜色",ClassName:'hqchart_drawtool icon-huabi',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID}},{Title:"修改字体颜色",ClassName:'hqchart_drawtool icon-zitiyanse',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID}},{Title:"修改背景颜色",ClassName:'hqchart_drawtool icon-zitibeijingse',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID}},{Title:"修改边框颜色",ClassName:'hqchart_drawtool icon-biankuang',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID}},{Title:"删除图形",ClassName:'hqchart_drawtool icon-recycle_bin',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID}}];this.Inital=function(hqchart){this.HQChart=hqchart;};this.Destroy=function(){this.ChartPicture=null;this.ColorButton=null;if(this.DivDialog){document.body.remove(this.DivDialog);this.DivDialog=null;}};this.Create=function(){var _this83=this;var divDom=document.createElement("div");divDom.className='UMyChart_Draw_Modify_Dialog_Div';var drgDiv=document.createElement("div");drgDiv.className="UMyChart_Draw_Modify_Dialog_Drag_Div";drgDiv.onmousedown=function(e){_this83.OnMouseDownTitle(e);};divDom.appendChild(drgDiv);var spanDom=document.createElement("span");spanDom.className="hqchart_drawtool icon-tuodong";spanDom.classList.add("UMyChart_DrawTool_Span");drgDiv.appendChild(spanDom);for(var i=0;i<this.AryButton.length;++i){var item=this.AryButton[i];this.CreateButtonItem(item,divDom);}this.DivDialog=divDom;document.body.appendChild(divDom);};this.CreateButtonItem=function(item,parentDivDom){var _this84=this;var divItem=document.createElement("div");divItem.className="UMyChart_Draw_Modify_Dialog_Button_Div";var spanTooltip=document.createElement("span");spanTooltip.className="UMyChart_Draw_Modify_Tooltip";spanTooltip.innerText=item.Title;divItem.appendChild(spanTooltip);var spanDom=document.createElement("span");spanDom.className=item.ClassName;spanDom.classList.add("UMyChart_DrawTool_Span");divItem.appendChild(spanDom);var data={Div:divItem,Span:spanDom,Parent:parentDivDom,Item:item,Tooltip:spanTooltip};divItem.onmousedown=function(e){_this84.OnClickButton(e,data);};//点击
|
|
13710
|
-
divItem.onmouseover=function(e){_this84.OnHoverButton(e,data);};divItem.onmouseout=function(e){_this84.OnLeaveButton(e,data);};switch(item.Data.ID){case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID:this.ColorButton=data;break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID:this.BGColorButton=data;divItem.style.display="none";break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID:this.FontColorButton=data;divItem.style.display="none";break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID:this.BorderColorButton=data;divItem.style.display="none";break;}parentDivDom.appendChild(divItem);};this.OnClickButton=function(e,data){console.log('[JSDialogModifyDraw::OnClickButton] ',data);if(!data.Item||!data.Item.Data)return;var id=data.Item.Data.ID;switch(id){case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID:this.ModifyLineColor();break;case JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID:this.DeleteDrawPicture();break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID:this.ModifyBGColor();break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID:this.ModifyFontColor();break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID:this.ModifyBorderColor();break;}};this.OnHoverButton=function(e,data){//var x=e.clientX;
|
|
13711
|
+
this.AryButton=[{Title:"修改线段颜色",ClassName:'hqchart_drawtool icon-huabi',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID}},{Title:"修改字体颜色",ClassName:'hqchart_drawtool icon-zitiyanse',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID}},{Title:"修改背景颜色",ClassName:'hqchart_drawtool icon-zitibeijingse',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID}},{Title:"修改边框颜色",ClassName:'hqchart_drawtool icon-biankuang',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID}},{Title:"上锁",ClassName:'hqchart_drawtool icon-lock',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID}},{Title:"删除图形",ClassName:'hqchart_drawtool icon-recycle_bin',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID}}];this.Inital=function(hqchart){this.HQChart=hqchart;};this.Destroy=function(){this.ChartPicture=null;this.ColorButton=null;if(this.DivDialog){document.body.remove(this.DivDialog);this.DivDialog=null;}};this.Create=function(){var _this83=this;var divDom=document.createElement("div");divDom.className='UMyChart_Draw_Modify_Dialog_Div';var drgDiv=document.createElement("div");drgDiv.className="UMyChart_Draw_Modify_Dialog_Drag_Div";drgDiv.onmousedown=function(e){_this83.OnMouseDownTitle(e);};divDom.appendChild(drgDiv);var spanDom=document.createElement("span");spanDom.className="hqchart_drawtool icon-tuodong";spanDom.classList.add("UMyChart_DrawTool_Span");drgDiv.appendChild(spanDom);for(var i=0;i<this.AryButton.length;++i){var item=this.AryButton[i];this.CreateButtonItem(item,divDom);}this.DivDialog=divDom;document.body.appendChild(divDom);};this.CreateButtonItem=function(item,parentDivDom){var _this84=this;var divItem=document.createElement("div");divItem.className="UMyChart_Draw_Modify_Dialog_Button_Div";var spanTooltip=document.createElement("span");spanTooltip.className="UMyChart_Draw_Modify_Tooltip";spanTooltip.innerText=item.Title;divItem.appendChild(spanTooltip);var spanDom=document.createElement("span");spanDom.className=item.ClassName;spanDom.classList.add("UMyChart_DrawTool_Span");divItem.appendChild(spanDom);var data={Div:divItem,Span:spanDom,Parent:parentDivDom,Item:item,Tooltip:spanTooltip};divItem.onmousedown=function(e){_this84.OnClickButton(e,data);};//点击
|
|
13712
|
+
divItem.onmouseover=function(e){_this84.OnHoverButton(e,data);};divItem.onmouseout=function(e){_this84.OnLeaveButton(e,data);};switch(item.Data.ID){case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID:this.ColorButton=data;break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID:this.BGColorButton=data;divItem.style.display="none";break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID:this.FontColorButton=data;divItem.style.display="none";break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID:this.BorderColorButton=data;divItem.style.display="none";break;case JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID:this.LockButton=data;this.LockButton.Span.style['color']="rgb(220,220,220)";break;}parentDivDom.appendChild(divItem);};this.OnClickButton=function(e,data){console.log('[JSDialogModifyDraw::OnClickButton] ',data);if(!data.Item||!data.Item.Data)return;var id=data.Item.Data.ID;switch(id){case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID:this.ModifyLineColor();break;case JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID:this.DeleteDrawPicture();break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID:this.ModifyBGColor();break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID:this.ModifyFontColor();break;case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID:this.ModifyBorderColor();break;case JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID:this.ModifyLockChart();break;}};this.OnHoverButton=function(e,data){//var x=e.clientX;
|
|
13711
13713
|
//data.Tooltip.style.left=x+"px";
|
|
13712
13714
|
data.Tooltip.style.display="inline";};this.OnLeaveButton=function(e,data){data.Tooltip.style.display="none";};this.Close=function(e){if(!this.DivDialog)return;this.ChartPicture=null;this.DivDialog.style.visibility='hidden';};this.IsShow=function(){if(!this.DivDialog)return false;return this.DivDialog.style.visibility==='visible';};this.DeleteDrawPicture=function(){if(this.ChartPicture&&this.HQChart){this.HQChart.ClearChartDrawPicture(this.ChartPicture);}this.Close();};this.ShowButton=function(dom,diaplay){if(dom.style.display==diaplay)return;dom.style.display=diaplay;};this.GetRandomColor=function(currentColor,randomLineColor){var colorIndex=0;for(var i=0;i<randomLineColor.length;++i){if(currentColor==randomLineColor[i]){colorIndex=i+1;break;}}colorIndex=colorIndex%randomLineColor.length;var color=randomLineColor[colorIndex];return color;};this.ModifyLineColor=function(){if(!this.ChartPicture||!this.HQChart)return;var color=this.GetRandomColor(this.ChartPicture.LineColor,this.RandomLineColor);this.ChartPicture.LineColor=color;this.ChartPicture.PointColor=color;if(this.ColorButton)this.ColorButton.Span.style['color']=color;if(this.HQChart.ChartDrawStorage)this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture);//保存下
|
|
13713
13715
|
this.HQChart.Draw();};this.ModifyFontColor=function(){if(!this.ChartPicture||!this.HQChart)return;if(this.ChartPicture.ClassName=="ChartDrawNote"){var color=this.GetRandomColor(this.ChartPicture.NoteTextColor,this.RandomFontColor);this.ChartPicture.NoteTextColor=color;}else{var color=this.GetRandomColor(this.ChartPicture.TextColor,this.RandomFontColor);this.ChartPicture.TextColor=color;}if(this.FontColorButton)this.FontColorButton.Span.style['color']=color;if(this.HQChart.ChartDrawStorage)this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture);//保存下
|
|
13714
13716
|
this.HQChart.Draw();};this.ModifyBGColor=function(){if(!this.ChartPicture||!this.HQChart)return;if(this.ChartPicture.ClassName=="ChartDrawNote"){var color=this.GetRandomColor(this.ChartPicture.NoteBGColor,this.RandomBGColor);this.ChartPicture.NoteBGColor=color;}else{var color=this.GetRandomColor(this.ChartPicture.BGColor,this.RandomBGColor);this.ChartPicture.BGColor=color;}if(this.BGColorButton)this.BGColorButton.Span.style['color']=color;if(this.HQChart.ChartDrawStorage)this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture);//保存下
|
|
13715
|
-
this.HQChart.Draw();};this.ModifyBorderColor=function(){if(!this.ChartPicture||!this.HQChart)return;if(this.ChartPicture.ClassName=="ChartDrawNote"){var color=this.GetRandomColor(this.ChartPicture.NoteBorderColor,this.RandomBorderColor);this.ChartPicture.NoteBorderColor=color;}else{var color=this.GetRandomColor(this.ChartPicture.BorderColor,this.RandomBorderColor);this.ChartPicture.BorderColor=color;}if(this.BorderColorButton)this.BorderColorButton.Span.style['color']=color;if(this.HQChart.ChartDrawStorage)this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture);//保存下
|
|
13716
|
-
this.HQChart.Draw();};this.Show=function(x,y){if(!this.DivDialog)this.Create();this.DivDialog.style.visibility='visible';this.DivDialog.style.top=y+"px";this.DivDialog.style.left=x+"px";};this.SetChartPicture=function(chart){this.ChartPicture=chart;var bShowLineColor=true,bShowBGColor=false,bShowFontColor=false,bShowBorderColor=false;var bgColor=null,fontColor=null,borderColor=null;var ARRAY_TEXT_CHART=['ChartDrawPriceLabel',"ChartDrawAnchoredText","ChartDrawPriceNote"];if(ARRAY_TEXT_CHART.includes(chart.ClassName)){bShowBGColor=true;bShowFontColor=true;bShowBorderColor=true;bgColor=chart.BGColor;fontColor=chart.TextColor;borderColor=chart.BorderColor;}else if(chart.ClassName=="ChartDrawNote"){bShowBGColor=true;bShowFontColor=true;bShowBorderColor=true;bgColor=chart.NoteBGColor;fontColor=chart.NoteTextColor;borderColor=chart.NoteBorderColor;}if(this.ColorButton){var item=this.ColorButton;this.ShowButton(item.Div,bShowLineColor?"inline":"none");if(bShowLineColor){item.Span.style['color']=chart.LineColor;}}if(this.BGColorButton){var item=this.BGColorButton;this.ShowButton(item.Div,bShowBGColor?"inline":"none");if(bShowBGColor){item.Span.style['color']=bgColor;}}if(this.FontColorButton){var item=this.FontColorButton;this.ShowButton(item.Div,bShowFontColor?"inline":"none");if(bShowFontColor){item.Span.style['color']=fontColor;}}if(this.BorderColorButton){var item=this.BorderColorButton;this.ShowButton(item.Div,bShowBorderColor?"inline":"none");if(bShowBorderColor){item.Span.style['color']=borderColor;}}};this.OnMouseDownTitle=function(e){var _this85=this;if(!this.DivDialog)return;var dragData={X:e.clientX,Y:e.clientY};dragData.YOffset=e.clientX-this.DivDialog.offsetLeft;dragData.XOffset=e.clientY-this.DivDialog.offsetTop;this.DragTitle=dragData;document.onmousemove=function(e){_this85.DocOnMouseMoveTitle(e);};document.onmouseup=function(e){_this85.DocOnMouseUpTitle(e);};};this.DocOnMouseMoveTitle=function(e){if(!this.DragTitle)return;var left=e.clientX-this.DragTitle.YOffset;var top=e.clientY-this.DragTitle.XOffset;var right=left+this.DivDialog.offsetWidth;var bottom=top+this.DivDialog.offsetHeight;if(right+5>=window.innerWidth)left=window.innerWidth-this.DivDialog.offsetWidth-5;if(bottom+5>=window.innerHeight)top=window.innerHeight-this.DivDialog.offsetHeight-5;this.DivDialog.style.left=left+'px';this.DivDialog.style.top=top+'px';if(e.preventDefault)e.preventDefault();if(e.stopPropagation)e.stopPropagation();};this.DocOnMouseUpTitle=function(e){this.DragTitle=null;this.onmousemove=null;this.onmouseup=null;};}/*
|
|
13717
|
+
this.HQChart.Draw();};this.ModifyLockChart=function(){if(!this.ChartPicture||!this.HQChart)return;this.ChartPicture.EnableMove=!this.ChartPicture.EnableMove;if(this.LockButton)this.LockButton.Span.style['color']=this.ChartPicture.EnableMove?"rgb(220,220,220)":"rgb(0,0,0)";};this.ModifyBorderColor=function(){if(!this.ChartPicture||!this.HQChart)return;if(this.ChartPicture.ClassName=="ChartDrawNote"){var color=this.GetRandomColor(this.ChartPicture.NoteBorderColor,this.RandomBorderColor);this.ChartPicture.NoteBorderColor=color;}else{var color=this.GetRandomColor(this.ChartPicture.BorderColor,this.RandomBorderColor);this.ChartPicture.BorderColor=color;}if(this.BorderColorButton)this.BorderColorButton.Span.style['color']=color;if(this.HQChart.ChartDrawStorage)this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture);//保存下
|
|
13718
|
+
this.HQChart.Draw();};this.Show=function(x,y){if(!this.DivDialog)this.Create();this.DivDialog.style.visibility='visible';this.DivDialog.style.top=y+"px";this.DivDialog.style.left=x+"px";};this.SetChartPicture=function(chart){this.ChartPicture=chart;var bShowLineColor=true,bShowBGColor=false,bShowFontColor=false,bShowBorderColor=false;var bgColor=null,fontColor=null,borderColor=null;var ARRAY_TEXT_CHART=['ChartDrawPriceLabel',"ChartDrawAnchoredText","ChartDrawPriceNote"];if(ARRAY_TEXT_CHART.includes(chart.ClassName)){bShowBGColor=true;bShowFontColor=true;bShowBorderColor=true;bgColor=chart.BGColor;fontColor=chart.TextColor;borderColor=chart.BorderColor;}else if(chart.ClassName=="ChartDrawNote"){bShowBGColor=true;bShowFontColor=true;bShowBorderColor=true;bgColor=chart.NoteBGColor;fontColor=chart.NoteTextColor;borderColor=chart.NoteBorderColor;}if(this.ColorButton){var item=this.ColorButton;this.ShowButton(item.Div,bShowLineColor?"inline":"none");if(bShowLineColor){item.Span.style['color']=chart.LineColor;}}if(this.BGColorButton){var item=this.BGColorButton;this.ShowButton(item.Div,bShowBGColor?"inline":"none");if(bShowBGColor){item.Span.style['color']=bgColor;}}if(this.FontColorButton){var item=this.FontColorButton;this.ShowButton(item.Div,bShowFontColor?"inline":"none");if(bShowFontColor){item.Span.style['color']=fontColor;}}if(this.BorderColorButton){var item=this.BorderColorButton;this.ShowButton(item.Div,bShowBorderColor?"inline":"none");if(bShowBorderColor){item.Span.style['color']=borderColor;}}if(this.LockButton){var item=this.LockButton;item.Span.style['color']=this.ChartPicture.EnableMove?"rgb(220,220,220)":"rgb(0,0,0)";}};this.OnMouseDownTitle=function(e){var _this85=this;if(!this.DivDialog)return;var dragData={X:e.clientX,Y:e.clientY};dragData.YOffset=e.clientX-this.DivDialog.offsetLeft;dragData.XOffset=e.clientY-this.DivDialog.offsetTop;this.DragTitle=dragData;document.onmousemove=function(e){_this85.DocOnMouseMoveTitle(e);};document.onmouseup=function(e){_this85.DocOnMouseUpTitle(e);};};this.DocOnMouseMoveTitle=function(e){if(!this.DragTitle)return;var left=e.clientX-this.DragTitle.YOffset;var top=e.clientY-this.DragTitle.XOffset;var right=left+this.DivDialog.offsetWidth;var bottom=top+this.DivDialog.offsetHeight;if(right+5>=window.innerWidth)left=window.innerWidth-this.DivDialog.offsetWidth-5;if(bottom+5>=window.innerHeight)top=window.innerHeight-this.DivDialog.offsetHeight-5;this.DivDialog.style.left=left+'px';this.DivDialog.style.top=top+'px';if(e.preventDefault)e.preventDefault();if(e.stopPropagation)e.stopPropagation();};this.DocOnMouseUpTitle=function(e){this.DragTitle=null;this.onmousemove=null;this.onmouseup=null;};}/*
|
|
13717
13719
|
Copyright (c) 2018 jones
|
|
13718
13720
|
|
|
13719
13721
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -13778,7 +13780,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
13778
13780
|
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);};}/********************************************************************************
|
|
13779
13781
|
* 版本信息输出
|
|
13780
13782
|
*
|
|
13781
|
-
*/var HQCHART_VERSION="1.1.
|
|
13783
|
+
*/var HQCHART_VERSION="1.1.13739";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();//把给外界调用的方法暴露出来
|
|
13782
13784
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
13783
13785
|
// BaseIndex:BaseIndex,
|
|
13784
13786
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
|
@@ -22,6 +22,8 @@ var JS_DRAWTOOL_MENU_ID=
|
|
|
22
22
|
CMD_CHANGE_FONT_COLOR_ID:7, //切换字体颜色
|
|
23
23
|
CMD_CHANGE_BG_COLOR_ID:8, //切换背景色
|
|
24
24
|
CMD_CHANGE_BORDER_COLOR_ID:9, //边框颜色
|
|
25
|
+
|
|
26
|
+
CMD_LOCK_DRAW_CHART_ID:10, //上锁
|
|
25
27
|
};
|
|
26
28
|
|
|
27
29
|
function JSDialogDrawTool()
|
|
@@ -618,6 +620,7 @@ function JSDialogModifyDraw()
|
|
|
618
620
|
this.BGColorButton=null;
|
|
619
621
|
this.FontColorButton=null;
|
|
620
622
|
this.BorderColorButton=null;
|
|
623
|
+
this.LockButton=null;
|
|
621
624
|
|
|
622
625
|
this.RandomLineColor=["rgb(255,69,0)", "rgb(173,255,47)", "rgb(238,154,73)", "rgb(255,105,180)"]; //线段颜色
|
|
623
626
|
this.RandomBGColor=["rgba(210,251,209,0.8)", "rgb(217,217,253)", "rgb(255,208,204)", "rgb(252,249,206)"]; //背景颜色
|
|
@@ -630,7 +633,9 @@ function JSDialogModifyDraw()
|
|
|
630
633
|
{ Title:"修改字体颜色", ClassName: 'hqchart_drawtool icon-zitiyanse', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID }},
|
|
631
634
|
{ Title:"修改背景颜色", ClassName: 'hqchart_drawtool icon-zitibeijingse', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID }},
|
|
632
635
|
{ Title:"修改边框颜色", ClassName: 'hqchart_drawtool icon-biankuang', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID }},
|
|
633
|
-
{ Title:"
|
|
636
|
+
{ Title:"上锁", ClassName: 'hqchart_drawtool icon-lock', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID }},
|
|
637
|
+
{ Title:"删除图形", ClassName: 'hqchart_drawtool icon-recycle_bin', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID }},
|
|
638
|
+
|
|
634
639
|
];
|
|
635
640
|
|
|
636
641
|
this.Inital=function(hqchart)
|
|
@@ -714,6 +719,10 @@ function JSDialogModifyDraw()
|
|
|
714
719
|
this.BorderColorButton=data;
|
|
715
720
|
divItem.style.display="none";
|
|
716
721
|
break;
|
|
722
|
+
case JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID:
|
|
723
|
+
this.LockButton=data;
|
|
724
|
+
this.LockButton.Span.style['color']="rgb(220,220,220)";
|
|
725
|
+
break;
|
|
717
726
|
|
|
718
727
|
}
|
|
719
728
|
|
|
@@ -743,6 +752,9 @@ function JSDialogModifyDraw()
|
|
|
743
752
|
case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID:
|
|
744
753
|
this.ModifyBorderColor();
|
|
745
754
|
break;
|
|
755
|
+
case JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID:
|
|
756
|
+
this.ModifyLockChart();
|
|
757
|
+
break;
|
|
746
758
|
}
|
|
747
759
|
}
|
|
748
760
|
|
|
@@ -867,6 +879,14 @@ function JSDialogModifyDraw()
|
|
|
867
879
|
this.HQChart.Draw();
|
|
868
880
|
}
|
|
869
881
|
|
|
882
|
+
this.ModifyLockChart=function()
|
|
883
|
+
{
|
|
884
|
+
if (!this.ChartPicture || !this.HQChart) return;
|
|
885
|
+
this.ChartPicture.EnableMove=!this.ChartPicture.EnableMove;
|
|
886
|
+
|
|
887
|
+
if (this.LockButton) this.LockButton.Span.style['color']=this.ChartPicture.EnableMove?"rgb(220,220,220)":"rgb(0,0,0)";
|
|
888
|
+
}
|
|
889
|
+
|
|
870
890
|
this.ModifyBorderColor=function()
|
|
871
891
|
{
|
|
872
892
|
if (!this.ChartPicture || !this.HQChart) return;
|
|
@@ -963,7 +983,12 @@ function JSDialogModifyDraw()
|
|
|
963
983
|
item.Span.style['color']=borderColor;
|
|
964
984
|
}
|
|
965
985
|
}
|
|
966
|
-
|
|
986
|
+
|
|
987
|
+
if (this.LockButton)
|
|
988
|
+
{
|
|
989
|
+
var item=this.LockButton;
|
|
990
|
+
item.Span.style['color']=this.ChartPicture.EnableMove?"rgb(220,220,220)":"rgb(0,0,0)";
|
|
991
|
+
}
|
|
967
992
|
}
|
|
968
993
|
|
|
969
994
|
this.OnMouseDownTitle=function(e)
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -2613,6 +2613,7 @@ var JSCHART_EVENT_ID=
|
|
|
2613
2613
|
ON_CUSTOM_CORSSCURSOR_POSITION:155, //自定义十字光标X轴的输出的位置
|
|
2614
2614
|
|
|
2615
2615
|
ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX:156, //日盘夜盘的分界线
|
|
2616
|
+
ON_CUSTOM_MINUTE_BG:157, //自定义分时图背景颜色
|
|
2616
2617
|
}
|
|
2617
2618
|
|
|
2618
2619
|
var JSCHART_OPERATOR_ID=
|
|
@@ -3638,7 +3639,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3638
3639
|
this.SelectChartDrawPicture=null;
|
|
3639
3640
|
this.ClearChartDrawPicture(drawPictrueData.ChartDrawPicture);
|
|
3640
3641
|
}
|
|
3641
|
-
else
|
|
3642
|
+
else
|
|
3642
3643
|
{
|
|
3643
3644
|
this.UpDownDrag=null; //画图优先
|
|
3644
3645
|
this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
|
|
@@ -3658,12 +3659,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3658
3659
|
//this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
|
|
3659
3660
|
this.SelectChartDrawPicture.DragInfo={Click:{X:e.clientX,Y:e.clientY}};
|
|
3660
3661
|
}
|
|
3661
|
-
|
|
3662
|
-
{
|
|
3663
|
-
this.CurrentChartDrawPicture=null;
|
|
3664
|
-
this.SelectChartDrawPicture=null;
|
|
3665
|
-
}
|
|
3666
|
-
|
|
3662
|
+
|
|
3667
3663
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE); //选中画图工具事件
|
|
3668
3664
|
if (event && event.Callback)
|
|
3669
3665
|
{
|
|
@@ -3852,7 +3848,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3852
3848
|
var sendData={X:x, Y:y, e:e, ChartDrag:this.CustomChartDrag, Drag:drag };
|
|
3853
3849
|
this.TryDragMove_CustomChartDrag(sendData);
|
|
3854
3850
|
}
|
|
3855
|
-
else if (this.CurrentChartDrawPicture)
|
|
3851
|
+
else if (this.CurrentChartDrawPicture && this.CurrentChartDrawPicture.EnableMove===true)
|
|
3856
3852
|
{
|
|
3857
3853
|
var drawPicture=this.CurrentChartDrawPicture;
|
|
3858
3854
|
if (drawPicture.Status==1 || drawPicture.Status==2)
|
|
@@ -4659,21 +4655,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
4659
4655
|
var pixelTatio = GetDevicePixelRatio(); //鼠标移动坐标是原始坐标 需要乘以放大倍速
|
|
4660
4656
|
if (this.GetChartDrawPictureByPoint(drawPictrueData))
|
|
4661
4657
|
{
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
|
|
4669
|
-
this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
|
|
4670
|
-
|
|
4671
|
-
}
|
|
4672
|
-
else
|
|
4673
|
-
{
|
|
4674
|
-
this.CurrentChartDrawPicture=null;
|
|
4675
|
-
this.SelectChartDrawPicture=null;
|
|
4676
|
-
}
|
|
4658
|
+
drawPictrueData.ChartDrawPicture.Status=20;
|
|
4659
|
+
drawPictrueData.ChartDrawPicture.ValueToPoint();
|
|
4660
|
+
drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;
|
|
4661
|
+
drawPictrueData.ChartDrawPicture.IsSelected=true;
|
|
4662
|
+
this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
|
|
4663
|
+
this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
|
|
4677
4664
|
|
|
4678
4665
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE); //选中画图工具事件
|
|
4679
4666
|
if (event && event.Callback)
|
|
@@ -4808,7 +4795,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
4808
4795
|
|
|
4809
4796
|
//JSConsole.Chart.Log(`[JSChartContainer::OnTouchMove] moveAngle=${moveAngle} , moveUpDown=${moveUpDown}, moveSetp=${moveSetp}`);
|
|
4810
4797
|
|
|
4811
|
-
if (this.CurrentChartDrawPicture)
|
|
4798
|
+
if (this.CurrentChartDrawPicture && this.CurrentChartDrawPicture.EnableMove===true)
|
|
4812
4799
|
{
|
|
4813
4800
|
var drawPicture=this.CurrentChartDrawPicture;
|
|
4814
4801
|
if (drawPicture.Status==1 || drawPicture.Status==2)
|
|
@@ -13021,6 +13008,7 @@ function MinuteFrame()
|
|
|
13021
13008
|
if (this.BeforeDrawXYCallback) this.BeforeDrawXYCallback(this);
|
|
13022
13009
|
|
|
13023
13010
|
this.DrawNightDayBG(); //绘制夜盘 日盘背景
|
|
13011
|
+
this.DrawCustomBG(); //绘制自定义背景色
|
|
13024
13012
|
|
|
13025
13013
|
this.DrawTitleBG();
|
|
13026
13014
|
this.DrawHorizontal();
|
|
@@ -13465,6 +13453,60 @@ function MinuteFrame()
|
|
|
13465
13453
|
}
|
|
13466
13454
|
}
|
|
13467
13455
|
|
|
13456
|
+
this.DrawCustomBG=function()
|
|
13457
|
+
{
|
|
13458
|
+
if (!this.HQChart) return;
|
|
13459
|
+
if (this.IsHScreen) return;
|
|
13460
|
+
|
|
13461
|
+
var symbol=this.HQChart.Symbol;
|
|
13462
|
+
if (!symbol) return;
|
|
13463
|
+
|
|
13464
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_MINUTE_BG)
|
|
13465
|
+
if (!event || !event.Callback) return;
|
|
13466
|
+
|
|
13467
|
+
var aryDay=null;
|
|
13468
|
+
if (this.DayCount>1)
|
|
13469
|
+
{
|
|
13470
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.HQChart.DayData)) return;
|
|
13471
|
+
aryDay=[];
|
|
13472
|
+
for(var i=this.HQChart.DayData.length-1;i>=0;--i)
|
|
13473
|
+
{
|
|
13474
|
+
aryDay.push({ Date:this.HQChart.DayData[i].Date, BGColor:null } );
|
|
13475
|
+
}
|
|
13476
|
+
}
|
|
13477
|
+
else if (this.DayCount==1)
|
|
13478
|
+
{
|
|
13479
|
+
if (!IFrameSplitOperator.IsPlusNumber(this.HQChart.DataStatus.LatestDate)) return;
|
|
13480
|
+
aryDay=[{ Date:this.HQChart.DataStatus.LatestDate, BGColor:null }];
|
|
13481
|
+
}
|
|
13482
|
+
|
|
13483
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryDay)) return;
|
|
13484
|
+
|
|
13485
|
+
var sendData={ XPointCount:this.XPointCount, DayCount:this.DayCount, MinuteCount:this.MinuteCount , AryDay:aryDay, PreventDefault:false };
|
|
13486
|
+
event.Callback(event, sendData, this);
|
|
13487
|
+
if (sendData.PreventDefault) return;
|
|
13488
|
+
|
|
13489
|
+
var border=this.ChartBorder.GetBorder();
|
|
13490
|
+
for(var i=0;i<aryDay.length;++i)
|
|
13491
|
+
{
|
|
13492
|
+
var item=aryDay[i];
|
|
13493
|
+
if (!item.BGColor) continue;
|
|
13494
|
+
|
|
13495
|
+
var start=i*this.MinuteCount;
|
|
13496
|
+
var end=start+this.MinuteCount-1;
|
|
13497
|
+
|
|
13498
|
+
var xStart=this.GetXFromIndex(start);
|
|
13499
|
+
var xEnd=this.GetXFromIndex(end);
|
|
13500
|
+
|
|
13501
|
+
var rtDay={Left:xStart, Top:border.Top, Right:xEnd, Bottom:border.Bottom };
|
|
13502
|
+
rtDay.Width=rtDay.Right-rtDay.Left;
|
|
13503
|
+
rtDay.Height=rtDay.Bottom-rtDay.Top;
|
|
13504
|
+
|
|
13505
|
+
this.Canvas.fillStyle =item.BGColor;
|
|
13506
|
+
this.Canvas.fillRect(rtDay.Left, rtDay.Top, rtDay.Width, rtDay.Height);
|
|
13507
|
+
}
|
|
13508
|
+
}
|
|
13509
|
+
|
|
13468
13510
|
this.DrawNightDayBG=function()
|
|
13469
13511
|
{
|
|
13470
13512
|
if (this.DayCount!=1) return;
|
|
@@ -79548,20 +79590,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
79548
79590
|
drawPictrueData.Y=(touches[0].clientY-uielement.getBoundingClientRect().top);
|
|
79549
79591
|
if (this.GetChartDrawPictureByPoint(drawPictrueData))
|
|
79550
79592
|
{
|
|
79551
|
-
|
|
79552
|
-
|
|
79553
|
-
|
|
79554
|
-
|
|
79555
|
-
|
|
79556
|
-
|
|
79557
|
-
|
|
79558
|
-
this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
|
|
79559
|
-
}
|
|
79560
|
-
else
|
|
79561
|
-
{
|
|
79562
|
-
this.CurrentChartDrawPicture=null;
|
|
79563
|
-
this.SelectChartDrawPicture=null;
|
|
79564
|
-
}
|
|
79593
|
+
|
|
79594
|
+
drawPictrueData.ChartDrawPicture.Status=20;
|
|
79595
|
+
drawPictrueData.ChartDrawPicture.ValueToPoint();
|
|
79596
|
+
drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;
|
|
79597
|
+
drawPictrueData.ChartDrawPicture.IsSelected=true;
|
|
79598
|
+
this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
|
|
79599
|
+
this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
|
|
79565
79600
|
|
|
79566
79601
|
let event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE); //选中画图工具事件
|
|
79567
79602
|
if (event && event.Callback)
|
|
@@ -79650,7 +79685,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
79650
79685
|
var moveUpDown=Math.abs(drag.LastMove.Y-touches[0].clientY);
|
|
79651
79686
|
moveSetp=parseInt(moveSetp);
|
|
79652
79687
|
|
|
79653
|
-
if (this.CurrentChartDrawPicture)
|
|
79688
|
+
if (this.CurrentChartDrawPicture && this.CurrentChartDrawPicture.EnableMove===true)
|
|
79654
79689
|
{
|
|
79655
79690
|
var drawPicture=this.CurrentChartDrawPicture;
|
|
79656
79691
|
if (drawPicture.Status==1 || drawPicture.Status==2)
|
|
@@ -54,6 +54,18 @@
|
|
|
54
54
|
<div class="content unicode" style="display: block;">
|
|
55
55
|
<ul class="icon_lists dib-box">
|
|
56
56
|
|
|
57
|
+
<li class="dib">
|
|
58
|
+
<span class="icon hqchart_drawtool"></span>
|
|
59
|
+
<div class="name">unlock</div>
|
|
60
|
+
<div class="code-name">&#xe7fa;</div>
|
|
61
|
+
</li>
|
|
62
|
+
|
|
63
|
+
<li class="dib">
|
|
64
|
+
<span class="icon hqchart_drawtool"></span>
|
|
65
|
+
<div class="name">lock</div>
|
|
66
|
+
<div class="code-name">&#xe7fb;</div>
|
|
67
|
+
</li>
|
|
68
|
+
|
|
57
69
|
<li class="dib">
|
|
58
70
|
<span class="icon hqchart_drawtool"></span>
|
|
59
71
|
<div class="name">箭头</div>
|
|
@@ -468,9 +480,9 @@
|
|
|
468
480
|
<pre><code class="language-css"
|
|
469
481
|
>@font-face {
|
|
470
482
|
font-family: 'hqchart_drawtool';
|
|
471
|
-
src: url('iconfont.woff2?t=
|
|
472
|
-
url('iconfont.woff?t=
|
|
473
|
-
url('iconfont.ttf?t=
|
|
483
|
+
src: url('iconfont.woff2?t=1724304295473') format('woff2'),
|
|
484
|
+
url('iconfont.woff?t=1724304295473') format('woff'),
|
|
485
|
+
url('iconfont.ttf?t=1724304295473') format('truetype');
|
|
474
486
|
}
|
|
475
487
|
</code></pre>
|
|
476
488
|
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
|
@@ -496,6 +508,24 @@
|
|
|
496
508
|
<div class="content font-class">
|
|
497
509
|
<ul class="icon_lists dib-box">
|
|
498
510
|
|
|
511
|
+
<li class="dib">
|
|
512
|
+
<span class="icon hqchart_drawtool icon-unlock"></span>
|
|
513
|
+
<div class="name">
|
|
514
|
+
unlock
|
|
515
|
+
</div>
|
|
516
|
+
<div class="code-name">.icon-unlock
|
|
517
|
+
</div>
|
|
518
|
+
</li>
|
|
519
|
+
|
|
520
|
+
<li class="dib">
|
|
521
|
+
<span class="icon hqchart_drawtool icon-lock"></span>
|
|
522
|
+
<div class="name">
|
|
523
|
+
lock
|
|
524
|
+
</div>
|
|
525
|
+
<div class="code-name">.icon-lock
|
|
526
|
+
</div>
|
|
527
|
+
</li>
|
|
528
|
+
|
|
499
529
|
<li class="dib">
|
|
500
530
|
<span class="icon hqchart_drawtool icon-big_arrow"></span>
|
|
501
531
|
<div class="name">
|
|
@@ -1117,6 +1147,22 @@
|
|
|
1117
1147
|
<div class="content symbol">
|
|
1118
1148
|
<ul class="icon_lists dib-box">
|
|
1119
1149
|
|
|
1150
|
+
<li class="dib">
|
|
1151
|
+
<svg class="icon svg-icon" aria-hidden="true">
|
|
1152
|
+
<use xlink:href="#icon-unlock"></use>
|
|
1153
|
+
</svg>
|
|
1154
|
+
<div class="name">unlock</div>
|
|
1155
|
+
<div class="code-name">#icon-unlock</div>
|
|
1156
|
+
</li>
|
|
1157
|
+
|
|
1158
|
+
<li class="dib">
|
|
1159
|
+
<svg class="icon svg-icon" aria-hidden="true">
|
|
1160
|
+
<use xlink:href="#icon-lock"></use>
|
|
1161
|
+
</svg>
|
|
1162
|
+
<div class="name">lock</div>
|
|
1163
|
+
<div class="code-name">#icon-lock</div>
|
|
1164
|
+
</li>
|
|
1165
|
+
|
|
1120
1166
|
<li class="dib">
|
|
1121
1167
|
<svg class="icon svg-icon" aria-hidden="true">
|
|
1122
1168
|
<use xlink:href="#icon-big_arrow"></use>
|