hqchart 1.1.12973 → 1.1.12977
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 +12 -9
- package/package.json +1 -1
- package/src/jscommon/umychart.complier.js +8 -1
- package/src/jscommon/umychart.index.data.js +2 -1
- package/src/jscommon/umychart.js +4 -1
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +15 -4
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +15 -4
package/lib/umychart.vue.js
CHANGED
|
@@ -50,7 +50,7 @@ JSNetwork.HttpReqeust=function(obj) //对请求进行封装
|
|
|
50
50
|
Condition: 限制条件 { Symbol:'Index'/'Stock'(只支持指数/股票),Period:[](支持的周期), Include:[](指定支持的股票,代码全部大写包括后缀, Message:"提示信息")}
|
|
51
51
|
OutName:动态输出变量名字 [{Name:原始变量名, DynamicName:动态名字格式}] 如 {Name:"MA1", DynamicName:"MA{M1}"};
|
|
52
52
|
SplitType: Y轴分割类型,
|
|
53
|
-
YAxis:{ FloatPrecision:小数位数, StringFormat:, EnableRemoveZero } //Y轴刻度输出格式
|
|
53
|
+
YAxis:{ FloatPrecision:小数位数, StringFormat:, EnableRemoveZero, ExcludeValue:不参数Y轴的计算 } //Y轴刻度输出格式
|
|
54
54
|
*///周期条件枚举
|
|
55
55
|
var CONDITION_PERIOD={MINUTE_ID:101,//分钟 走势图
|
|
56
56
|
MULTIDAY_MINUTE_ID:102,//多日分钟 走势图
|
|
@@ -69,7 +69,8 @@ this.Get=function(id){if(!this.DataMap.has(id))return null;return this.DataMap.g
|
|
|
69
69
|
]);}JSIndexScript.AddIndex=function(aryIndex)//添加自定义指标
|
|
70
70
|
{for(var i in aryIndex){g_CustomIndex.Add(aryIndex[i]);}};//修改指标属性
|
|
71
71
|
JSIndexScript.ModifyAttribute=function(indexInfo,attribute){if(!attribute)return;if(attribute.Args)indexInfo.Args=attribute.Args;//外部可以设置参数
|
|
72
|
-
if(IFrameSplitOperator.IsNumber(attribute.FloatPrecision))indexInfo.FloatPrecision=attribute.FloatPrecision;if(IFrameSplitOperator.IsNumber(attribute.StringFormat))indexInfo.StringFormat=attribute.StringFormat;if(IFrameSplitOperator.IsBool(attribute.IsSync))indexInfo.IsSync=attribute.IsSync;if(IFrameSplitOperator.IsBool(attribute.IsShortTitle))indexInfo.IsShortTitle=attribute.IsShortTitle;if(attribute.TitleFont)indexInfo.TitleFont=attribute.TitleFont;if(attribute.Lock)indexInfo.Lock=attribute.Lock;if(IFrameSplitOperator.IsNumber(attribute.YSplitType))indexInfo.YSplitType=attribute.YSplitType;if(IFrameSplitOperator.IsBool(attribute.IsShowIndexTitle))indexInfo.IsShowIndexTitle=attribute.IsShowIndexTitle;if(IFrameSplitOperator.IsNumber(attribute.KLineType))indexInfo.KLineType=attribute.KLineType;if(attribute.YAxis){var item=attribute.YAxis;if(!indexInfo.YAxis)indexInfo.YAxis={};if(IFrameSplitOperator.IsNumber(item.FloatPrecision))indexInfo.YAxis.FloatPrecision=item.FloatPrecision;if(IFrameSplitOperator.IsNumber(item.StringFormat))indexInfo.YAxis.StringFormat=item.StringFormat;if(IFrameSplitOperator.IsBool(item.EnableRemoveZero))indexInfo.YAxis.EnableRemoveZero=item.EnableRemoveZero;
|
|
72
|
+
if(IFrameSplitOperator.IsNumber(attribute.FloatPrecision))indexInfo.FloatPrecision=attribute.FloatPrecision;if(IFrameSplitOperator.IsNumber(attribute.StringFormat))indexInfo.StringFormat=attribute.StringFormat;if(IFrameSplitOperator.IsBool(attribute.IsSync))indexInfo.IsSync=attribute.IsSync;if(IFrameSplitOperator.IsBool(attribute.IsShortTitle))indexInfo.IsShortTitle=attribute.IsShortTitle;if(attribute.TitleFont)indexInfo.TitleFont=attribute.TitleFont;if(attribute.Lock)indexInfo.Lock=attribute.Lock;if(IFrameSplitOperator.IsNumber(attribute.YSplitType))indexInfo.YSplitType=attribute.YSplitType;if(IFrameSplitOperator.IsBool(attribute.IsShowIndexTitle))indexInfo.IsShowIndexTitle=attribute.IsShowIndexTitle;if(IFrameSplitOperator.IsNumber(attribute.KLineType))indexInfo.KLineType=attribute.KLineType;if(attribute.YAxis){var item=attribute.YAxis;if(!indexInfo.YAxis)indexInfo.YAxis={};if(IFrameSplitOperator.IsNumber(item.FloatPrecision))indexInfo.YAxis.FloatPrecision=item.FloatPrecision;if(IFrameSplitOperator.IsNumber(item.StringFormat))indexInfo.YAxis.StringFormat=item.StringFormat;if(IFrameSplitOperator.IsBool(item.EnableRemoveZero))indexInfo.YAxis.EnableRemoveZero=item.EnableRemoveZero;if(IFrameSplitOperator.IsBool(item.ExcludeValue))indexInfo.YAxis.ExcludeValue=attribute.ExcludeValue;//不参数Y轴的计算
|
|
73
|
+
}};JSIndexScript.prototype.Get=function(id){var data=g_CustomIndex.Get(id);if(data)return data;var func=this.DataMap.get(id);if(func){var data=func();data.ID=id;return data;}return null;};JSIndexScript.prototype.Search=function(name){var result=[];var reg=new RegExp(name,'i');this.DataMap.forEach(function(value,key){if(key.indexOf('交易系统-')!=0&&key.indexOf('五彩K线-')!=0&&key.search(reg)>=0)result.push(key);});return result;};JSIndexScript.prototype.MA=function(){var data={Name:'MA',Description:'均线',IsMainIndex:true,StringFormat:2,Args:[{Name:'M1',Value:5},{Name:'M2',Value:10},{Name:'M3',Value:20}],OutName:[{Name:'MA1',DynamicName:"MA{M1}"},{Name:'MA2',DynamicName:"MA{M2}"},{Name:'MA3',DynamicName:"MA{M3}"}],Script://脚本
|
|
73
74
|
'MA1:MA(CLOSE,M1);\n\
|
|
74
75
|
MA2:MA(CLOSE,M2);\n\
|
|
75
76
|
MA3:MA(CLOSE,M3);'};return data;};JSIndexScript.prototype.MA4=function(){var data={Name:'MA',Description:'均线',IsMainIndex:true,StringFormat:2,Args:[{Name:'M1',Value:5},{Name:'M2',Value:10},{Name:'M3',Value:20},{Name:'M4',Value:60}],OutName:[{Name:'MA1',DynamicName:"MA{M1}"},{Name:'MA2',DynamicName:"MA{M2}"},{Name:'MA3',DynamicName:"MA{M3}"},{Name:'MA4',DynamicName:"MA{M4}"}],Script://脚本
|
|
@@ -1771,7 +1772,7 @@ SingleOverlay:[]//独立坐标
|
|
|
1771
1772
|
};for(var j=0;j<subItem.OverlayIndex.length;++j){var overlayItem=subItem.OverlayIndex[j];var overlayFrame=overlayItem.Frame;if(overlayFrame.IsShareY){if(!overlayFrame.MainFrame)continue;if(overlayFrame.IsCalculateYMaxMin===false)continue;//叠加坐标Y轴不调整
|
|
1772
1773
|
item.OverlayFrame.push(overlayFrame);for(var k=0;k<overlayItem.ChartPaint.length;++k){var chart=overlayItem.ChartPaint[k];item.ChartPaint.push(chart);}}else{item.SingleOverlay.push(overlayItem);}}mapFrame.set(key,item);}for(var i=0;i<this.ChartPaint.length;++i){var chart=this.ChartPaint[i];var key=chart.ChartFrame.Identify;if(!mapFrame.has(key))continue;var finder=mapFrame.get(key);finder.ChartPaint.push(chart);}for(var i=0;i<this.OverlayChartPaint.length;++i){var chart=this.OverlayChartPaint[i];if(!chart.ChartFrame)continue;var key=chart.ChartFrame.Identify;if(!mapFrame.has(key))continue;var finder=mapFrame.get(key);finder.ChartPaint.push(chart);}var _iteratorNormalCompletion3=true;var _didIteratorError3=false;var _iteratorError3=undefined;try{for(var _iterator3=(0,_getIterator3.default)(mapFrame),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var mapItem=_step3.value;var item=mapItem[1];var frame=item.Frame;//计算主框架最大最小
|
|
1773
1774
|
for(var i=0;i<item.ChartPaint.length;++i){var chart=item.ChartPaint[i];if(chart.IsShow==false)continue;//隐藏的图形不计算
|
|
1774
|
-
if(chart.NotSupportMessage)continue;if(!chart.ChartFrame)continue;var range=chart.GetMaxMin();if(range==null||range.Max==null||range.Min==null)continue;if(item.Max==null||item.Max<range.Max)item.Max=range.Max;if(item.Min==null||item.Min>range.Min)item.Min=range.Min;}if(item.Frame.YSpecificMaxMin)//固定坐标
|
|
1775
|
+
if(chart.NotSupportMessage)continue;if(!chart.ChartFrame)continue;if(chart.IsExcludeYValue===true)continue;var range=chart.GetMaxMin();if(range==null||range.Max==null||range.Min==null)continue;if(item.Max==null||item.Max<range.Max)item.Max=range.Max;if(item.Min==null||item.Min>range.Min)item.Min=range.Min;}if(item.Frame.YSpecificMaxMin)//固定坐标
|
|
1775
1776
|
{item.Min=item.Frame.YSpecificMaxMin.Max;item.Max=item.Frame.YSpecificMaxMin.Min;}if(!IFrameSplitOperator.IsNumber(frame.YMaxMin.Max)||frame.YMaxMin.Max!=item.Max){frame.YMaxMin.Max=item.Max;frame.XYSplit=true;}if(!IFrameSplitOperator.IsNumber(frame.YMaxMin.Min)||frame.YMaxMin.Min!=item.Min){frame.YMaxMin.Min=item.Min;frame.XYSplit=true;}if(frame.XYSplit){var max=10,min=0;if(item.Max!=null)max=item.Max;if(item.Min!=null)min=item.Min;frame.HorizontalMax=max;frame.HorizontalMin=min;}else{frame.XSplit=true;}//共享Y轴叠加指标同步下坐标
|
|
1776
1777
|
for(var j=0;j<item.OverlayFrame.length;++j){item.OverlayFrame[j].XYSplit=true;}//独立坐标叠加指标
|
|
1777
1778
|
for(var i=0;i<item.SingleOverlay.length;++i){var overlayItem=item.SingleOverlay[i];overlayItem.UpdateFrameMaxMin();}}}catch(err){_didIteratorError3=true;_iteratorError3=err;}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return){_iterator3.return();}}finally{if(_didIteratorError3){throw _iteratorError3;}}}};this.UpdateFrameMaxMin=function(){this.UpdateFrameMaxMinV2();return;var frameMaxMinData=new Array();var chartPaint=new Array();for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(item.IsShow==false)continue;//隐藏的图形不计算
|
|
@@ -3018,6 +3019,7 @@ this.GetEventCallback;this.SelectedLineWidth=g_JSChartResource.SelectedChart.Lin
|
|
|
3018
3019
|
this.SelectedBGColor=g_JSChartResource.SelectedChart.BGColor;this.DrawSelectedStatus;//function() { } //选中状态
|
|
3019
3020
|
this.PtInChart;//function(x,y) { }
|
|
3020
3021
|
this.IsFullRangeMaxMin=false;//this.GetMaxMin() true=计算全部的最大最小值 false=计算可视范围的最大最小值
|
|
3022
|
+
this.IsExcludeYValue=false;//不参与Y轴计算
|
|
3021
3023
|
this.Draw=function(){};//数据导出 数据格式 [{ Title:数据名称, Data:[] }]
|
|
3022
3024
|
//this.ExportData=function(aryKData) { }
|
|
3023
3025
|
this.GetBorder=function(){if(this.ChartFrame.IsHScreen)return this.ChartBorder.GetHScreenBorder();return this.ChartBorder.GetBorder();};this.ClipClient=function(isHScreen)//裁剪客户端
|
|
@@ -3748,7 +3750,7 @@ this.newMethod();delete this.newMethod;this.ClassName='ChartPointDot';//类名
|
|
|
3748
3750
|
this.Color="rgb(255,193,37)";//线段颜色
|
|
3749
3751
|
this.Radius=1;//点半径
|
|
3750
3752
|
this.EnableUpDownColor=false;//是否是红绿点
|
|
3751
|
-
this.HistoryData;this.ExportData=this.ExportArrayData;this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize)return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}if(!this.Data||!this.Data.Data)return;var bHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var chartright=this.ChartBorder.GetRight();if(bHScreen===true)chartright=this.ChartBorder.GetBottom();var xPointCount=this.ChartFrame.XPointCount;this.Canvas.save();this.Canvas.fillStyle=this.Color;var colorDot;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j){var value=this.Data.Data[i];if(value==null)continue;var x=this.ChartFrame.GetXFromIndex(j);var y=this.ChartFrame.GetYFromData(value);if(x>chartright)break;if(this.EnableUpDownColor){var kItem=this.HistoryData.Data[i];if(kItem.Close>value)colorDot="rgb(255,61,61)";else colorDot='rgb(0,199,65)';this.Canvas.fillStyle=colorDot;}this.Canvas.beginPath();if(bHScreen)this.Canvas.arc(y,x,this.Radius,0,Math.PI*2,true);else this.Canvas.arc(x,y,this.Radius,0,Math.PI*2,true);this.Canvas.closePath();this.Canvas.fill();}this.Canvas.restore();};}//通达信语法 STICK 支持横屏
|
|
3753
|
+
this.HistoryData;this.ExportData=this.ExportArrayData;this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize)return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}if(!this.Data||!this.Data.Data)return;var bHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var chartright=this.ChartBorder.GetRight();if(bHScreen===true)chartright=this.ChartBorder.GetBottom();var xPointCount=this.ChartFrame.XPointCount;this.Canvas.save();this.ClipClient(bHScreen);this.Canvas.fillStyle=this.Color;var colorDot;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j){var value=this.Data.Data[i];if(value==null)continue;var x=this.ChartFrame.GetXFromIndex(j);var y=this.ChartFrame.GetYFromData(value,false);if(x>chartright)break;if(this.EnableUpDownColor){var kItem=this.HistoryData.Data[i];if(kItem.Close>value)colorDot="rgb(255,61,61)";else colorDot='rgb(0,199,65)';this.Canvas.fillStyle=colorDot;}this.Canvas.beginPath();if(bHScreen)this.Canvas.arc(y,x,this.Radius,0,Math.PI*2,true);else this.Canvas.arc(x,y,this.Radius,0,Math.PI*2,true);this.Canvas.closePath();this.Canvas.fill();}this.Canvas.restore();};}//通达信语法 STICK 支持横屏
|
|
3752
3754
|
function ChartStick(){this.newMethod=IChartPainting;//派生
|
|
3753
3755
|
this.newMethod();delete this.newMethod;this.Color="rgb(255,193,37)";//线段颜色
|
|
3754
3756
|
this.LineWidth;//线段宽度
|
|
@@ -11069,7 +11071,7 @@ this.OutVarTable=[];//输出变量
|
|
|
11069
11071
|
//脚本自动变量表, 只读
|
|
11070
11072
|
this.ConstVarTable=new _map2.default([//个股数据
|
|
11071
11073
|
['CLOSE',"收盘价"],['VOL',"成交量"],['OPEN',"开盘价"],['HIGH',"最高价"],['LOW',"最低价"],['AMOUNT',"成交量"],['C',"收盘价"],['V',"成交量"],['O',"开盘价"],['H',"最高价"],['L',"最低价"],['AMO',"成交量"],['VOLR',"量比"],['VOLINSTK',"持仓量"],["OPI","持仓量"],["ZSTJJ","均价"],["QHJSJ","结算价"],["SETTLE","结算价"],//日期类
|
|
11072
|
-
['DATE',"日期"],['YEAR',"年份"],['MONTH',"月份"],['PERIOD',"周期"],['WEEK',"星期"],["TIME","时间"],//大盘数据
|
|
11074
|
+
['DATE',"日期"],['YEAR',"年份"],['MONTH',"月份"],["DAY","日"],['PERIOD',"周期"],['WEEK',"星期"],["TIME","时间"],//大盘数据
|
|
11073
11075
|
['INDEXA',"大盘成交额"],['INDEXC',"大盘收盘价"],['INDEXH',"大盘最高价"],['INDEXL',"大盘最低价"],['INDEXO',"大盘开盘价"],['INDEXV',"大盘成交量"],['INDEXADV',"大盘上涨家数"],['INDEXDEC',"´大盘下跌家数"],["ADVANCE","上涨家数"],['DECLINE',"下跌家数"],['FROMOPEN',"当前离开盘分钟数"],['TOTALFZNUM',"总分钟数"],['CURRBARSCOUNT',"到最后交易的周期"],//到最后交易日的周期数
|
|
11074
11076
|
['TOTALBARSCOUNT',"总的周期数"],['ISLASTBAR',"是否是最后一个周期"],//判断是否为最后一个周期
|
|
11075
11077
|
['BARSTATUS',"数据位置状态"],//BARSTATUS返回数据位置信息,1表示第一根K线,2表示最后一个数据,0表示中间位置.
|
|
@@ -11193,7 +11195,8 @@ this.MaxRunCount=-1;//最大执行次数 -1=无限
|
|
|
11193
11195
|
if(option){if(option.FloatPrecision>=0)this.FloatPrecision=option.FloatPrecision;if(option.StringFormat>0)this.StringFormat=option.StringFormat;if(IFrameSplitOperator.IsBool(option.IsShowIndexTitle))this.IsShowIndexTitle=option.IsShowIndexTitle;if(option.ID)this.ID=option.ID;if(option.KLineType>=0||option.KLineType===-1)this.KLineType=option.KLineType;if(option.InstructionType)this.InstructionType=option.InstructionType;if(option.YSpecificMaxMin)this.YSpecificMaxMin=option.YSpecificMaxMin;if(option.YSplitScale)this.YSplitScale=option.YSplitScale;if(option.Condition)this.Condition=option.Condition;if(option.TitleFont)this.TitleFont=option.TitleFont;if(option.IsShortTitle)this.IsShortTitle=option.IsShortTitle;if(option.OutName)this.OutName=option.OutName;if(IFrameSplitOperator.IsNumber(option.YSplitType))this.YSplitType=option.YSplitType;if(IFrameSplitOperator.IsBool(option.IsSync))this.IsSync=option.IsSync;if(IFrameSplitOperator.IsNumber(option.MaxRunCount))this.MaxRunCount=option.MaxRunCount;if(option.Debug){if(IFrameSplitOperator.IsPlusNumber(option.Debug.Count)&&option.Debug.Callback){this.Debug={Count:option.Debug.Count,Callback:option.Debug.Callback};}}}if(option&&option.Lock){if(option.Lock.IsLocked==true)this.IsLocked=true;//指标上锁
|
|
11194
11196
|
if(option.Lock.Callback)this.LockCallback=option.Lock.Callback;//锁回调
|
|
11195
11197
|
if(option.Lock.ID)this.LockID=option.Lock.ID;//锁ID
|
|
11196
|
-
if(option.Lock.BG)this.LockBG=option.Lock.BG;if(option.Lock.TextColor)this.LockTextColor=option.Lock.TextColor;if(option.Lock.Text)this.LockText=option.Lock.Text;if(option.Lock.Font)this.LockFont=option.Lock.Font;if(option.Lock.Count)this.LockCount=option.Lock.Count;if(option.Lock.MinWidth)this.LockMinWidth=option.Lock.MinWidth*GetDevicePixelRatio();}if(option&&option.YAxis){this.YAxis={};if(IFrameSplitOperator.IsNumber(option.YAxis.FloatPrecision))this.YAxis.FloatPrecision=option.YAxis.FloatPrecision;if(IFrameSplitOperator.IsNumber(option.YAxis.StringFormat))this.YAxis.StringFormat=option.YAxis.StringFormat;if(IFrameSplitOperator.IsBool(option.YAxis.EnableRemoveZero))this.YAxis.EnableRemoveZero=option.YAxis.EnableRemoveZero;
|
|
11198
|
+
if(option.Lock.BG)this.LockBG=option.Lock.BG;if(option.Lock.TextColor)this.LockTextColor=option.Lock.TextColor;if(option.Lock.Text)this.LockText=option.Lock.Text;if(option.Lock.Font)this.LockFont=option.Lock.Font;if(option.Lock.Count)this.LockCount=option.Lock.Count;if(option.Lock.MinWidth)this.LockMinWidth=option.Lock.MinWidth*GetDevicePixelRatio();}if(option&&option.YAxis){this.YAxis={};if(IFrameSplitOperator.IsNumber(option.YAxis.FloatPrecision))this.YAxis.FloatPrecision=option.YAxis.FloatPrecision;if(IFrameSplitOperator.IsNumber(option.YAxis.StringFormat))this.YAxis.StringFormat=option.YAxis.StringFormat;if(IFrameSplitOperator.IsBool(option.YAxis.EnableRemoveZero))this.YAxis.EnableRemoveZero=option.YAxis.EnableRemoveZero;if(IFrameSplitOperator.IsBool(option.YAxis.ExcludeValue))this.YAxis.ExcludeValue=option.YAxis.ExcludeValue;//不参数Y轴的计算
|
|
11199
|
+
}if(args)this.Arguments=args;this.CopyTo=function(dest)//赋值到新实例出来
|
|
11197
11200
|
{dest.FloatPrecision=this.FloatPrecision;dest.StringFormat=this.StringFormat;dest.KLineType=this.KLineType;dest.InstructionType=this.InstructionType;dest.Condition=this.Condition;dest.TitleFont=this.TitleFont;dest.IsShortTitle=this.IsShortTitle;dest.OutName=this.OutName;dest.Arguments=this.Arguments;dest.Script=this.Script;dest.Name=this.Name;dest.ID=this.ID;};this.SetLock=function(lockData){if(lockData.IsLocked==true){this.IsLocked=true;//指标上锁
|
|
11198
11201
|
if(lockData.Callback)this.LockCallback=lockData.Callback;//锁回调
|
|
11199
11202
|
if(lockData.ID)this.LockID=lockData.ID;//锁ID
|
|
@@ -11221,7 +11224,7 @@ param.HQChart.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
|
11221
11224
|
if(param.Self.IsSync===false)//异步需要马上刷新,同步主图数据更新的时候会刷新的
|
|
11222
11225
|
param.HQChart.Draw();if(hqChart.GetIndexEvent){var event=hqChart.GetIndexEvent();//指标计算完成回调
|
|
11223
11226
|
if(event){var self=param.Self;var data={OutVar:self.OutVar,WindowIndex:windowIndex,Name:self.Name,Arguments:self.Arguments,HistoryData:hisData,Stock:{Symbol:hqChart.Symbol,Name:hqChart.Name}};event.Callback(event,data,self);}}};//给图形设置指标名字
|
|
11224
|
-
this.SetChartIndexName=function(chart){if(this.Name)chart.IndexName=this.Name;else if(this.ID)chart.IndexName==this.ID;if(this.ID)chart.IndexID=this.ID;chart.Script=this;//指标内容绑定上去
|
|
11227
|
+
this.SetChartIndexName=function(chart){if(this.Name)chart.IndexName=this.Name;else if(this.ID)chart.IndexName==this.ID;if(this.ID)chart.IndexID=this.ID;if(this.YAxis){if(IFrameSplitOperator.IsBool(this.YAxis.ExcludeValue))chart.IsExcludeYValue=this.YAxis.ExcludeValue;}chart.Script=this;//指标内容绑定上去
|
|
11225
11228
|
};//设置标题数据
|
|
11226
11229
|
this.SetTitleData=function(titleData,chart){titleData.ChartClassName=chart.ClassName;titleData.IsVisible=chart.IsVisible;};//自定义图形配色
|
|
11227
11230
|
this.ReloadChartResource=function(hqChart,windowIndex,chart){var event=hqChart.GetEventCallback(JSCHART_EVENT_ID.ON_RELOAD_INDEX_CHART_RESOURCE);//指标计算完成回调
|
|
@@ -11244,7 +11247,7 @@ hqChart.ChartPaint.push(chartText);};//DRAWTEXT
|
|
|
11244
11247
|
this.CreateDrawTextV2=function(hqChart,windowIndex,varItem,id){var chartText=new ChartDrawText();chartText.Canvas=hqChart.Canvas;chartText.Name=varItem.Name;chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chartText.ReloadResource();if(varItem.Color)chartText.Color=this.GetColor(varItem.Color);else chartText.Color=this.GetDefaultColor(id);if(varItem.IsDrawCenter===true)chartText.TextAlign='center';if(varItem.IsDrawAbove===true)chartText.TextBaseline='bottom';if(varItem.IsDrawBelow===true)chartText.TextBaseline='top';if(varItem.Draw.DrawData)chartText.Data.Data=varItem.Draw.DrawData;chartText.Text=varItem.Draw.Text;if(varItem.Draw.Direction>0)chartText.Direction=varItem.Draw.Direction;if(varItem.Draw.YOffset>0)chartText.YOffset=varItem.Draw.YOffset;if(varItem.Draw.TextAlign)chartText.TextAlign=varItem.Draw.TextAlign;//指定输出位置
|
|
11245
11248
|
if(varItem.Draw.FixedPosition==="TOP")chartText.FixedPosition=1;else if(varItem.Draw.FixedPosition==="BOTTOM")chartText.FixedPosition=2;if(varItem.DrawVAlign>=0){if(varItem.DrawVAlign==0)chartText.TextBaseline='top';else if(varItem.DrawVAlign==1)chartText.TextBaseline='middle';else if(varItem.DrawVAlign==2)chartText.TextBaseline='bottom';}if(varItem.DrawAlign>=0){if(varItem.DrawAlign==0)chartText.TextAlign="left";else if(varItem.DrawAlign==1)chartText.TextAlign="center";else if(varItem.DrawAlign==2)chartText.TextAlign='right';}if(varItem.DrawFontSize>0)chartText.FixedFontSize=varItem.DrawFontSize;if(varItem.Background)chartText.TextBG=varItem.Background;if(varItem.VerticalLine)chartText.VerticalLine=varItem.VerticalLine;if(IFrameSplitOperator.IsNumber(varItem.YOffset))chartText.ShowOffset.Y=varItem.YOffset;if(IFrameSplitOperator.IsNumber(varItem.XOffset))chartText.ShowOffset.X=varItem.XOffset;var titleIndex=windowIndex+1;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
11246
11249
|
hqChart.ChartPaint.push(chartText);};//COLORSTICK
|
|
11247
|
-
this.CreateMACD=function(hqChart,windowIndex,varItem,id){var chartMACD=new ChartMACD();chartMACD.Canvas=hqChart.Canvas;chartMACD.Identify=this.Guid;chartMACD.Name=varItem.Name;chartMACD.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chartMACD.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chartMACD.LineWidth=width;}var titleIndex=windowIndex+1;chartMACD.Data.Data=varItem.Data;var clrTitle=this.GetDefaultColor(id);if(varItem.Color)clrTitle=this.GetColor(varItem.Color);if(varItem.UpColor)chartMACD.UpColor=varItem.UpColor;if(varItem.DownColor)chartMACD.DownColor=varItem.DownColor;this.ReloadChartResource(hqChart,windowIndex,chartMACD);hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(chartMACD.Data,varItem.Name,clrTitle);this.SetChartIndexName(chartMACD);hqChart.ChartPaint.push(chartMACD);};this.CreatePointDot=function(hqChart,windowIndex,varItem,id,hisData){var pointDot=new ChartPointDot();pointDot.Canvas=hqChart.Canvas;pointDot.Name=varItem.Name;pointDot.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;pointDot.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)pointDot.Color=this.GetColor(varItem.Color);else pointDot.Color=this.GetDefaultColor(id);if(varItem.Radius)pointDot.Radius=varItem.Radius;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)pointDot.Radius=width;}if(IFrameSplitOperator.IsBool(varItem.UpDownDot)){pointDot.EnableUpDownColor=varItem.UpDownDot;pointDot.HistoryData=hisData;}var titleIndex=windowIndex+1;pointDot.Data.Data=varItem.Data;hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(pointDot.Data,varItem.Name,pointDot.Color);hqChart.ChartPaint.push(pointDot);};this.CreateStick=function(hqChart,windowIndex,varItem,id){var chart=new ChartStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;this.ReloadChartResource(hqChart,windowIndex,chart);hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateLineStick=function(hqChart,windowIndex,varItem,id){var chart=new ChartLineStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);hqChart.ChartPaint.push(chart);};this.CreateStraightLine=function(hqChart,windowIndex,varItem,id){var line=new ChartLine();line.DrawType=1;line.Canvas=hqChart.Canvas;line.Name=varItem.Name;line.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;line.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)line.Color=this.GetColor(varItem.Color);else line.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)line.LineWidth=width;}var titleIndex=windowIndex+1;line.Data.Data=varItem.Draw.DrawData;if(varItem.Name=="DRAWLINE")hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,null,line.Color);//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,varItem.Name,line.Color);
|
|
11250
|
+
this.CreateMACD=function(hqChart,windowIndex,varItem,id){var chartMACD=new ChartMACD();chartMACD.Canvas=hqChart.Canvas;chartMACD.Identify=this.Guid;chartMACD.Name=varItem.Name;chartMACD.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chartMACD.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chartMACD.LineWidth=width;}var titleIndex=windowIndex+1;chartMACD.Data.Data=varItem.Data;var clrTitle=this.GetDefaultColor(id);if(varItem.Color)clrTitle=this.GetColor(varItem.Color);if(varItem.UpColor)chartMACD.UpColor=varItem.UpColor;if(varItem.DownColor)chartMACD.DownColor=varItem.DownColor;this.ReloadChartResource(hqChart,windowIndex,chartMACD);hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(chartMACD.Data,varItem.Name,clrTitle);this.SetChartIndexName(chartMACD);hqChart.ChartPaint.push(chartMACD);};this.CreatePointDot=function(hqChart,windowIndex,varItem,id,hisData){var pointDot=new ChartPointDot();pointDot.Canvas=hqChart.Canvas;pointDot.Name=varItem.Name;pointDot.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;pointDot.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)pointDot.Color=this.GetColor(varItem.Color);else pointDot.Color=this.GetDefaultColor(id);if(varItem.Radius)pointDot.Radius=varItem.Radius;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)pointDot.Radius=width;}if(IFrameSplitOperator.IsBool(varItem.UpDownDot)){pointDot.EnableUpDownColor=varItem.UpDownDot;pointDot.HistoryData=hisData;}var titleIndex=windowIndex+1;pointDot.Data.Data=varItem.Data;hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(pointDot.Data,varItem.Name,pointDot.Color);this.SetChartIndexName(pointDot);hqChart.ChartPaint.push(pointDot);};this.CreateStick=function(hqChart,windowIndex,varItem,id){var chart=new ChartStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;this.ReloadChartResource(hqChart,windowIndex,chart);hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateLineStick=function(hqChart,windowIndex,varItem,id){var chart=new ChartLineStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);hqChart.ChartPaint.push(chart);};this.CreateStraightLine=function(hqChart,windowIndex,varItem,id){var line=new ChartLine();line.DrawType=1;line.Canvas=hqChart.Canvas;line.Name=varItem.Name;line.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;line.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)line.Color=this.GetColor(varItem.Color);else line.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)line.LineWidth=width;}var titleIndex=windowIndex+1;line.Data.Data=varItem.Draw.DrawData;if(varItem.Name=="DRAWLINE")hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,null,line.Color);//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,varItem.Name,line.Color);
|
|
11248
11251
|
hqChart.ChartPaint.push(line);};this.CreateVolStick=function(hqChart,windowIndex,varItem,id,hisData){var chart=new ChartVolStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.KLineDrawType=hqChart.KLineDrawType;//设置K线显示类型
|
|
11249
11252
|
chart.Identify=this.Guid;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.UpColor)chart.UpColor=varItem.UpColor;if(varItem.DownColor)chart.DownColor=varItem.DownColor;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(IFrameSplitOperator.IsPlusNumber(width))chart.BarWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;chart.HistoryData=hisData;this.ReloadChartResource(hqChart,windowIndex,chart);var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);hqChart.TitlePaint[titleIndex].Data[id]=titleData;this.SetTitleData(titleData,chart);this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateBand=function(hqChart,windowIndex,varItem,id){var chart=new ChartBand();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.FirstColor=varItem.Draw.Color[0];chart.SecondColor=varItem.Draw.Color[1];chart.Data.Data=varItem.Draw.DrawData;if(IFrameSplitOperator.IsBool(varItem.IsFirstDraw))chart.IsDrawFirst=varItem.IsFirstDraw;hqChart.ChartPaint.push(chart);};this.CreateFillRGN=function(hqChart,windowIndex,varItem,id){var chart=new ChartLineArea();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data.Data=varItem.Draw.DrawData;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);hqChart.ChartPaint.push(chart);};this.CreateFillRGN2=function(hqChart,windowIndex,varItem,id){var chart=new ChartFillRGN();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};this.CreateFillBGRGN=function(hqChart,windowIndex,varItem,id){var chart=new ChartFillBGRGN();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};this.CreateFLOATRGN=function(hqChart,windowIndex,varItem,id){var chart=new ChartFLOATRGN();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};//创建K线图
|
|
11250
11253
|
this.CreateKLine=function(hqChart,windowIndex,varItem,id){var chart=new ChartKLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.Identify=this.Guid;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data.Data=varItem.Draw.DrawData;chart.IsShowMaxMinPrice=false;chart.IsShowKTooltip=false;if(varItem.Color)//如果设置了颜色,使用外面设置的颜色
|
|
@@ -12601,7 +12604,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
12601
12604
|
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);};}/********************************************************************************
|
|
12602
12605
|
* 版本信息输出
|
|
12603
12606
|
*
|
|
12604
|
-
*/var HQCHART_VERSION="1.1.
|
|
12607
|
+
*/var HQCHART_VERSION="1.1.12976";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
|
|
12605
12608
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
12606
12609
|
// BaseIndex:BaseIndex,
|
|
12607
12610
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
|
@@ -18121,7 +18121,7 @@ function JSExplainer(ast,option)
|
|
|
18121
18121
|
['VOLR',"量比"], ['VOLINSTK',"持仓量"], ["OPI","持仓量"], ["ZSTJJ","均价"], ["QHJSJ","结算价"], ["SETTLE", "结算价"],
|
|
18122
18122
|
|
|
18123
18123
|
//日期类
|
|
18124
|
-
['DATE',"日期"],['YEAR',"年份"],['MONTH',"月份"],['PERIOD', "周期"],['WEEK',"星期"],["TIME","时间"],
|
|
18124
|
+
['DATE',"日期"],['YEAR',"年份"],['MONTH',"月份"],["DAY","日"],['PERIOD', "周期"],['WEEK',"星期"],["TIME","时间"],
|
|
18125
18125
|
|
|
18126
18126
|
//大盘数据
|
|
18127
18127
|
['INDEXA',"大盘成交额"],['INDEXC',"大盘收盘价"],['INDEXH',"大盘最高价"],['INDEXL',"大盘最低价"],['INDEXO',"大盘开盘价"],['INDEXV',"大盘成交量"],
|
|
@@ -19619,6 +19619,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
19619
19619
|
if (IFrameSplitOperator.IsNumber(option.YAxis.FloatPrecision)) this.YAxis.FloatPrecision=option.YAxis.FloatPrecision;
|
|
19620
19620
|
if (IFrameSplitOperator.IsNumber(option.YAxis.StringFormat)) this.YAxis.StringFormat=option.YAxis.StringFormat;
|
|
19621
19621
|
if (IFrameSplitOperator.IsBool(option.YAxis.EnableRemoveZero)) this.YAxis.EnableRemoveZero=option.YAxis.EnableRemoveZero;
|
|
19622
|
+
if (IFrameSplitOperator.IsBool(option.YAxis.ExcludeValue)) this.YAxis.ExcludeValue=option.YAxis.ExcludeValue; //不参数Y轴的计算
|
|
19622
19623
|
|
|
19623
19624
|
}
|
|
19624
19625
|
|
|
@@ -19883,6 +19884,11 @@ function ScriptIndex(name,script,args,option)
|
|
|
19883
19884
|
|
|
19884
19885
|
if (this.ID) chart.IndexID=this.ID;
|
|
19885
19886
|
|
|
19887
|
+
if (this.YAxis)
|
|
19888
|
+
{
|
|
19889
|
+
if (IFrameSplitOperator.IsBool(this.YAxis.ExcludeValue)) chart.IsExcludeYValue=this.YAxis.ExcludeValue;
|
|
19890
|
+
}
|
|
19891
|
+
|
|
19886
19892
|
chart.Script=this; //指标内容绑定上去
|
|
19887
19893
|
}
|
|
19888
19894
|
|
|
@@ -20273,6 +20279,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
20273
20279
|
pointDot.Data.Data=varItem.Data;
|
|
20274
20280
|
hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(pointDot.Data,varItem.Name,pointDot.Color);
|
|
20275
20281
|
|
|
20282
|
+
this.SetChartIndexName(pointDot);
|
|
20276
20283
|
hqChart.ChartPaint.push(pointDot);
|
|
20277
20284
|
}
|
|
20278
20285
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
Condition: 限制条件 { Symbol:'Index'/'Stock'(只支持指数/股票),Period:[](支持的周期), Include:[](指定支持的股票,代码全部大写包括后缀, Message:"提示信息")}
|
|
27
27
|
OutName:动态输出变量名字 [{Name:原始变量名, DynamicName:动态名字格式}] 如 {Name:"MA1", DynamicName:"MA{M1}"};
|
|
28
28
|
SplitType: Y轴分割类型,
|
|
29
|
-
YAxis:{ FloatPrecision:小数位数, StringFormat:, EnableRemoveZero } //Y轴刻度输出格式
|
|
29
|
+
YAxis:{ FloatPrecision:小数位数, StringFormat:, EnableRemoveZero, ExcludeValue:不参数Y轴的计算 } //Y轴刻度输出格式
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
//周期条件枚举
|
|
@@ -189,6 +189,7 @@ JSIndexScript.ModifyAttribute=function(indexInfo, attribute)
|
|
|
189
189
|
if (IFrameSplitOperator.IsNumber(item.FloatPrecision)) indexInfo.YAxis.FloatPrecision=item.FloatPrecision;
|
|
190
190
|
if (IFrameSplitOperator.IsNumber(item.StringFormat)) indexInfo.YAxis.StringFormat=item.StringFormat;
|
|
191
191
|
if (IFrameSplitOperator.IsBool(item.EnableRemoveZero)) indexInfo.YAxis.EnableRemoveZero=item.EnableRemoveZero;
|
|
192
|
+
if (IFrameSplitOperator.IsBool(item.ExcludeValue)) indexInfo.YAxis.ExcludeValue=attribute.ExcludeValue; //不参数Y轴的计算
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -6861,6 +6861,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6861
6861
|
if (chart.IsShow==false) continue; //隐藏的图形不计算
|
|
6862
6862
|
if (chart.NotSupportMessage) continue;
|
|
6863
6863
|
if (!chart.ChartFrame) continue;
|
|
6864
|
+
if (chart.IsExcludeYValue===true) continue;
|
|
6864
6865
|
|
|
6865
6866
|
var range=chart.GetMaxMin();
|
|
6866
6867
|
if (range==null || range.Max==null || range.Min==null) continue;
|
|
@@ -21635,6 +21636,7 @@ function IChartPainting()
|
|
|
21635
21636
|
this.PtInChart; //function(x,y) { }
|
|
21636
21637
|
|
|
21637
21638
|
this.IsFullRangeMaxMin=false; //this.GetMaxMin() true=计算全部的最大最小值 false=计算可视范围的最大最小值
|
|
21639
|
+
this.IsExcludeYValue=false; //不参与Y轴计算
|
|
21638
21640
|
|
|
21639
21641
|
this.Draw=function()
|
|
21640
21642
|
{
|
|
@@ -30000,6 +30002,7 @@ function ChartPointDot()
|
|
|
30000
30002
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
30001
30003
|
|
|
30002
30004
|
this.Canvas.save();
|
|
30005
|
+
this.ClipClient(bHScreen);
|
|
30003
30006
|
this.Canvas.fillStyle=this.Color;
|
|
30004
30007
|
var colorDot;
|
|
30005
30008
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
@@ -30008,7 +30011,7 @@ function ChartPointDot()
|
|
|
30008
30011
|
if (value==null) continue;
|
|
30009
30012
|
|
|
30010
30013
|
var x=this.ChartFrame.GetXFromIndex(j);
|
|
30011
|
-
var y=this.ChartFrame.GetYFromData(value);
|
|
30014
|
+
var y=this.ChartFrame.GetYFromData(value, false);
|
|
30012
30015
|
|
|
30013
30016
|
if (x>chartright) break;
|
|
30014
30017
|
|
|
@@ -38,7 +38,7 @@ var JSConsole=
|
|
|
38
38
|
Condition: 限制条件 { Symbol:'Index'/'Stock'(只支持指数/股票),Period:[](支持的周期), Include:[](指定支持的股票,代码全部大写包括后缀, Message:"提示信息")}
|
|
39
39
|
OutName:动态输出变量名字 [{Name:原始变量名, DynamicName:动态名字格式}] 如 {Name:"MA1", DynamicName:"MA{M1}"};
|
|
40
40
|
SplitType: Y轴分割类型,
|
|
41
|
-
YAxis:{ FloatPrecision:小数位数, StringFormat:, EnableRemoveZero } //Y轴刻度输出格式
|
|
41
|
+
YAxis:{ FloatPrecision:小数位数, StringFormat:, EnableRemoveZero, ExcludeValue:不参数Y轴的计算 } //Y轴刻度输出格式
|
|
42
42
|
*/
|
|
43
43
|
|
|
44
44
|
//周期条件枚举
|
|
@@ -201,6 +201,7 @@ JSIndexScript.ModifyAttribute=function(indexInfo, attribute)
|
|
|
201
201
|
if (IFrameSplitOperator.IsNumber(item.FloatPrecision)) indexInfo.YAxis.FloatPrecision=item.FloatPrecision;
|
|
202
202
|
if (IFrameSplitOperator.IsNumber(item.StringFormat)) indexInfo.YAxis.StringFormat=item.StringFormat;
|
|
203
203
|
if (IFrameSplitOperator.IsBool(item.EnableRemoveZero)) indexInfo.YAxis.EnableRemoveZero=item.EnableRemoveZero;
|
|
204
|
+
if (IFrameSplitOperator.IsBool(item.ExcludeValue)) indexInfo.YAxis.ExcludeValue=attribute.ExcludeValue; //不参数Y轴的计算
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
|
|
@@ -10752,6 +10753,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10752
10753
|
if (chart.IsShow==false) continue; //隐藏的图形不计算
|
|
10753
10754
|
if (chart.NotSupportMessage) continue;
|
|
10754
10755
|
if (!chart.ChartFrame) continue;
|
|
10756
|
+
if (chart.IsExcludeYValue===true) continue;
|
|
10755
10757
|
|
|
10756
10758
|
var range=chart.GetMaxMin();
|
|
10757
10759
|
if (range==null || range.Max==null || range.Min==null) continue;
|
|
@@ -25526,6 +25528,7 @@ function IChartPainting()
|
|
|
25526
25528
|
this.PtInChart; //function(x,y) { }
|
|
25527
25529
|
|
|
25528
25530
|
this.IsFullRangeMaxMin=false; //this.GetMaxMin() true=计算全部的最大最小值 false=计算可视范围的最大最小值
|
|
25531
|
+
this.IsExcludeYValue=false; //不参与Y轴计算
|
|
25529
25532
|
|
|
25530
25533
|
this.Draw=function()
|
|
25531
25534
|
{
|
|
@@ -33891,6 +33894,7 @@ function ChartPointDot()
|
|
|
33891
33894
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
33892
33895
|
|
|
33893
33896
|
this.Canvas.save();
|
|
33897
|
+
this.ClipClient(bHScreen);
|
|
33894
33898
|
this.Canvas.fillStyle=this.Color;
|
|
33895
33899
|
var colorDot;
|
|
33896
33900
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
@@ -33899,7 +33903,7 @@ function ChartPointDot()
|
|
|
33899
33903
|
if (value==null) continue;
|
|
33900
33904
|
|
|
33901
33905
|
var x=this.ChartFrame.GetXFromIndex(j);
|
|
33902
|
-
var y=this.ChartFrame.GetYFromData(value);
|
|
33906
|
+
var y=this.ChartFrame.GetYFromData(value, false);
|
|
33903
33907
|
|
|
33904
33908
|
if (x>chartright) break;
|
|
33905
33909
|
|
|
@@ -110824,7 +110828,7 @@ function JSExplainer(ast,option)
|
|
|
110824
110828
|
['VOLR',"量比"], ['VOLINSTK',"持仓量"], ["OPI","持仓量"], ["ZSTJJ","均价"], ["QHJSJ","结算价"], ["SETTLE", "结算价"],
|
|
110825
110829
|
|
|
110826
110830
|
//日期类
|
|
110827
|
-
['DATE',"日期"],['YEAR',"年份"],['MONTH',"月份"],['PERIOD', "周期"],['WEEK',"星期"],["TIME","时间"],
|
|
110831
|
+
['DATE',"日期"],['YEAR',"年份"],['MONTH',"月份"],["DAY","日"],['PERIOD', "周期"],['WEEK',"星期"],["TIME","时间"],
|
|
110828
110832
|
|
|
110829
110833
|
//大盘数据
|
|
110830
110834
|
['INDEXA',"大盘成交额"],['INDEXC',"大盘收盘价"],['INDEXH',"大盘最高价"],['INDEXL',"大盘最低价"],['INDEXO',"大盘开盘价"],['INDEXV',"大盘成交量"],
|
|
@@ -112322,6 +112326,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
112322
112326
|
if (IFrameSplitOperator.IsNumber(option.YAxis.FloatPrecision)) this.YAxis.FloatPrecision=option.YAxis.FloatPrecision;
|
|
112323
112327
|
if (IFrameSplitOperator.IsNumber(option.YAxis.StringFormat)) this.YAxis.StringFormat=option.YAxis.StringFormat;
|
|
112324
112328
|
if (IFrameSplitOperator.IsBool(option.YAxis.EnableRemoveZero)) this.YAxis.EnableRemoveZero=option.YAxis.EnableRemoveZero;
|
|
112329
|
+
if (IFrameSplitOperator.IsBool(option.YAxis.ExcludeValue)) this.YAxis.ExcludeValue=option.YAxis.ExcludeValue; //不参数Y轴的计算
|
|
112325
112330
|
|
|
112326
112331
|
}
|
|
112327
112332
|
|
|
@@ -112586,6 +112591,11 @@ function ScriptIndex(name,script,args,option)
|
|
|
112586
112591
|
|
|
112587
112592
|
if (this.ID) chart.IndexID=this.ID;
|
|
112588
112593
|
|
|
112594
|
+
if (this.YAxis)
|
|
112595
|
+
{
|
|
112596
|
+
if (IFrameSplitOperator.IsBool(this.YAxis.ExcludeValue)) chart.IsExcludeYValue=this.YAxis.ExcludeValue;
|
|
112597
|
+
}
|
|
112598
|
+
|
|
112589
112599
|
chart.Script=this; //指标内容绑定上去
|
|
112590
112600
|
}
|
|
112591
112601
|
|
|
@@ -112976,6 +112986,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
112976
112986
|
pointDot.Data.Data=varItem.Data;
|
|
112977
112987
|
hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(pointDot.Data,varItem.Name,pointDot.Color);
|
|
112978
112988
|
|
|
112989
|
+
this.SetChartIndexName(pointDot);
|
|
112979
112990
|
hqChart.ChartPaint.push(pointDot);
|
|
112980
112991
|
}
|
|
112981
112992
|
|
|
@@ -129172,7 +129183,7 @@ function ScrollBarBGChart()
|
|
|
129172
129183
|
|
|
129173
129184
|
|
|
129174
129185
|
|
|
129175
|
-
var HQCHART_VERSION="1.1.
|
|
129186
|
+
var HQCHART_VERSION="1.1.12976";
|
|
129176
129187
|
|
|
129177
129188
|
function PrintHQChartVersion()
|
|
129178
129189
|
{
|
|
@@ -82,7 +82,7 @@ JSNetwork.HttpRequest=function(obj) //对请求进行封装
|
|
|
82
82
|
Condition: 限制条件 { Symbol:'Index'/'Stock'(只支持指数/股票),Period:[](支持的周期), Include:[](指定支持的股票,代码全部大写包括后缀, Message:"提示信息")}
|
|
83
83
|
OutName:动态输出变量名字 [{Name:原始变量名, DynamicName:动态名字格式}] 如 {Name:"MA1", DynamicName:"MA{M1}"};
|
|
84
84
|
SplitType: Y轴分割类型,
|
|
85
|
-
YAxis:{ FloatPrecision:小数位数, StringFormat:, EnableRemoveZero } //Y轴刻度输出格式
|
|
85
|
+
YAxis:{ FloatPrecision:小数位数, StringFormat:, EnableRemoveZero, ExcludeValue:不参数Y轴的计算 } //Y轴刻度输出格式
|
|
86
86
|
*/
|
|
87
87
|
|
|
88
88
|
//周期条件枚举
|
|
@@ -245,6 +245,7 @@ JSIndexScript.ModifyAttribute=function(indexInfo, attribute)
|
|
|
245
245
|
if (IFrameSplitOperator.IsNumber(item.FloatPrecision)) indexInfo.YAxis.FloatPrecision=item.FloatPrecision;
|
|
246
246
|
if (IFrameSplitOperator.IsNumber(item.StringFormat)) indexInfo.YAxis.StringFormat=item.StringFormat;
|
|
247
247
|
if (IFrameSplitOperator.IsBool(item.EnableRemoveZero)) indexInfo.YAxis.EnableRemoveZero=item.EnableRemoveZero;
|
|
248
|
+
if (IFrameSplitOperator.IsBool(item.ExcludeValue)) indexInfo.YAxis.ExcludeValue=attribute.ExcludeValue; //不参数Y轴的计算
|
|
248
249
|
}
|
|
249
250
|
}
|
|
250
251
|
|
|
@@ -10796,6 +10797,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10796
10797
|
if (chart.IsShow==false) continue; //隐藏的图形不计算
|
|
10797
10798
|
if (chart.NotSupportMessage) continue;
|
|
10798
10799
|
if (!chart.ChartFrame) continue;
|
|
10800
|
+
if (chart.IsExcludeYValue===true) continue;
|
|
10799
10801
|
|
|
10800
10802
|
var range=chart.GetMaxMin();
|
|
10801
10803
|
if (range==null || range.Max==null || range.Min==null) continue;
|
|
@@ -25570,6 +25572,7 @@ function IChartPainting()
|
|
|
25570
25572
|
this.PtInChart; //function(x,y) { }
|
|
25571
25573
|
|
|
25572
25574
|
this.IsFullRangeMaxMin=false; //this.GetMaxMin() true=计算全部的最大最小值 false=计算可视范围的最大最小值
|
|
25575
|
+
this.IsExcludeYValue=false; //不参与Y轴计算
|
|
25573
25576
|
|
|
25574
25577
|
this.Draw=function()
|
|
25575
25578
|
{
|
|
@@ -33935,6 +33938,7 @@ function ChartPointDot()
|
|
|
33935
33938
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
33936
33939
|
|
|
33937
33940
|
this.Canvas.save();
|
|
33941
|
+
this.ClipClient(bHScreen);
|
|
33938
33942
|
this.Canvas.fillStyle=this.Color;
|
|
33939
33943
|
var colorDot;
|
|
33940
33944
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
@@ -33943,7 +33947,7 @@ function ChartPointDot()
|
|
|
33943
33947
|
if (value==null) continue;
|
|
33944
33948
|
|
|
33945
33949
|
var x=this.ChartFrame.GetXFromIndex(j);
|
|
33946
|
-
var y=this.ChartFrame.GetYFromData(value);
|
|
33950
|
+
var y=this.ChartFrame.GetYFromData(value, false);
|
|
33947
33951
|
|
|
33948
33952
|
if (x>chartright) break;
|
|
33949
33953
|
|
|
@@ -110868,7 +110872,7 @@ function JSExplainer(ast,option)
|
|
|
110868
110872
|
['VOLR',"量比"], ['VOLINSTK',"持仓量"], ["OPI","持仓量"], ["ZSTJJ","均价"], ["QHJSJ","结算价"], ["SETTLE", "结算价"],
|
|
110869
110873
|
|
|
110870
110874
|
//日期类
|
|
110871
|
-
['DATE',"日期"],['YEAR',"年份"],['MONTH',"月份"],['PERIOD', "周期"],['WEEK',"星期"],["TIME","时间"],
|
|
110875
|
+
['DATE',"日期"],['YEAR',"年份"],['MONTH',"月份"],["DAY","日"],['PERIOD', "周期"],['WEEK',"星期"],["TIME","时间"],
|
|
110872
110876
|
|
|
110873
110877
|
//大盘数据
|
|
110874
110878
|
['INDEXA',"大盘成交额"],['INDEXC',"大盘收盘价"],['INDEXH',"大盘最高价"],['INDEXL',"大盘最低价"],['INDEXO',"大盘开盘价"],['INDEXV',"大盘成交量"],
|
|
@@ -112366,6 +112370,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
112366
112370
|
if (IFrameSplitOperator.IsNumber(option.YAxis.FloatPrecision)) this.YAxis.FloatPrecision=option.YAxis.FloatPrecision;
|
|
112367
112371
|
if (IFrameSplitOperator.IsNumber(option.YAxis.StringFormat)) this.YAxis.StringFormat=option.YAxis.StringFormat;
|
|
112368
112372
|
if (IFrameSplitOperator.IsBool(option.YAxis.EnableRemoveZero)) this.YAxis.EnableRemoveZero=option.YAxis.EnableRemoveZero;
|
|
112373
|
+
if (IFrameSplitOperator.IsBool(option.YAxis.ExcludeValue)) this.YAxis.ExcludeValue=option.YAxis.ExcludeValue; //不参数Y轴的计算
|
|
112369
112374
|
|
|
112370
112375
|
}
|
|
112371
112376
|
|
|
@@ -112630,6 +112635,11 @@ function ScriptIndex(name,script,args,option)
|
|
|
112630
112635
|
|
|
112631
112636
|
if (this.ID) chart.IndexID=this.ID;
|
|
112632
112637
|
|
|
112638
|
+
if (this.YAxis)
|
|
112639
|
+
{
|
|
112640
|
+
if (IFrameSplitOperator.IsBool(this.YAxis.ExcludeValue)) chart.IsExcludeYValue=this.YAxis.ExcludeValue;
|
|
112641
|
+
}
|
|
112642
|
+
|
|
112633
112643
|
chart.Script=this; //指标内容绑定上去
|
|
112634
112644
|
}
|
|
112635
112645
|
|
|
@@ -113020,6 +113030,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
113020
113030
|
pointDot.Data.Data=varItem.Data;
|
|
113021
113031
|
hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(pointDot.Data,varItem.Name,pointDot.Color);
|
|
113022
113032
|
|
|
113033
|
+
this.SetChartIndexName(pointDot);
|
|
113023
113034
|
hqChart.ChartPaint.push(pointDot);
|
|
113024
113035
|
}
|
|
113025
113036
|
|
|
@@ -129330,7 +129341,7 @@ function HQChartScriptWorker()
|
|
|
129330
129341
|
|
|
129331
129342
|
|
|
129332
129343
|
|
|
129333
|
-
var HQCHART_VERSION="1.1.
|
|
129344
|
+
var HQCHART_VERSION="1.1.12976";
|
|
129334
129345
|
|
|
129335
129346
|
function PrintHQChartVersion()
|
|
129336
129347
|
{
|