hqchart 1.1.14291 → 1.1.14295
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 +7 -6
- package/package.json +1 -1
- package/src/jscommon/umychart.complier.js +16 -2
- package/src/jscommon/umychart.js +38 -7
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +55 -10
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +55 -10
package/lib/umychart.vue.js
CHANGED
|
@@ -7778,7 +7778,8 @@ ClientPos:this.ChartCorssCursor.ClientPos,//位置
|
|
|
7778
7778
|
IsShowCorss:this.ChartCorssCursor.IsShowCorss,//是否显示十字线
|
|
7779
7779
|
KItem:kItem,Symbol:this.Symbol,Name:this.Name,LastValue:this.ChartCorssCursor.LastValue};this.DialogTooltip.Update(sendData);return true;};this.DrawSelectRectDialog=function(e){if(!this.DialogSelectRect)return;this.UpdateSelectRectDialog(e);};this.UpdateSelectRectDialog=function(e){if(!this.DialogSelectRect)return false;var data=e.data;//区间统计数据
|
|
7780
7780
|
var x,y;if(data&&IFrameSplitOperator.IsNumber(data.X)&&IFrameSplitOperator.IsNumber(data.Y)){var pixelRatio=GetDevicePixelRatio();var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();x=data.X;y=data.Y;x+=rtClient.left+rtScroll.Left;y+=rtClient.top+rtScroll.Top;}var sendData={Symbol:this.Symbol,Name:this.Name,SelectData:data.SelectData,X:x,Y:y,e:e};this.DialogSelectRect.Update(sendData);};this.UpdateHQFloatTooltip=function(kData){if(!this.FloatTooltip)return;if(!this.FloatTooltip.IsShow())return;if(!kData||!IFrameSplitOperator.IsNonEmptyArray(kData.Data))return;var lastItem=kData.Data[kData.Data.length-1];if(!lastItem)return;var dataID={Symbol:kData.Symbol,Date:lastItem.Date,Time:lastItem.Time};if(!this.FloatTooltip.IsEqualHQID(dataID))return;var sendData={Data:lastItem,Symbol:this.Symbol,Name:this.Name,DataType:2};this.FloatTooltip.Update(sendData);};this.GetKData=function(){if(!this.ChartPaint[0])return null;var data=this.ChartPaint[0].Data;if(!data)return null;return data;};//十字光标解锁
|
|
7781
|
-
this.UnlockCorssCursor=function(){var xItem=this.GlobalOption.LockCorssCursor.X;xItem.Enable=false;xItem.KLine=null;};this.LockCorssCursor=function(){var xItem=this.GlobalOption.LockCorssCursor.X;xItem.KLine={DataIndex:
|
|
7781
|
+
this.UnlockCorssCursor=function(option){var xItem=this.GlobalOption.LockCorssCursor.X;xItem.Enable=false;xItem.KLine=null;if(option&&option.Draw)this.Draw();};this.LockCorssCursor=function(option){if(this.CursorIndex<0)return false;var kData=this.GetKData();if(!kData||!IFrameSplitOperator.IsNonEmptyArray(kData.Data))return false;var dataIndex=kData.DataOffset+parseInt(this.CursorIndex.toFixed(0));var kItem=kData.Data[dataIndex];if(!kItem)return false;var xItem=this.GlobalOption.LockCorssCursor.X;xItem.KLine={DataIndex:dataIndex,Date:kItem.Date,Time:kItem.Time};xItem.Enable=true;if(option&&option.Draw)this.Draw();return true;};this.GetCorssCursorPosition=function(){var position={LastPoint:{X:this.LastPoint.X,Y:this.LastPoint.Y},CursorIndex:this.CursorIndex};if(!this.GlobalOption||!this.GlobalOption.LockCorssCursor)return position;var xItem=this.GlobalOption.LockCorssCursor.X;if(xItem.Enable&&xItem.KLine){var kData=this.GetKData();if(!kData||!IFrameSplitOperator.IsNonEmptyArray(kData.Data))return position;position.CursorIndex=xItem.KLine.DataIndex-kData.DataOffset;position.LastPoint.X=this.Frame.GetXFromIndex(position.CursorIndex);var border=this.Frame.ChartBorder.GetBorder();if(position.LastPoint.Y<border.Top||position.LastPoint.Y>border.Bottom)//超出图形框子, 调整为收盘价
|
|
7782
|
+
{var kItem=kData.Data[xItem.KLine.DataIndex];var y=this.Frame.SubFrame[0].Frame.GetYFromData(kItem.Close);position.LastPoint.Y=y;}}return position;};}//API 返回数据 转化为array[]
|
|
7782
7783
|
KLineChartContainer.JsonDataToHistoryData=function(data){var aryDayData=[];if(!data.data)return aryDayData;var upperSymbol=null;if(data.symbol)upperSymbol=data.symbol.toUpperCase();var isFutures=false;//是否是期货
|
|
7783
7784
|
if(upperSymbol)isFutures=MARKET_SUFFIX_NAME.IsFutures(upperSymbol);var list=data.data;var date=0,yclose=1,open=2,high=3,low=4,close=5,vol=6,amount=7,position=8;var fclose=9,yfclose=10;//结算价, 前结算价
|
|
7784
7785
|
var bfactor=11,afactor=12;//前, 后复权因子
|
|
@@ -7947,8 +7948,8 @@ RectSelectPaint:paint//区间选择背景
|
|
|
7947
7948
|
{var selectData=paint.GetSelectRectData();var data={X:obj.X,Y:obj.Y,SelectData:selectData,RectSelectPaint:paint};var e={data:data};this.DrawSelectRectDialog(e);}return true;};this.GetLastCursorIndex=function(obj){if(obj.DataType==1){for(var i=obj.Data.length-1;i>=0;--i){var item=obj.Data[i];if(!item||!item.DayItem||!item.DayItem.Data)continue;obj.IndexData.DayIndex=0;obj.IndexData.DataIndex=item.DayItem.Data.length-1;obj.IndexData.Type=item.Type;return;}}else if(obj.DataType==2){for(var i=obj.Data.length-1;i>=0;--i){var dayItem=obj.Data[i];for(var j=dayItem.length-1;j>=0;--j){var item=dayItem[j];if(!item||!item.DayItem||!item.DayItem.Data)continue;obj.IndexData.DayIndex=i;obj.IndexData.DataIndex=item.DayItem.Data.length-1;obj.IndexData.Type=item.Type;return;}}}};this.GetFirstCursorIndex=function(obj){if(obj.DataType==1){for(var i=0;i<obj.Data.length;++i){var item=obj.Data[i];if(!item||!item.DayItem||!item.DayItem.Data)continue;obj.IndexData.DayIndex=0;obj.IndexData.DataIndex=0;obj.IndexData.Type=item.Type;return;}}else if(obj.DataType==2){for(var i=0;i<obj.Data.length;++i){var dayItem=obj.Data[i];for(var j=0;j<dayItem.length;++j){var item=dayItem[j];if(!item||!item.DayItem||!item.DayItem.Data)continue;obj.IndexData.DayIndex=i;obj.IndexData.DataIndex=0;obj.IndexData.Type=item.Type;return;}}}};//获取单日 盘后集合竞价数据
|
|
7948
7949
|
this.GetAfterCloseData=function(){var dayItem=null;if(this.AfterCloseData&&this.IsShowAfterData)dayItem=this.AfterCloseData;return dayItem;};//获取单日 盘前集合竞价数据
|
|
7949
7950
|
this.GetBeforeOpenData=function(){var dayItem=null;if(this.BeforeOpenData&&this.IsShowBeforeData)dayItem=this.BeforeOpenData;return dayItem;};this.MoveCorssCursorIndex=function(option){if(!this.EnableNewIndex)return false;if(!this.Frame.SubFrame[0]||!this.Frame.SubFrame[0].Frame)return false;var frame=this.Frame.SubFrame[0].Frame;if(this.CorssCursorIndex.Type==1||this.CorssCursorIndex.Type==2||this.CorssCursorIndex.Type==3||this.CorssCursorIndex.Type==-1){var aryData=[];var dayItem=this.GetBeforeOpenData();aryData.push({DayItem:dayItem,Type:2});var dayItem=null;if(this.SourceData)dayItem=this.SourceData;aryData.push({DayItem:dayItem,Type:1});var dayItem=this.GetAfterCloseData();;aryData.push({DayItem:dayItem,Type:3});var obj={DataType:1,Data:aryData,IndexData:this.CorssCursorIndex,Point:{X:null,Y:null}};var step=1;if(option.IsMoveLeft){if(this.CorssCursorIndex.DayIndex<0&&this.CorssCursorIndex.DataIndex<0){this.GetLastCursorIndex(obj);step=0;}if(frame.MoveXIndexLeft(step,obj)){this.LastPoint.X=obj.Point.X;this.LastPoint.Y=obj.Point.Y;if(this.CorssCursorIndex.Type==1)this.CursorIndex=this.CorssCursorIndex.CursorIndex;var option={ParentFunction:'MoveCorssCursorIndex',Point:{X:obj.Point.X,Y:obj.Point.Y},IsPhone:false,ClientPos:this.CorssCursorIndex.Type};this.DrawDynamicInfo(option);}}else{if(this.CorssCursorIndex.DayIndex<0&&this.CorssCursorIndex.DataIndex<0){this.GetFirstCursorIndex(obj);step=0;}if(frame.MoveXIndexRight(step,obj)){this.LastPoint.X=obj.Point.X;this.LastPoint.Y=obj.Point.Y;if(this.CorssCursorIndex.Type==1)this.CursorIndex=this.CorssCursorIndex.CursorIndex;var option={ParentFunction:'MoveCorssCursorIndex',Point:{X:obj.Point.X,Y:obj.Point.Y},IsPhone:false,ClientPos:this.CorssCursorIndex.Type};this.DrawDynamicInfo(option);}}}else if(this.CorssCursorIndex.Type==10||this.CorssCursorIndex.Type==20||this.CorssCursorIndex.Type==30||this.CorssCursorIndex.Type==-2){var aryData=[];var offset=0,showDayCount=this.DayData.length;if(this.DayOffset){if(IFrameSplitOperator.IsNumber(this.DayOffset.Offset))offset=this.DayOffset.Offset;if(IFrameSplitOperator.IsNumber(this.DayOffset.ShowDayCount))showDayCount=this.DayOffset.ShowDayCount;}for(var i=offset,j=0;i<this.DayData.length&&j<showDayCount;++i,++j){var item=[];var dayItem=null;if(this.MultiDayBeforeOpenData&&this.IsShowMultiDayBeforeData)dayItem=this.MultiDayBeforeOpenData[i];item.push({DayItem:dayItem,Type:20});//倒序排的
|
|
7950
|
-
var dayItem=null;if(this.DayData)dayItem=this.DayData[this.DayData.length-1-i];item.push({DayItem:dayItem,Type:10});var dayItem=null;if(this.MultiDayAfterCloseData&&this.IsShowMultiDayAfterData)dayItem=this.MultiDayAfterCloseData[i];item.push({DayItem:dayItem,Type:30});aryData.push(item);}var obj={DataType:2,Data:aryData,IndexData:this.CorssCursorIndex,Point:{X:null,Y:null}};var step=1;if(option.IsMoveLeft){if(this.CorssCursorIndex.DayIndex<0&&this.CorssCursorIndex.DataIndex<0){this.GetLastCursorIndex(obj);step=0;}if(frame.MoveXIndexLeft(step,obj)){this.LastPoint.X=obj.Point.X;this.LastPoint.Y=obj.Point.Y;if(this.CorssCursorIndex.Type==10)this.CursorIndex=this.CorssCursorIndex.CursorIndex;var option={ParentFunction:'MoveCorssCursorIndex',Point:{X:obj.Point.X,Y:obj.Point.Y},IsPhone:false,ClientPos:null};if(this.CorssCursorIndex.Type==10)option.ClientPos=1;else if(this.CorssCursorIndex.Type==20)option.ClientPos=this.CorssCursorIndex.DayIndex+200;else if(this.CorssCursorIndex.Type==30)option.ClientPos=this.CorssCursorIndex.DayIndex+300;this.DrawDynamicInfo(option);}}else{if(this.CorssCursorIndex.DayIndex<0&&this.CorssCursorIndex.DataIndex<0){this.GetFirstCursorIndex(obj);step=0;}if(frame.MoveXIndexRight(step,obj)){this.LastPoint.X=obj.Point.X;this.LastPoint.Y=obj.Point.Y;if(this.CorssCursorIndex.Type==10)this.CursorIndex=this.CorssCursorIndex.CursorIndex;var option={ParentFunction:'MoveCorssCursorIndex',Point:{X:obj.Point.X,Y:obj.Point.Y},IsPhone:false,ClientPos:null};if(this.CorssCursorIndex.Type==10)option.ClientPos=1;else if(this.CorssCursorIndex.Type==20)option.ClientPos=this.CorssCursorIndex.DayIndex+200;else if(this.CorssCursorIndex.Type==30)option.ClientPos=this.CorssCursorIndex.DayIndex+300;this.DrawDynamicInfo(option);}}}};this.LockCorssCursor=function(){var xItem=this.GlobalOption.LockCorssCursor.X;if(this.EnableNewIndex){if(this.CorssCursorIndex.Type!=1&&this.CorssCursorIndex.Type!=10)return;//目前只支持连续交易时间段
|
|
7951
|
-
xItem.Minute={DayIndex:this.CorssCursorIndex.DayIndex,DataIndex:this.CorssCursorIndex.DataIndex,Type:this.CorssCursorIndex.Type,CursorIndex:this.CursorIndex};}else{xItem.Minute={CursorIndex:this.CursorIndex};}xItem.Enable=true;};this.UnlockCorssCursor=function(){var xItem=this.GlobalOption.LockCorssCursor.X;xItem.Enable=false;xItem.Minute=null;};this.GetCorssCursorPosition=function(){var position={LastPoint:{X:this.LastPoint.X,Y:this.LastPoint.Y},CursorIndex:this.CursorIndex,CorssCursorIndex:this.CorssCursorIndex};if(!this.GlobalOption||!this.GlobalOption.LockCorssCursor)return position;var xItem=this.GlobalOption.LockCorssCursor.X;if(xItem.Enable&&xItem.Minute){if(this.EnableNewIndex){var type=xItem.Minute.Type;position.CorssCursorIndex={DayIndex:xItem.Minute.DayIndex,DataIndex:xItem.Minute.DataIndex,Type:type};position.CursorIndex=xItem.Minute.CursorIndex;position.LastPoint.X=this.GetXPointByCorssCursorIndex(position.CorssCursorIndex);}else{var index=xItem.Minute.CursorIndex;var x=this.Frame.GetXFromIndex(index,false);position.LastPoint.X=x;position.CursorIndex=xItem.Minute.CursorIndex;}var border=this.Frame.ChartBorder.GetBorder();if(position.LastPoint.Y<border.Top||position.LastPoint.Y>border.Bottom)//超出图形框子, 调整为收盘价
|
|
7951
|
+
var dayItem=null;if(this.DayData)dayItem=this.DayData[this.DayData.length-1-i];item.push({DayItem:dayItem,Type:10});var dayItem=null;if(this.MultiDayAfterCloseData&&this.IsShowMultiDayAfterData)dayItem=this.MultiDayAfterCloseData[i];item.push({DayItem:dayItem,Type:30});aryData.push(item);}var obj={DataType:2,Data:aryData,IndexData:this.CorssCursorIndex,Point:{X:null,Y:null}};var step=1;if(option.IsMoveLeft){if(this.CorssCursorIndex.DayIndex<0&&this.CorssCursorIndex.DataIndex<0){this.GetLastCursorIndex(obj);step=0;}if(frame.MoveXIndexLeft(step,obj)){this.LastPoint.X=obj.Point.X;this.LastPoint.Y=obj.Point.Y;if(this.CorssCursorIndex.Type==10)this.CursorIndex=this.CorssCursorIndex.CursorIndex;var option={ParentFunction:'MoveCorssCursorIndex',Point:{X:obj.Point.X,Y:obj.Point.Y},IsPhone:false,ClientPos:null};if(this.CorssCursorIndex.Type==10)option.ClientPos=1;else if(this.CorssCursorIndex.Type==20)option.ClientPos=this.CorssCursorIndex.DayIndex+200;else if(this.CorssCursorIndex.Type==30)option.ClientPos=this.CorssCursorIndex.DayIndex+300;this.DrawDynamicInfo(option);}}else{if(this.CorssCursorIndex.DayIndex<0&&this.CorssCursorIndex.DataIndex<0){this.GetFirstCursorIndex(obj);step=0;}if(frame.MoveXIndexRight(step,obj)){this.LastPoint.X=obj.Point.X;this.LastPoint.Y=obj.Point.Y;if(this.CorssCursorIndex.Type==10)this.CursorIndex=this.CorssCursorIndex.CursorIndex;var option={ParentFunction:'MoveCorssCursorIndex',Point:{X:obj.Point.X,Y:obj.Point.Y},IsPhone:false,ClientPos:null};if(this.CorssCursorIndex.Type==10)option.ClientPos=1;else if(this.CorssCursorIndex.Type==20)option.ClientPos=this.CorssCursorIndex.DayIndex+200;else if(this.CorssCursorIndex.Type==30)option.ClientPos=this.CorssCursorIndex.DayIndex+300;this.DrawDynamicInfo(option);}}}};this.LockCorssCursor=function(option){var xItem=this.GlobalOption.LockCorssCursor.X;if(this.EnableNewIndex){if(this.CorssCursorIndex.Type!=1&&this.CorssCursorIndex.Type!=10)return false;//目前只支持连续交易时间段
|
|
7952
|
+
xItem.Minute={DayIndex:this.CorssCursorIndex.DayIndex,DataIndex:this.CorssCursorIndex.DataIndex,Type:this.CorssCursorIndex.Type,CursorIndex:this.CursorIndex};}else{xItem.Minute={CursorIndex:this.CursorIndex};}xItem.Enable=true;if(option&&option.Draw)this.Draw();return true;};this.UnlockCorssCursor=function(option){var xItem=this.GlobalOption.LockCorssCursor.X;xItem.Enable=false;xItem.Minute=null;if(option&&option.Draw)this.Draw();};this.GetCorssCursorPosition=function(){var position={LastPoint:{X:this.LastPoint.X,Y:this.LastPoint.Y},CursorIndex:this.CursorIndex,CorssCursorIndex:this.CorssCursorIndex};if(!this.GlobalOption||!this.GlobalOption.LockCorssCursor)return position;var xItem=this.GlobalOption.LockCorssCursor.X;if(xItem.Enable&&xItem.Minute){if(this.EnableNewIndex){var type=xItem.Minute.Type;position.CorssCursorIndex={DayIndex:xItem.Minute.DayIndex,DataIndex:xItem.Minute.DataIndex,Type:type};position.CursorIndex=xItem.Minute.CursorIndex;position.LastPoint.X=this.GetXPointByCorssCursorIndex(position.CorssCursorIndex);}else{var index=xItem.Minute.CursorIndex;var x=this.Frame.GetXFromIndex(index,false);position.LastPoint.X=x;position.CursorIndex=xItem.Minute.CursorIndex;}var border=this.Frame.ChartBorder.GetBorder();if(position.LastPoint.Y<border.Top||position.LastPoint.Y>border.Bottom)//超出图形框子, 调整为收盘价
|
|
7952
7953
|
{var kData=this.GetKData();if(kData&&IFrameSplitOperator.IsNonEmptyArray(kData.Data)){var index=parseInt(position.CursorIndex.toFixed(0));var item=kData.Data[index];if(item&&IFrameSplitOperator.IsNumber(item.Close)){var y=this.Frame.SubFrame[0].Frame.GetYFromData(item.Close);position.LastPoint.Y=y;}}}}return position;};this.GetXPointByCorssCursorIndex=function(corssCursorIndex){if(!corssCursorIndex)return;var x=null;var dayIndex=corssCursorIndex.DayIndex;var dataIndex=corssCursorIndex.DataIndex;switch(corssCursorIndex.Type){//单日 1=主图 2=盘前 3=盘后 //多日 10=主图 20=盘前 30=盘后
|
|
7953
7954
|
case 1://单日 1=主图
|
|
7954
7955
|
case 10://多日 10=主图
|
|
@@ -10682,7 +10683,7 @@ this.DRAWLASTBARTEXT=function(data,text){var drawItem={Value:null,Text:text};if(
|
|
|
10682
10683
|
//例2:
|
|
10683
10684
|
//DRAWLASTBARNUMBER(L,REF(C,1),2,COLORRED),ALIGN0,VALIGN0;//表示最后一根k线的最低价处以红色显示昨收盘价数值(精确2位小数),标注文字居左,居上对齐。
|
|
10684
10685
|
this.DRAWLASTBARNUMBER=function(data,value,dec,color){var drawItem={Value:null,Text:null,Color:color};if(IFrameSplitOperator.IsNonEmptyArray(data))drawItem.Value=data[data.length-1];else drawItem.Value=data;var precision=2;if(IFrameSplitOperator.IsNumber(dec))precision=parseInt(dec);if(IFrameSplitOperator.IsNumber(value)){drawItem.Text=value.toFixed(precision);}else if(IFrameSplitOperator.IsNonEmptyArray(value)){var lastValue=value[value.length-1];if(IFrameSplitOperator.IsNumber(lastValue))drawItem.Text=lastValue.toFixed(precision);}var result={DrawData:drawItem,DrawType:'DRAWLASTBARNUMBER'};return result;};//表格
|
|
10685
|
-
this.TABLE_CELL=function(
|
|
10686
|
+
this.TABLE_CELL=function(data,color,textAlign,bgColor){var text=null;if(IFrameSplitOperator.IsString(data)){text=data;}else if(IFrameSplitOperator.IsNonEmptyArray(data)){var precision=2;var lastValue=data[data.length-1];if(IFrameSplitOperator.IsNumber(lastValue))text=lastValue.toFixed(precision);else if(IFrameSplitOperator.IsString(lastValue))text=lastValue;}var cellItem={Text:text};if(color)cellItem.Color=color;if(bgColor)cellItem.BGColor=bgColor;if(IFrameSplitOperator.IsString(textAlign)){var strValue=textAlign.toLowerCase();//转小写
|
|
10686
10687
|
cellItem.TextAlign=strValue;}return cellItem;};this.TABLE_ROW=function(aryData){var aryCell=[];for(var i=0;i<aryData.length;++i){var item=aryData[i];aryCell.push(item);}return aryCell;};this.DRAWTABLE=function(aryData){var tableData=[];for(var i=0;i<aryData.length;++i){var item=aryData[i];tableData.push({AryCell:item});}return result={DrawData:{TableData:tableData},DrawType:'DRAW_SIMPLE_TABLE'};};}JSDraw.prototype.CalculateDrawLine=function(lineCache){lineCache.List=[];for(var _i102=lineCache.Start.ID;_i102<=lineCache.End.ID;++_i102){lineCache.List.push(_i102);}var height=Math.abs(lineCache.Start.Value-lineCache.End.Value);var width=lineCache.List.length-1;var result=[];result.push({ID:lineCache.Start.ID,Value:lineCache.Start.Value});//第1个点
|
|
10687
10688
|
if(lineCache.Start.Value>lineCache.End.Value){for(var _i103=1;_i103<lineCache.List.length-1;++_i103){var value=height*(lineCache.List.length-1-_i103)/width+lineCache.End.Value;result.push({ID:lineCache.List[_i103],Value:value});}}else{for(var _i104=1;_i104<lineCache.List.length-1;++_i104){var value=height*_i104/width+lineCache.Start.Value;result.push({ID:lineCache.List[_i104],Value:value});}}result.push({ID:lineCache.End.ID,Value:lineCache.End.Value});//最后一个点
|
|
10688
10689
|
return result;};//是否有是有效的数字
|
|
@@ -11330,7 +11331,7 @@ node.Out=this.SymbolData.GetLatestCacheData(args[0]);break;case'STICKLINE':node.
|
|
|
11330
11331
|
node.Out=this.Draw.KLINETYPE(args[0]);break;case"DRAWOVERLAYKLINE":node.Draw=this.Draw.DRAWOVERLAYKLINE(args[0],args[1],args[2],args[3]);node.Out=[];break;case"DRAWCOLORKLINE":node.Draw=this.Draw.DRAWCOLORKLINE(args[0],args[1],args[2]);node.Out=[];break;case'PLOYLINE':case'POLYLINE':node.Draw=this.Draw.POLYLINE(args[0],args[1]);node.Out=node.Draw.DrawData;break;case'DRAWNUMBER':node.Draw=this.Draw.DRAWNUMBER(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Value;break;case"DRAWNUMBER_FIX":node.Draw=this.Draw.DRAWNUMBER_FIX(args[0],args[1],args[2],args[3],args[4]);node.Out=node.Draw.DrawData.Value;break;case"DRAWCHANNEL":node.Draw=this.Draw.DRAWCHANNEL(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);node.Out=[];break;case'RGB':node.Out=this.Draw.RGB(args[0],args[1],args[2]);break;case"RGBA":node.Out=this.Draw.RGBA(args[0],args[1],args[2],args[3]);break;case"UPCOLOR":node.Out=this.Draw.UPCOLOR(args[0]);break;case"DOWNCOLOR":node.Out=this.Draw.DOWNCOLOR(args[0]);break;case"STICKTYPE"://柱子类型
|
|
11331
11332
|
node.Out=this.Draw.STICKTYPE(args[0]);break;case"XMOVE":node.Out=this.Draw.XMOVE(args[0]);break;case"YMOVE":node.Out=this.Draw.YMOVE(args[0]);break;case"LINEDASH":node.Out=this.Draw.LINEDASH(args);break;case"FIRSTDRAW":node.Out=this.Draw.FIRSTDRAW(args[0]);break;case'PARTLINE':node.Draw=this.Draw.PARTLINE(args);node.Out=[];break;case'DRAWGBK':node.Draw=this.Draw.DRAWGBK(args[0],args[1],args[2],args[3]);node.Out=[];break;case'DRAWGBK2':node.Draw=this.Draw.DRAWGBK2(args[0],args[1],args[2],args[3]);node.Out=[];break;case"DRAWGBK_DIV":node.Draw=this.Draw.DRAWGBK_DIV(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case'DRAWTEXT_LINE':node.Draw=this.Draw.DRAWTEXT_LINE(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);node.Out=[];break;case'DRAWRECTREL':node.Draw=this.Draw.DRAWRECTREL(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case"DRAWTEXTREL":node.Draw=this.Draw.DRAWTEXTREL(args[0],args[1],args[2]);node.Out=[];break;case"DRAWTEXTABS":node.Draw=this.Draw.DRAWTEXTABS(args[0],args[1],args[2]);node.Out=[];break;case"DRAWOVERLAYLINE":node.Draw=this.Draw.DRAWOVERLAYLINE(args[0],args[1],args[2]);node.Out=node.Draw.DrawData.Data;break;case"DRAWSL":node.Draw=this.Draw.DRAWSL(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case"VERTLINE":node.Draw=this.Draw.VERTLINE(args[0],args[1]);node.Out=node.Draw.DrawData.Data;break;case"HORLINE":node.Draw=this.Draw.HORLINE(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Data;break;case"DRAWLASTBARICON":node.Draw=this.Draw.DRAWLASTBARICON(args[0],args[1]);node.Out=[];break;case"DRAWLASTBARNUMBER":node.Draw=this.Draw.DRAWLASTBARNUMBER(args[0],args[1],args[2],args[3]);node.Out=[];break;case"DRAWLASTBARTEXT":node.Draw=this.Draw.DRAWLASTBARTEXT(args[0],args[1]);node.Out=[];break;case'CODELIKE':node.Out=this.SymbolData.CODELIKE(args[0]);break;case'NAMELIKE':case"NAMEINCLUDE":node.Out=this.SymbolData.NAMELIKE(args[1]);break;case'REFDATE':node.Out=this.SymbolData.REFDATE(args[0],args[1]);break;case'FINANCE':node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:1,Node:node});break;case"FINVALUE":node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:1,Node:node});break;case"FINONE":node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:3,Node:node});break;case"GPJYVALUE":case"SCJYVALUE":case"BKJYVALUE":node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:3,Node:node});break;case"GPJYONE":case"SCJYONE":case"BKJYONE":node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:4,Node:node});break;case"MARGIN":node.Out=this.SymbolData.GetMarginCacheData(args[0],node);break;case"HK2SHSZ":node.Out=this.SymbolData.GetHKToSHSZCacheData(args[0],node);break;case"NEWS":node.Out=this.SymbolData.GetNewsAnalysisCacheData(args[0],node);break;case'UPCOUNT':case'DOWNCOUNT':node.Out=this.SymbolData.GetIndexIncreaseCacheData(funcName,args[0],node);break;case'SF':node.Out=this.SymbolData.GetSectionFinanceCacheData(args[0],args[1],args[2],node);break;case'LOADAPIDATA':node.Out=this.SymbolData.GetCustomApiData(args);break;case"STKINDI":case"CALCSTOCKINDEX":node.Out=this.SymbolData.GetScriptIndexOutData(args,node,funcName);break;case"SOUND":node.Draw=this.Draw.SOUND(args[0]);node.Out=[];break;case"PLAYSOUND":node.Draw=this.Draw.PLAYSOUND(args[0],args[1]);node.Out=[];break;case'CLOSE':case'C':case'VOL':case'V':case'OPEN':case'O':case'HIGH':case'H':case'LOW':case'L':case'AMOUNT':case'AMO':node.Out=this.SymbolData.GetOtherSymolCacheData({FunctionName:funcName,Args:args});break;case"INBLOCK":node.Out=this.SymbolData.IsInBlock(args[0],node);break;case'COVER_C':case'COVER_O':case'COVER_H':case'COVER_L':case'COVER_A':case'COVER_V':if(args.length==2)return this.SymbolData.GetSymbolPeriodCacheData2(JSComplierHelper.GetConvertValueName(funcName),args[0],args[1]);return this.SymbolData.GetSymbolPeriodCacheData(JSComplierHelper.GetConvertValueName(funcName),args[0]);case"SYSPARAM":node.Out=this.SymbolData.SysParam(args[0],this);break;case"TESTSKIP":var bExit=this.Algorithm.TESTSKIP(args[0],node);node.Out=null;if(bExit){this.Interrupt.Exit=true;if(node&&node.Marker){var marker=node.Marker;this.Interrupt.Line=marker.Line;this.Interrupt.Index=marker.Index;this.Interrupt.Column=marker.Column;}}break;//交易函数
|
|
11332
11333
|
case"BUY":node.Draw=this.Draw.BUY(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Data;break;case"SELL":node.Draw=this.Draw.SELL(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Data;break;case"SELLSHORT":node.Draw=this.Draw.SELLSHORT(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Data;break;case"BUYSHORT":node.Draw=this.Draw.BUYSHORT(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Data;break;//表格函数
|
|
11333
|
-
case"TABLE_CELL":node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2]);break;case"TABLE_ROW":node.Out=this.Draw.TABLE_ROW(args);break;case"DRAWTABLE":node.Draw=this.Draw.DRAWTABLE(args);node.Out=[];break;default:node.Out=this.Algorithm.CallFunction(funcName,args,node,this.SymbolData);break;}return node.Out;};//赋值
|
|
11334
|
+
case"TABLE_CELL":node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2],args[3]);break;case"TABLE_ROW":node.Out=this.Draw.TABLE_ROW(args);break;case"DRAWTABLE":node.Draw=this.Draw.DRAWTABLE(args);node.Out=[];break;default:node.Out=this.Algorithm.CallFunction(funcName,args,node,this.SymbolData);break;}return node.Out;};//赋值
|
|
11334
11335
|
this.VisitAssignmentExpression=function(node){var left=node.Left;if(left.Type!=Syntax.Identifier)this.ThrowUnexpectedNode(node);var varName=left.Name;var right=node.Right;var value=null,drawValue=null;if(right.Type==Syntax.BinaryExpression||right.Type==Syntax.LogicalExpression)value=this.VisitBinaryExpression(right);else if(right.Type==Syntax.CallExpression){value=this.VisitCallExpression(right);if(right.Draw)drawValue=right.Draw;}else if(right.Type==Syntax.Literal){value=right.Value;if(IFrameSplitOperator.IsString(value)&&right.Value.indexOf("$")>0)value=this.SymbolData.GetOtherSymolCacheData({Literal:value});}else if(right.Type==Syntax.Identifier)//右值是变量
|
|
11335
11336
|
value=this.ReadVariable(right.Name,right);else if(right.Type==Syntax.MemberExpression)value=this.ReadMemberVariable(right);else if(right.Type==Syntax.UnaryExpression)value=this.VisitUnaryExpression(right);if(JS_EXECUTE_DEBUG_LOG)JSConsole.Complier.Log('[JSExecute::VisitAssignmentExpression]',varName,' = ',value);if(drawValue)this.VarDrawTable.set(varName,drawValue);this.VarTable.set(varName,value);};//逻辑运算
|
|
11336
11337
|
this.VisitBinaryExpression=function(node){var stack=[];stack.push(node);var temp=null;while(stack.length!=0){temp=stack[stack.length-1];if(temp.Left&&node!=temp.Left&&node!=temp.Right){stack.push(temp.Left);}else if(temp.Right&&node!=temp.Right){stack.push(temp.Right);}else{var _value15=stack.pop();if(_value15.Type==Syntax.BinaryExpression)//只遍历操作符就可以
|
|
@@ -14070,7 +14071,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
14070
14071
|
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);};}/********************************************************************************
|
|
14071
14072
|
* 版本信息输出
|
|
14072
14073
|
*
|
|
14073
|
-
*/var HQCHART_VERSION="1.1.
|
|
14074
|
+
*/var HQCHART_VERSION="1.1.14294";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();//把给外界调用的方法暴露出来
|
|
14074
14075
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
14075
14076
|
// BaseIndex:BaseIndex,
|
|
14076
14077
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
|
@@ -11489,10 +11489,24 @@ function JSDraw(errorHandler,symbolData)
|
|
|
11489
11489
|
}
|
|
11490
11490
|
|
|
11491
11491
|
//表格
|
|
11492
|
-
this.TABLE_CELL=function(
|
|
11492
|
+
this.TABLE_CELL=function(data, color, textAlign, bgColor)
|
|
11493
11493
|
{
|
|
11494
|
+
var text=null;
|
|
11495
|
+
if (IFrameSplitOperator.IsString(data))
|
|
11496
|
+
{
|
|
11497
|
+
text=data;
|
|
11498
|
+
}
|
|
11499
|
+
else if (IFrameSplitOperator.IsNonEmptyArray(data))
|
|
11500
|
+
{
|
|
11501
|
+
var precision=2;
|
|
11502
|
+
var lastValue=data[data.length-1];
|
|
11503
|
+
if (IFrameSplitOperator.IsNumber(lastValue)) text=lastValue.toFixed(precision);
|
|
11504
|
+
else if (IFrameSplitOperator.IsString(lastValue)) text=lastValue;
|
|
11505
|
+
}
|
|
11506
|
+
|
|
11494
11507
|
var cellItem={ Text:text };
|
|
11495
11508
|
if (color) cellItem.Color=color;
|
|
11509
|
+
if (bgColor) cellItem.BGColor=bgColor;
|
|
11496
11510
|
if (IFrameSplitOperator.IsString(textAlign))
|
|
11497
11511
|
{
|
|
11498
11512
|
var strValue=textAlign.toLowerCase(); //转小写
|
|
@@ -18452,7 +18466,7 @@ function JSExecute(ast,option)
|
|
|
18452
18466
|
|
|
18453
18467
|
//表格函数
|
|
18454
18468
|
case "TABLE_CELL":
|
|
18455
|
-
node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2]);
|
|
18469
|
+
node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2],args[3]);
|
|
18456
18470
|
break;
|
|
18457
18471
|
case "TABLE_ROW":
|
|
18458
18472
|
node.Out=this.Draw.TABLE_ROW(args);
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -81216,18 +81216,31 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
81216
81216
|
}
|
|
81217
81217
|
|
|
81218
81218
|
//十字光标解锁
|
|
81219
|
-
this.UnlockCorssCursor=function()
|
|
81219
|
+
this.UnlockCorssCursor=function(option)
|
|
81220
81220
|
{
|
|
81221
81221
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
81222
81222
|
xItem.Enable=false;
|
|
81223
81223
|
xItem.KLine=null;
|
|
81224
|
+
|
|
81225
|
+
if (option && option.Draw) this.Draw();
|
|
81224
81226
|
}
|
|
81225
81227
|
|
|
81226
|
-
this.LockCorssCursor=function()
|
|
81228
|
+
this.LockCorssCursor=function(option)
|
|
81227
81229
|
{
|
|
81230
|
+
if (this.CursorIndex<0) return false;
|
|
81231
|
+
var kData=this.GetKData();
|
|
81232
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false;
|
|
81233
|
+
|
|
81234
|
+
var dataIndex=kData.DataOffset+parseInt(this.CursorIndex.toFixed(0));
|
|
81235
|
+
var kItem=kData.Data[dataIndex];
|
|
81236
|
+
if (!kItem) return false;
|
|
81237
|
+
|
|
81228
81238
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
81229
|
-
xItem.KLine={ DataIndex:
|
|
81239
|
+
xItem.KLine={ DataIndex:dataIndex, Date:kItem.Date, Time:kItem.Time };
|
|
81230
81240
|
xItem.Enable=true;
|
|
81241
|
+
|
|
81242
|
+
if (option && option.Draw) this.Draw();
|
|
81243
|
+
return true;
|
|
81231
81244
|
}
|
|
81232
81245
|
|
|
81233
81246
|
this.GetCorssCursorPosition=function()
|
|
@@ -81243,7 +81256,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
81243
81256
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
81244
81257
|
if (xItem.Enable && xItem.KLine)
|
|
81245
81258
|
{
|
|
81246
|
-
|
|
81259
|
+
var kData=this.GetKData();
|
|
81260
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return position;
|
|
81261
|
+
|
|
81262
|
+
position.CursorIndex=xItem.KLine.DataIndex-kData.DataOffset;
|
|
81263
|
+
position.LastPoint.X=this.Frame.GetXFromIndex(position.CursorIndex);
|
|
81264
|
+
|
|
81265
|
+
var border=this.Frame.ChartBorder.GetBorder();
|
|
81266
|
+
if (position.LastPoint.Y<border.Top || position.LastPoint.Y>border.Bottom) //超出图形框子, 调整为收盘价
|
|
81267
|
+
{
|
|
81268
|
+
var kItem=kData.Data[xItem.KLine.DataIndex];
|
|
81269
|
+
var y = this.Frame.SubFrame[0].Frame.GetYFromData(kItem.Close);
|
|
81270
|
+
position.LastPoint.Y=y;
|
|
81271
|
+
}
|
|
81247
81272
|
}
|
|
81248
81273
|
|
|
81249
81274
|
return position;
|
|
@@ -82436,13 +82461,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
82436
82461
|
}
|
|
82437
82462
|
}
|
|
82438
82463
|
|
|
82439
|
-
this.LockCorssCursor=function()
|
|
82464
|
+
this.LockCorssCursor=function(option)
|
|
82440
82465
|
{
|
|
82441
82466
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
82442
82467
|
|
|
82443
82468
|
if (this.EnableNewIndex)
|
|
82444
82469
|
{
|
|
82445
|
-
if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return; //目前只支持连续交易时间段
|
|
82470
|
+
if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return false; //目前只支持连续交易时间段
|
|
82446
82471
|
|
|
82447
82472
|
xItem.Minute=
|
|
82448
82473
|
{
|
|
@@ -82458,13 +82483,19 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
82458
82483
|
}
|
|
82459
82484
|
|
|
82460
82485
|
xItem.Enable=true;
|
|
82486
|
+
|
|
82487
|
+
if (option && option.Draw) this.Draw();
|
|
82488
|
+
|
|
82489
|
+
return true;
|
|
82461
82490
|
}
|
|
82462
82491
|
|
|
82463
|
-
this.UnlockCorssCursor=function()
|
|
82492
|
+
this.UnlockCorssCursor=function(option)
|
|
82464
82493
|
{
|
|
82465
82494
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
82466
82495
|
xItem.Enable=false;
|
|
82467
82496
|
xItem.Minute=null;
|
|
82497
|
+
|
|
82498
|
+
if (option && option.Draw) this.Draw();
|
|
82468
82499
|
}
|
|
82469
82500
|
|
|
82470
82501
|
this.GetCorssCursorPosition=function()
|
|
@@ -85141,18 +85141,31 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
85141
85141
|
}
|
|
85142
85142
|
|
|
85143
85143
|
//十字光标解锁
|
|
85144
|
-
this.UnlockCorssCursor=function()
|
|
85144
|
+
this.UnlockCorssCursor=function(option)
|
|
85145
85145
|
{
|
|
85146
85146
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
85147
85147
|
xItem.Enable=false;
|
|
85148
85148
|
xItem.KLine=null;
|
|
85149
|
+
|
|
85150
|
+
if (option && option.Draw) this.Draw();
|
|
85149
85151
|
}
|
|
85150
85152
|
|
|
85151
|
-
this.LockCorssCursor=function()
|
|
85153
|
+
this.LockCorssCursor=function(option)
|
|
85152
85154
|
{
|
|
85155
|
+
if (this.CursorIndex<0) return false;
|
|
85156
|
+
var kData=this.GetKData();
|
|
85157
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false;
|
|
85158
|
+
|
|
85159
|
+
var dataIndex=kData.DataOffset+parseInt(this.CursorIndex.toFixed(0));
|
|
85160
|
+
var kItem=kData.Data[dataIndex];
|
|
85161
|
+
if (!kItem) return false;
|
|
85162
|
+
|
|
85153
85163
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
85154
|
-
xItem.KLine={ DataIndex:
|
|
85164
|
+
xItem.KLine={ DataIndex:dataIndex, Date:kItem.Date, Time:kItem.Time };
|
|
85155
85165
|
xItem.Enable=true;
|
|
85166
|
+
|
|
85167
|
+
if (option && option.Draw) this.Draw();
|
|
85168
|
+
return true;
|
|
85156
85169
|
}
|
|
85157
85170
|
|
|
85158
85171
|
this.GetCorssCursorPosition=function()
|
|
@@ -85168,7 +85181,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
85168
85181
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
85169
85182
|
if (xItem.Enable && xItem.KLine)
|
|
85170
85183
|
{
|
|
85171
|
-
|
|
85184
|
+
var kData=this.GetKData();
|
|
85185
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return position;
|
|
85186
|
+
|
|
85187
|
+
position.CursorIndex=xItem.KLine.DataIndex-kData.DataOffset;
|
|
85188
|
+
position.LastPoint.X=this.Frame.GetXFromIndex(position.CursorIndex);
|
|
85189
|
+
|
|
85190
|
+
var border=this.Frame.ChartBorder.GetBorder();
|
|
85191
|
+
if (position.LastPoint.Y<border.Top || position.LastPoint.Y>border.Bottom) //超出图形框子, 调整为收盘价
|
|
85192
|
+
{
|
|
85193
|
+
var kItem=kData.Data[xItem.KLine.DataIndex];
|
|
85194
|
+
var y = this.Frame.SubFrame[0].Frame.GetYFromData(kItem.Close);
|
|
85195
|
+
position.LastPoint.Y=y;
|
|
85196
|
+
}
|
|
85172
85197
|
}
|
|
85173
85198
|
|
|
85174
85199
|
return position;
|
|
@@ -86361,13 +86386,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
86361
86386
|
}
|
|
86362
86387
|
}
|
|
86363
86388
|
|
|
86364
|
-
this.LockCorssCursor=function()
|
|
86389
|
+
this.LockCorssCursor=function(option)
|
|
86365
86390
|
{
|
|
86366
86391
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
86367
86392
|
|
|
86368
86393
|
if (this.EnableNewIndex)
|
|
86369
86394
|
{
|
|
86370
|
-
if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return; //目前只支持连续交易时间段
|
|
86395
|
+
if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return false; //目前只支持连续交易时间段
|
|
86371
86396
|
|
|
86372
86397
|
xItem.Minute=
|
|
86373
86398
|
{
|
|
@@ -86383,13 +86408,19 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
86383
86408
|
}
|
|
86384
86409
|
|
|
86385
86410
|
xItem.Enable=true;
|
|
86411
|
+
|
|
86412
|
+
if (option && option.Draw) this.Draw();
|
|
86413
|
+
|
|
86414
|
+
return true;
|
|
86386
86415
|
}
|
|
86387
86416
|
|
|
86388
|
-
this.UnlockCorssCursor=function()
|
|
86417
|
+
this.UnlockCorssCursor=function(option)
|
|
86389
86418
|
{
|
|
86390
86419
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
86391
86420
|
xItem.Enable=false;
|
|
86392
86421
|
xItem.Minute=null;
|
|
86422
|
+
|
|
86423
|
+
if (option && option.Draw) this.Draw();
|
|
86393
86424
|
}
|
|
86394
86425
|
|
|
86395
86426
|
this.GetCorssCursorPosition=function()
|
|
@@ -111744,10 +111775,24 @@ function JSDraw(errorHandler,symbolData)
|
|
|
111744
111775
|
}
|
|
111745
111776
|
|
|
111746
111777
|
//表格
|
|
111747
|
-
this.TABLE_CELL=function(
|
|
111778
|
+
this.TABLE_CELL=function(data, color, textAlign, bgColor)
|
|
111748
111779
|
{
|
|
111780
|
+
var text=null;
|
|
111781
|
+
if (IFrameSplitOperator.IsString(data))
|
|
111782
|
+
{
|
|
111783
|
+
text=data;
|
|
111784
|
+
}
|
|
111785
|
+
else if (IFrameSplitOperator.IsNonEmptyArray(data))
|
|
111786
|
+
{
|
|
111787
|
+
var precision=2;
|
|
111788
|
+
var lastValue=data[data.length-1];
|
|
111789
|
+
if (IFrameSplitOperator.IsNumber(lastValue)) text=lastValue.toFixed(precision);
|
|
111790
|
+
else if (IFrameSplitOperator.IsString(lastValue)) text=lastValue;
|
|
111791
|
+
}
|
|
111792
|
+
|
|
111749
111793
|
var cellItem={ Text:text };
|
|
111750
111794
|
if (color) cellItem.Color=color;
|
|
111795
|
+
if (bgColor) cellItem.BGColor=bgColor;
|
|
111751
111796
|
if (IFrameSplitOperator.IsString(textAlign))
|
|
111752
111797
|
{
|
|
111753
111798
|
var strValue=textAlign.toLowerCase(); //转小写
|
|
@@ -118707,7 +118752,7 @@ function JSExecute(ast,option)
|
|
|
118707
118752
|
|
|
118708
118753
|
//表格函数
|
|
118709
118754
|
case "TABLE_CELL":
|
|
118710
|
-
node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2]);
|
|
118755
|
+
node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2],args[3]);
|
|
118711
118756
|
break;
|
|
118712
118757
|
case "TABLE_ROW":
|
|
118713
118758
|
node.Out=this.Draw.TABLE_ROW(args);
|
|
@@ -141308,7 +141353,7 @@ function ScrollBarBGChart()
|
|
|
141308
141353
|
|
|
141309
141354
|
|
|
141310
141355
|
|
|
141311
|
-
var HQCHART_VERSION="1.1.
|
|
141356
|
+
var HQCHART_VERSION="1.1.14294";
|
|
141312
141357
|
|
|
141313
141358
|
function PrintHQChartVersion()
|
|
141314
141359
|
{
|
|
@@ -85185,18 +85185,31 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
85185
85185
|
}
|
|
85186
85186
|
|
|
85187
85187
|
//十字光标解锁
|
|
85188
|
-
this.UnlockCorssCursor=function()
|
|
85188
|
+
this.UnlockCorssCursor=function(option)
|
|
85189
85189
|
{
|
|
85190
85190
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
85191
85191
|
xItem.Enable=false;
|
|
85192
85192
|
xItem.KLine=null;
|
|
85193
|
+
|
|
85194
|
+
if (option && option.Draw) this.Draw();
|
|
85193
85195
|
}
|
|
85194
85196
|
|
|
85195
|
-
this.LockCorssCursor=function()
|
|
85197
|
+
this.LockCorssCursor=function(option)
|
|
85196
85198
|
{
|
|
85199
|
+
if (this.CursorIndex<0) return false;
|
|
85200
|
+
var kData=this.GetKData();
|
|
85201
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false;
|
|
85202
|
+
|
|
85203
|
+
var dataIndex=kData.DataOffset+parseInt(this.CursorIndex.toFixed(0));
|
|
85204
|
+
var kItem=kData.Data[dataIndex];
|
|
85205
|
+
if (!kItem) return false;
|
|
85206
|
+
|
|
85197
85207
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
85198
|
-
xItem.KLine={ DataIndex:
|
|
85208
|
+
xItem.KLine={ DataIndex:dataIndex, Date:kItem.Date, Time:kItem.Time };
|
|
85199
85209
|
xItem.Enable=true;
|
|
85210
|
+
|
|
85211
|
+
if (option && option.Draw) this.Draw();
|
|
85212
|
+
return true;
|
|
85200
85213
|
}
|
|
85201
85214
|
|
|
85202
85215
|
this.GetCorssCursorPosition=function()
|
|
@@ -85212,7 +85225,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
85212
85225
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
85213
85226
|
if (xItem.Enable && xItem.KLine)
|
|
85214
85227
|
{
|
|
85215
|
-
|
|
85228
|
+
var kData=this.GetKData();
|
|
85229
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return position;
|
|
85230
|
+
|
|
85231
|
+
position.CursorIndex=xItem.KLine.DataIndex-kData.DataOffset;
|
|
85232
|
+
position.LastPoint.X=this.Frame.GetXFromIndex(position.CursorIndex);
|
|
85233
|
+
|
|
85234
|
+
var border=this.Frame.ChartBorder.GetBorder();
|
|
85235
|
+
if (position.LastPoint.Y<border.Top || position.LastPoint.Y>border.Bottom) //超出图形框子, 调整为收盘价
|
|
85236
|
+
{
|
|
85237
|
+
var kItem=kData.Data[xItem.KLine.DataIndex];
|
|
85238
|
+
var y = this.Frame.SubFrame[0].Frame.GetYFromData(kItem.Close);
|
|
85239
|
+
position.LastPoint.Y=y;
|
|
85240
|
+
}
|
|
85216
85241
|
}
|
|
85217
85242
|
|
|
85218
85243
|
return position;
|
|
@@ -86405,13 +86430,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
86405
86430
|
}
|
|
86406
86431
|
}
|
|
86407
86432
|
|
|
86408
|
-
this.LockCorssCursor=function()
|
|
86433
|
+
this.LockCorssCursor=function(option)
|
|
86409
86434
|
{
|
|
86410
86435
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
86411
86436
|
|
|
86412
86437
|
if (this.EnableNewIndex)
|
|
86413
86438
|
{
|
|
86414
|
-
if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return; //目前只支持连续交易时间段
|
|
86439
|
+
if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return false; //目前只支持连续交易时间段
|
|
86415
86440
|
|
|
86416
86441
|
xItem.Minute=
|
|
86417
86442
|
{
|
|
@@ -86427,13 +86452,19 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
86427
86452
|
}
|
|
86428
86453
|
|
|
86429
86454
|
xItem.Enable=true;
|
|
86455
|
+
|
|
86456
|
+
if (option && option.Draw) this.Draw();
|
|
86457
|
+
|
|
86458
|
+
return true;
|
|
86430
86459
|
}
|
|
86431
86460
|
|
|
86432
|
-
this.UnlockCorssCursor=function()
|
|
86461
|
+
this.UnlockCorssCursor=function(option)
|
|
86433
86462
|
{
|
|
86434
86463
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
86435
86464
|
xItem.Enable=false;
|
|
86436
86465
|
xItem.Minute=null;
|
|
86466
|
+
|
|
86467
|
+
if (option && option.Draw) this.Draw();
|
|
86437
86468
|
}
|
|
86438
86469
|
|
|
86439
86470
|
this.GetCorssCursorPosition=function()
|
|
@@ -111788,10 +111819,24 @@ function JSDraw(errorHandler,symbolData)
|
|
|
111788
111819
|
}
|
|
111789
111820
|
|
|
111790
111821
|
//表格
|
|
111791
|
-
this.TABLE_CELL=function(
|
|
111822
|
+
this.TABLE_CELL=function(data, color, textAlign, bgColor)
|
|
111792
111823
|
{
|
|
111824
|
+
var text=null;
|
|
111825
|
+
if (IFrameSplitOperator.IsString(data))
|
|
111826
|
+
{
|
|
111827
|
+
text=data;
|
|
111828
|
+
}
|
|
111829
|
+
else if (IFrameSplitOperator.IsNonEmptyArray(data))
|
|
111830
|
+
{
|
|
111831
|
+
var precision=2;
|
|
111832
|
+
var lastValue=data[data.length-1];
|
|
111833
|
+
if (IFrameSplitOperator.IsNumber(lastValue)) text=lastValue.toFixed(precision);
|
|
111834
|
+
else if (IFrameSplitOperator.IsString(lastValue)) text=lastValue;
|
|
111835
|
+
}
|
|
111836
|
+
|
|
111793
111837
|
var cellItem={ Text:text };
|
|
111794
111838
|
if (color) cellItem.Color=color;
|
|
111839
|
+
if (bgColor) cellItem.BGColor=bgColor;
|
|
111795
111840
|
if (IFrameSplitOperator.IsString(textAlign))
|
|
111796
111841
|
{
|
|
111797
111842
|
var strValue=textAlign.toLowerCase(); //转小写
|
|
@@ -118751,7 +118796,7 @@ function JSExecute(ast,option)
|
|
|
118751
118796
|
|
|
118752
118797
|
//表格函数
|
|
118753
118798
|
case "TABLE_CELL":
|
|
118754
|
-
node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2]);
|
|
118799
|
+
node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2],args[3]);
|
|
118755
118800
|
break;
|
|
118756
118801
|
case "TABLE_ROW":
|
|
118757
118802
|
node.Out=this.Draw.TABLE_ROW(args);
|
|
@@ -150956,7 +151001,7 @@ function HQChartScriptWorker()
|
|
|
150956
151001
|
|
|
150957
151002
|
|
|
150958
151003
|
|
|
150959
|
-
var HQCHART_VERSION="1.1.
|
|
151004
|
+
var HQCHART_VERSION="1.1.14294";
|
|
150960
151005
|
|
|
150961
151006
|
function PrintHQChartVersion()
|
|
150962
151007
|
{
|