hqchart 1.1.12503 → 1.1.12505
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
CHANGED
|
@@ -5249,15 +5249,103 @@ this.newMethod();delete this.newMethod;this.ClassName="HistoryDataStringFormat";
|
|
|
5249
5249
|
this.LineHeight=g_JSChartResource.PCTooltip.LineHeight;//单行高度
|
|
5250
5250
|
this.Width=157;//宽度
|
|
5251
5251
|
this.Height=this.LineHeight*5;//高度
|
|
5252
|
-
this.Operator=function(){var data=this.Value.Data;if(!data)return false;this.Width=157;if(this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID)this.Width=180;var
|
|
5253
|
-
|
|
5254
|
-
var
|
|
5255
|
-
|
|
5252
|
+
this.Operator=function(){var data=this.Value.Data;if(!data)return false;this.Width=157;if(this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID)this.Width=180;var titleData=this.GetFormatTitle(data);if(!titleData)return false;var outData=this.GenerateTitleHtml(titleData);if(!outData)return false;this.Text=outData.Html;this.Height=outData.LineCount*this.LineHeight;return true;/*
|
|
5253
|
+
var date=new Date(parseInt(data.Date/10000),(data.Date/100%100-1),data.Date%100);
|
|
5254
|
+
var strDate=IFrameSplitOperator.FormatDateString(data.Date);
|
|
5255
|
+
var title2=g_JSChartLocalization.GetText(WEEK_NAME[date.getDay()],this.LanguageID);
|
|
5256
|
+
var isTickPeriod=ChartData.IsTickPeriod(this.Value.ChartPaint.Data.Period);
|
|
5257
|
+
if (ChartData.IsMinutePeriod(this.Value.ChartPaint.Data.Period,true)) // 分钟周期
|
|
5258
|
+
{
|
|
5259
|
+
title2=IFrameSplitOperator.FormatTimeString(data.Time);
|
|
5260
|
+
}
|
|
5261
|
+
else if (ChartData.IsSecondPeriod(this.Value.ChartPaint.Data.Period) || isTickPeriod)
|
|
5262
|
+
{
|
|
5263
|
+
title2=IFrameSplitOperator.FormatTimeString(data.Time,'HH:MM:SS');
|
|
5264
|
+
}
|
|
5265
|
+
|
|
5266
|
+
var upperSymbol=this.Symbol.toUpperCase();
|
|
5267
|
+
var defaultfloatPrecision=GetfloatPrecision(this.Symbol);//价格小数位数
|
|
5268
|
+
var increase=null;
|
|
5269
|
+
if (data.YClose>0) increase=(data.Close-data.YClose)/data.YClose*100;
|
|
5270
|
+
if (isTickPeriod)
|
|
5271
|
+
{
|
|
5272
|
+
var strText=
|
|
5273
|
+
"<span class='tooltip-title'>"+strDate+"  "+title2+"</span>"+
|
|
5274
|
+
"<span class='tooltip-con'>"+g_JSChartLocalization.GetText('DivTooltip-Price',this.LanguageID)+"</span>"+
|
|
5275
|
+
"<span class='tooltip-num' style='color:"+this.GetColor(data.Open,data.YClose)+";'>"+data.Open.toFixed(defaultfloatPrecision)+"</span><br/>"+
|
|
5276
|
+
"<span class='tooltip-con'>"+g_JSChartLocalization.GetText('DivTooltip-Increase',this.LanguageID)+"</span>"+
|
|
5277
|
+
(increase==null? "<span class='tooltip-num' style='color:"+this.GetColor(0,0)+";'>"+'--'+"</span><br/>" :
|
|
5278
|
+
"<span class='tooltip-num' style='color:"+this.GetColor(increase,0)+";'>"+increase.toFixed(2)+'%'+"</span><br/>");
|
|
5279
|
+
|
|
5280
|
+
this.LineCount=4;
|
|
5281
|
+
}
|
|
5282
|
+
else if (data.IsNonTrade) //非交易日就显示日期
|
|
5283
|
+
{
|
|
5284
|
+
var strText= `<span class='tooltip-title'>${strDate}  ${title2}</span>`;
|
|
5285
|
+
this.LineCount=2;
|
|
5286
|
+
}
|
|
5287
|
+
else
|
|
5288
|
+
{
|
|
5289
|
+
var vol=data.Vol;
|
|
5290
|
+
if (upperSymbol && MARKET_SUFFIX_NAME.IsSHSZ(upperSymbol)) vol/=100; //A股统一转成手
|
|
5291
|
+
var eventUnchangeKLine=null; //定制平盘K线颜色事件
|
|
5292
|
+
if (this.GetEventCallback) eventUnchangeKLine=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_UNCHANGE_KLINE_TITLE_COLOR);
|
|
5293
|
+
var strText=
|
|
5294
|
+
"<span class='tooltip-title'>"+strDate+"  "+title2+"</span>"+
|
|
5295
|
+
"<span class='tooltip-con'>"+g_JSChartLocalization.GetText('DivTooltip-Open',this.LanguageID)+"</span>"+
|
|
5296
|
+
"<span class='tooltip-num' style='color:"+this.GetPriceColor("DivTooltip-Open",data.Open,data.YClose,data,eventUnchangeKLine)+";'>"+ (IFrameSplitOperator.IsNumber(data.Open)? data.Open.toFixed(defaultfloatPrecision):'--') +"</span><br/>"+
|
|
5297
|
+
"<span class='tooltip-con'>"+g_JSChartLocalization.GetText('DivTooltip-High',this.LanguageID)+"</span>"+
|
|
5298
|
+
"<span class='tooltip-num' style='color:"+this.GetPriceColor("DivTooltip-High",data.High,data.YClose,data,eventUnchangeKLine)+";'>"+ (IFrameSplitOperator.IsNumber(data.High)? data.High.toFixed(defaultfloatPrecision):'--') +"</span><br/>"+
|
|
5299
|
+
"<span class='tooltip-con'>"+g_JSChartLocalization.GetText('DivTooltip-Low',this.LanguageID)+"</span>"+
|
|
5300
|
+
"<span class='tooltip-num' style='color:"+this.GetPriceColor('DivTooltip-Low',data.Low,data.YClose,data,eventUnchangeKLine)+";'>"+ (IFrameSplitOperator.IsNumber(data.Low)? data.Low.toFixed(defaultfloatPrecision):'--') +"</span><br/>"+
|
|
5301
|
+
"<span class='tooltip-con'>"+g_JSChartLocalization.GetText('DivTooltip-Close',this.LanguageID)+"</span>"+
|
|
5302
|
+
"<span class='tooltip-num' style='color:"+this.GetPriceColor('DivTooltip-Close',data.Close,data.YClose,data,eventUnchangeKLine)+";'>"+ (IFrameSplitOperator.IsNumber(data.Close)? data.Close.toFixed(defaultfloatPrecision):'--') +"</span><br/>"+
|
|
5303
|
+
//"<span style='color:"+this.YClose+";font:微软雅黑;font-size:12px'> 前收: "+IFrameSplitOperator.FormatValueString(data.YClose,2)+"</span><br/>"+
|
|
5304
|
+
"<span class='tooltip-con'>"+g_JSChartLocalization.GetText('DivTooltip-Vol',this.LanguageID)+"</span>"+
|
|
5305
|
+
"<span class='tooltip-num' style='color:"+this.VolColor+";'>"+ (IFrameSplitOperator.IsNumber(vol)? IFrameSplitOperator.FormatValueString(vol,2,this.LanguageID):'--') +"</span><br/>"+
|
|
5306
|
+
"<span class='tooltip-con'>"+g_JSChartLocalization.GetText('DivTooltip-Amount',this.LanguageID)+"</span>"+
|
|
5307
|
+
"<span class='tooltip-num' style='color:"+this.AmountColor+";'>"+ (IFrameSplitOperator.IsNumber(data.Amount)? IFrameSplitOperator.FormatValueString(data.Amount,2,this.LanguageID):'--') +"</span><br/>"+
|
|
5308
|
+
"<span class='tooltip-con'>"+g_JSChartLocalization.GetText('DivTooltip-Increase',this.LanguageID)+"</span>"+
|
|
5309
|
+
(increase==null? "<span class='tooltip-num' style='color:"+this.GetColor(0,0)+";'>"+'--'+"</span><br/>" :
|
|
5310
|
+
"<span class='tooltip-num' style='color:"+this.GetColor(increase,0)+";'>"+increase.toFixed(2)+'%'+"</span><br/>");
|
|
5311
|
+
|
|
5312
|
+
this.LineCount=8;
|
|
5313
|
+
|
|
5314
|
+
if(MARKET_SUFFIX_NAME.IsSHSZStockA(this.Symbol) && data.FlowCapital>0) //换手率
|
|
5315
|
+
{
|
|
5316
|
+
var value=data.Vol/data.FlowCapital*100;
|
|
5317
|
+
strText+= "<span class='tooltip-con'>"+g_JSChartLocalization.GetText('DivTooltip-Exchange',this.LanguageID)+"</span>" +
|
|
5318
|
+
"<span class='tooltip-num' style='color:"+this.TurnoverRateColor+";'>"+value.toFixed(2)+'%'+"</span><br/>";
|
|
5319
|
+
++this.LineCount;
|
|
5320
|
+
}
|
|
5321
|
+
|
|
5322
|
+
if (MARKET_SUFFIX_NAME.IsFutures(upperSymbol) && IFrameSplitOperator.IsNumber(data.Position))
|
|
5323
|
+
{
|
|
5324
|
+
strText+= "<span class='tooltip-con'>"+g_JSChartLocalization.GetText('DivTooltip-Position',this.LanguageID)+"</span>" +
|
|
5325
|
+
"<span class='tooltip-num' style='color:"+this.PositionColor+";'>"+data.Position+"</span><br/>";
|
|
5326
|
+
++this.LineCount;
|
|
5327
|
+
}
|
|
5328
|
+
|
|
5329
|
+
//叠加股票
|
|
5330
|
+
if (this.Value.ChartPaint.Name=="Overlay-KLine")
|
|
5331
|
+
{
|
|
5332
|
+
var title="<span style='color:rgb(0,0,0);font:微软雅黑;font-size:12px;text-align:center;display: block;'>"+this.Value.ChartPaint.Title+"</span>";
|
|
5333
|
+
strText=title+strText;
|
|
5334
|
+
++this.LineCount;
|
|
5335
|
+
}
|
|
5336
|
+
}
|
|
5337
|
+
|
|
5338
|
+
this.Text=strText;
|
|
5339
|
+
|
|
5340
|
+
this.Height=this.LineCount*this.LineHeight;
|
|
5341
|
+
return true;
|
|
5342
|
+
*/};this.GenerateTitleHtml=function(data){var lineCount=0;var strHtml="",text;if(data.Name){text='<span style=\'color:rgb(0,0,0);font:\u5FAE\u8F6F\u96C5\u9ED1;font-size:12px;text-align:center;display: block;\'>'+data.Name+'</span>';strHtml+=text;++lineCount;}if(data.Title){text='<span class=\'tooltip-title\'>'+data.Title+'</span>';strHtml+=text;++lineCount;}if(IFrameSplitOperator.IsNonEmptyArray(data.AryText)){for(var i=0;i<data.AryText.length;++i){var item=data.AryText[i];if(i>0)strHtml+='<br/>';var text='<span class=\'tooltip-con\'>'+item.Title+'</span><span class=\'tooltip-num\' style=\'color:'+item.Color+';\'>'+item.Text+'</span>';strHtml+=text;++lineCount;}}return{Html:strHtml,LineCount:lineCount};};this.GetFormatTitle=function(data){if(!data)return null;var upperSymbol=this.Symbol.toUpperCase();var defaultfloatPrecision=GetfloatPrecision(this.Symbol);//价格小数位数
|
|
5343
|
+
var date=new Date(parseInt(data.Date/10000),data.Date/100%100-1,data.Date%100);var strDate=IFrameSplitOperator.FormatDateString(data.Date);var title2=g_JSChartLocalization.GetText(WEEK_NAME[date.getDay()],this.LanguageID);var isTickPeriod=ChartData.IsTickPeriod(this.Value.ChartPaint.Data.Period);if(ChartData.IsMinutePeriod(this.Value.ChartPaint.Data.Period,true))// 分钟周期
|
|
5344
|
+
{title2=IFrameSplitOperator.FormatTimeString(data.Time);}else if(ChartData.IsSecondPeriod(this.Value.ChartPaint.Data.Period)||isTickPeriod){title2=IFrameSplitOperator.FormatTimeString(data.Time,'HH:MM:SS');}var result={AryText:null,Title:strDate+'  '+title2,Name:null};if(isTickPeriod){var aryText=[{Title:g_JSChartLocalization.GetText('DivTooltip-Price',this.LanguageID),Text:IFrameSplitOperator.IsNumber(data.Open)?data.Open.toFixed(defaultfloatPrecision):'--',Color:this.GetColor(data.Open,data.YClose)}];if(IFrameSplitOperator.IsNumber(data.YClose)){var increase=(data.Close-data.YClose)/data.YClose*100;var item={Title:g_JSChartLocalization.GetText('DivTooltip-Increase',this.LanguageID),Text:increase.toFixed(2)+'%',Color:this.GetColor(increase,0)};aryText.push(item);}result.AryText=aryText;}else if(data.IsNonTrade){}else{var vol=data.Vol;if(upperSymbol&&MARKET_SUFFIX_NAME.IsSHSZ(upperSymbol))vol/=100;//A股统一转成手
|
|
5256
5345
|
var eventUnchangeKLine=null;//定制平盘K线颜色事件
|
|
5257
|
-
if(this.GetEventCallback)eventUnchangeKLine=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_UNCHANGE_KLINE_TITLE_COLOR);var
|
|
5258
|
-
|
|
5259
|
-
{
|
|
5260
|
-
if(this.Value.ChartPaint.Name=="Overlay-KLine"){var title="<span style='color:rgb(0,0,0);font:微软雅黑;font-size:12px;text-align:center;display: block;'>"+this.Value.ChartPaint.Title+"</span>";strText=title+strText;++this.LineCount;}}this.Text=strText;this.Height=this.LineCount*this.LineHeight;return true;};this.GetColor=function(price,yclse){if(price>yclse)return this.UpColor;else if(price<yclse)return this.DownColor;else return this.UnchagneColor;};this.GetPriceColor=function(titleName,price,yClose,item,event){var color=this.GetColor(price,yClose);if(price==yClose&&event&&event.Callback){var sendData={Item:item,TitleName:titleName,DefaultColor:color,TitleColor:null,ClassName:this.ClassName};event.Callback(event,sendData);if(sendData.TitleColor)color=sendData.TitleColor;}return color;};}//K线信息地雷提示信息格式
|
|
5346
|
+
if(this.GetEventCallback)eventUnchangeKLine=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_UNCHANGE_KLINE_TITLE_COLOR);var aryText=[{Title:g_JSChartLocalization.GetText('DivTooltip-Open',this.LanguageID),Text:IFrameSplitOperator.IsNumber(data.Open)?data.Open.toFixed(defaultfloatPrecision):'--',Color:this.GetPriceColor("DivTooltip-Open",data.Open,data.YClose,data,eventUnchangeKLine)},{Title:g_JSChartLocalization.GetText('DivTooltip-High',this.LanguageID),Text:IFrameSplitOperator.IsNumber(data.High)?data.High.toFixed(defaultfloatPrecision):'--',Color:this.GetPriceColor("DivTooltip-High",data.High,data.YClose,data,eventUnchangeKLine)},{Title:g_JSChartLocalization.GetText('DivTooltip-Low',this.LanguageID),Text:IFrameSplitOperator.IsNumber(data.Low)?data.Low.toFixed(defaultfloatPrecision):'--',Color:this.GetPriceColor('DivTooltip-Low',data.Low,data.YClose,data,eventUnchangeKLine)},{Title:g_JSChartLocalization.GetText('DivTooltip-Close',this.LanguageID),Text:IFrameSplitOperator.IsNumber(data.Close)?data.Close.toFixed(defaultfloatPrecision):'--',Color:this.GetPriceColor('DivTooltip-Close',data.Close,data.YClose,data,eventUnchangeKLine)},{Title:g_JSChartLocalization.GetText('DivTooltip-Vol',this.LanguageID),Text:IFrameSplitOperator.IsNumber(vol)?IFrameSplitOperator.FormatValueString(vol,2,this.LanguageID):'--',Color:this.VolColor},{Title:g_JSChartLocalization.GetText('DivTooltip-Amount',this.LanguageID),Text:IFrameSplitOperator.IsNumber(data.Amount)?IFrameSplitOperator.FormatValueString(data.Amount,2,this.LanguageID):'--',Color:this.AmountColor}];if(IFrameSplitOperator.IsNumber(data.YClose)){var increase=(data.Close-data.YClose)/data.YClose*100;var item={Title:g_JSChartLocalization.GetText('DivTooltip-Increase',this.LanguageID),Text:increase.toFixed(2)+'%',Color:this.GetColor(increase,0)};aryText.push(item);}if(MARKET_SUFFIX_NAME.IsSHSZStockA(this.Symbol)&&data.FlowCapital>0)//换手率
|
|
5347
|
+
{var value=data.Vol/data.FlowCapital*100;var item={Title:g_JSChartLocalization.GetText('DivTooltip-Exchange',this.LanguageID),Text:value.toFixed(2)+'%',Color:this.TurnoverRateColor};aryText.push(item);}if(MARKET_SUFFIX_NAME.IsFutures(upperSymbol)&&IFrameSplitOperator.IsNumber(data.Position)){var item={Title:g_JSChartLocalization.GetText('DivTooltip-Position',this.LanguageID),Text:''+data.Position,Color:this.PositionColor};}//叠加股票
|
|
5348
|
+
if(this.Value.ChartPaint.Name=="Overlay-KLine"){result.Name=this.Value.ChartPaint.Title;}result.AryText=aryText;}return result;};this.GetColor=function(price,yclse){if(price>yclse)return this.UpColor;else if(price<yclse)return this.DownColor;else return this.UnchagneColor;};this.GetPriceColor=function(titleName,price,yClose,item,event){var color=this.GetColor(price,yClose);if(price==yClose&&event&&event.Callback){var sendData={Item:item,TitleName:titleName,DefaultColor:color,TitleColor:null,ClassName:this.ClassName};event.Callback(event,sendData);if(sendData.TitleColor)color=sendData.TitleColor;}return color;};}//K线信息地雷提示信息格式
|
|
5261
5349
|
function KLineInfoDataStringFormat(){this.newMethod=IChangeStringFormat;//派生
|
|
5262
5350
|
this.newMethod();delete this.newMethod;this.UpColor=g_JSChartResource.UpTextColor;this.DownColor=g_JSChartResource.DownTextColor;this.UnchagneColor=g_JSChartResource.UnchagneTextColor;this.Width=500;this.Operator=function(){if(!this.Value)return false;var infoList=this.Value.Data.Data;//数据
|
|
5263
5351
|
var infoType=this.Value.Data.Type;//类型
|
|
@@ -12499,7 +12587,7 @@ function HQChartScriptWorker(){this.Create=function(){var _this60=this;addEventL
|
|
|
12499
12587
|
hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,Stock:{Symbol:message.Symbol},Request:{MaxDataCount:500,MaxMinuteDayCount:5},Period:message.Period,Right:message.Right,Data:hisData};if(IFrameSplitOperator.IsNumber(message.HQDataType))stockObj.HQDataType=message.HQDataType;indexConsole.ExecuteScript(stockObj);};this.OnRecvMessage=function(message){var data=message.data;if(!data)return;if(data.ID==JSCHART_WORKER_MESSAGE_ID.EXECUTE_SCRIPT){if(!IFrameSplitOperator.IsNonEmptyArray(data.AryIndex))return;for(var i=0;i<data.AryIndex.length;++i){var item=data.AryIndex[i];this.ExecuteScript(item,data);}}};this.OnExecuteFinish=function(data,indexInfo,jsExectute){var message={Data:data,IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.FINISH_EXECUTE_SCRIPT};postMessage(message);};this.OnExecuteError=function(error,indexInfo){var message={IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.ERROR_EXECUTE_SCRIPT,Error:error};postMessage(message);};}/********************************************************************************
|
|
12500
12588
|
* 版本信息输出
|
|
12501
12589
|
*
|
|
12502
|
-
*/var HQCHART_VERSION="1.1.
|
|
12590
|
+
*/var HQCHART_VERSION="1.1.12504";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();//把给外界调用的方法暴露出来
|
|
12503
12591
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
12504
12592
|
// BaseIndex:BaseIndex,
|
|
12505
12593
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -47135,7 +47135,16 @@ function HistoryDataStringFormat()
|
|
|
47135
47135
|
|
|
47136
47136
|
this.Width=157;
|
|
47137
47137
|
if (this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID) this.Width=180;
|
|
47138
|
+
var titleData=this.GetFormatTitle(data);
|
|
47139
|
+
if (!titleData) return false;
|
|
47140
|
+
var outData=this.GenerateTitleHtml(titleData);
|
|
47141
|
+
if (!outData) return false;
|
|
47138
47142
|
|
|
47143
|
+
this.Text=outData.Html;
|
|
47144
|
+
this.Height=outData.LineCount*this.LineHeight;
|
|
47145
|
+
return true;
|
|
47146
|
+
|
|
47147
|
+
/*
|
|
47139
47148
|
var date=new Date(parseInt(data.Date/10000),(data.Date/100%100-1),data.Date%100);
|
|
47140
47149
|
var strDate=IFrameSplitOperator.FormatDateString(data.Date);
|
|
47141
47150
|
var title2=g_JSChartLocalization.GetText(WEEK_NAME[date.getDay()],this.LanguageID);
|
|
@@ -47225,6 +47234,178 @@ function HistoryDataStringFormat()
|
|
|
47225
47234
|
|
|
47226
47235
|
this.Height=this.LineCount*this.LineHeight;
|
|
47227
47236
|
return true;
|
|
47237
|
+
*/
|
|
47238
|
+
}
|
|
47239
|
+
|
|
47240
|
+
this.GenerateTitleHtml=function(data)
|
|
47241
|
+
{
|
|
47242
|
+
var lineCount=0;
|
|
47243
|
+
var strHtml="", text;
|
|
47244
|
+
if (data.Name)
|
|
47245
|
+
{
|
|
47246
|
+
text=`<span style='color:rgb(0,0,0);font:微软雅黑;font-size:12px;text-align:center;display: block;'>${data.Name}</span>`;
|
|
47247
|
+
strHtml+=text;
|
|
47248
|
+
++lineCount;
|
|
47249
|
+
}
|
|
47250
|
+
|
|
47251
|
+
if (data.Title)
|
|
47252
|
+
{
|
|
47253
|
+
text=`<span class='tooltip-title'>${data.Title}</span>`;
|
|
47254
|
+
strHtml+=text;
|
|
47255
|
+
++lineCount;
|
|
47256
|
+
}
|
|
47257
|
+
|
|
47258
|
+
if (IFrameSplitOperator.IsNonEmptyArray(data.AryText))
|
|
47259
|
+
{
|
|
47260
|
+
for(var i=0;i<data.AryText.length;++i)
|
|
47261
|
+
{
|
|
47262
|
+
var item=data.AryText[i];
|
|
47263
|
+
if (i>0) strHtml+='<br/>';
|
|
47264
|
+
var text=`<span class='tooltip-con'>${item.Title}</span><span class='tooltip-num' style='color:${item.Color};'>${item.Text}</span>`;
|
|
47265
|
+
strHtml+=text;
|
|
47266
|
+
++lineCount;
|
|
47267
|
+
}
|
|
47268
|
+
}
|
|
47269
|
+
|
|
47270
|
+
return { Html:strHtml, LineCount:lineCount };
|
|
47271
|
+
}
|
|
47272
|
+
|
|
47273
|
+
this.GetFormatTitle=function(data)
|
|
47274
|
+
{
|
|
47275
|
+
if (!data) return null;
|
|
47276
|
+
|
|
47277
|
+
var upperSymbol=this.Symbol.toUpperCase();
|
|
47278
|
+
var defaultfloatPrecision=GetfloatPrecision(this.Symbol);//价格小数位数
|
|
47279
|
+
var date=new Date(parseInt(data.Date/10000),(data.Date/100%100-1),data.Date%100);
|
|
47280
|
+
var strDate=IFrameSplitOperator.FormatDateString(data.Date);
|
|
47281
|
+
|
|
47282
|
+
var title2=g_JSChartLocalization.GetText(WEEK_NAME[date.getDay()],this.LanguageID);
|
|
47283
|
+
var isTickPeriod=ChartData.IsTickPeriod(this.Value.ChartPaint.Data.Period);
|
|
47284
|
+
if (ChartData.IsMinutePeriod(this.Value.ChartPaint.Data.Period,true)) // 分钟周期
|
|
47285
|
+
{
|
|
47286
|
+
title2=IFrameSplitOperator.FormatTimeString(data.Time);
|
|
47287
|
+
}
|
|
47288
|
+
else if (ChartData.IsSecondPeriod(this.Value.ChartPaint.Data.Period) || isTickPeriod)
|
|
47289
|
+
{
|
|
47290
|
+
title2=IFrameSplitOperator.FormatTimeString(data.Time,'HH:MM:SS');
|
|
47291
|
+
}
|
|
47292
|
+
|
|
47293
|
+
var result={ AryText:null, Title:`${strDate}  ${title2}`, Name:null };
|
|
47294
|
+
if (isTickPeriod)
|
|
47295
|
+
{
|
|
47296
|
+
var aryText=
|
|
47297
|
+
[
|
|
47298
|
+
{
|
|
47299
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Price',this.LanguageID),
|
|
47300
|
+
Text:IFrameSplitOperator.IsNumber(data.Open)? data.Open.toFixed(defaultfloatPrecision):'--',
|
|
47301
|
+
Color:this.GetColor(data.Open,data.YClose)
|
|
47302
|
+
},
|
|
47303
|
+
];
|
|
47304
|
+
|
|
47305
|
+
if (IFrameSplitOperator.IsNumber(data.YClose))
|
|
47306
|
+
{
|
|
47307
|
+
var increase=(data.Close-data.YClose)/data.YClose*100;
|
|
47308
|
+
var item=
|
|
47309
|
+
{
|
|
47310
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Increase',this.LanguageID),
|
|
47311
|
+
Text:`${increase.toFixed(2)}%`,
|
|
47312
|
+
Color:this.GetColor(increase,0)
|
|
47313
|
+
}
|
|
47314
|
+
aryText.push(item);
|
|
47315
|
+
}
|
|
47316
|
+
|
|
47317
|
+
result.AryText=aryText;
|
|
47318
|
+
}
|
|
47319
|
+
else if (data.IsNonTrade)
|
|
47320
|
+
{
|
|
47321
|
+
|
|
47322
|
+
}
|
|
47323
|
+
else
|
|
47324
|
+
{
|
|
47325
|
+
var vol=data.Vol;
|
|
47326
|
+
if (upperSymbol && MARKET_SUFFIX_NAME.IsSHSZ(upperSymbol)) vol/=100; //A股统一转成手
|
|
47327
|
+
var eventUnchangeKLine=null; //定制平盘K线颜色事件
|
|
47328
|
+
if (this.GetEventCallback) eventUnchangeKLine=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_UNCHANGE_KLINE_TITLE_COLOR);
|
|
47329
|
+
|
|
47330
|
+
var aryText=
|
|
47331
|
+
[
|
|
47332
|
+
{
|
|
47333
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Open',this.LanguageID),
|
|
47334
|
+
Text:IFrameSplitOperator.IsNumber(data.Open)? data.Open.toFixed(defaultfloatPrecision):'--',
|
|
47335
|
+
Color:this.GetPriceColor("DivTooltip-Open",data.Open,data.YClose,data,eventUnchangeKLine),
|
|
47336
|
+
},
|
|
47337
|
+
{
|
|
47338
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-High',this.LanguageID),
|
|
47339
|
+
Text:IFrameSplitOperator.IsNumber(data.High)? data.High.toFixed(defaultfloatPrecision):'--',
|
|
47340
|
+
Color:this.GetPriceColor("DivTooltip-High",data.High,data.YClose,data,eventUnchangeKLine)
|
|
47341
|
+
},
|
|
47342
|
+
{
|
|
47343
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Low',this.LanguageID),
|
|
47344
|
+
Text:IFrameSplitOperator.IsNumber(data.Low)? data.Low.toFixed(defaultfloatPrecision):'--',
|
|
47345
|
+
Color:this.GetPriceColor('DivTooltip-Low',data.Low,data.YClose,data,eventUnchangeKLine)
|
|
47346
|
+
},
|
|
47347
|
+
{
|
|
47348
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Close',this.LanguageID),
|
|
47349
|
+
Text:IFrameSplitOperator.IsNumber(data.Close)? data.Close.toFixed(defaultfloatPrecision):'--',
|
|
47350
|
+
Color:this.GetPriceColor('DivTooltip-Close',data.Close,data.YClose,data,eventUnchangeKLine)
|
|
47351
|
+
},
|
|
47352
|
+
{
|
|
47353
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Vol',this.LanguageID),
|
|
47354
|
+
Text:IFrameSplitOperator.IsNumber(vol)? IFrameSplitOperator.FormatValueString(vol,2,this.LanguageID):'--',
|
|
47355
|
+
Color:this.VolColor
|
|
47356
|
+
},
|
|
47357
|
+
{
|
|
47358
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Amount',this.LanguageID),
|
|
47359
|
+
Text:IFrameSplitOperator.IsNumber(data.Amount)? IFrameSplitOperator.FormatValueString(data.Amount,2,this.LanguageID):'--',
|
|
47360
|
+
Color:this.AmountColor
|
|
47361
|
+
}
|
|
47362
|
+
];
|
|
47363
|
+
|
|
47364
|
+
if (IFrameSplitOperator.IsNumber(data.YClose))
|
|
47365
|
+
{
|
|
47366
|
+
var increase=(data.Close-data.YClose)/data.YClose*100;
|
|
47367
|
+
var item=
|
|
47368
|
+
{
|
|
47369
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Increase',this.LanguageID),
|
|
47370
|
+
Text:`${increase.toFixed(2)}%`,
|
|
47371
|
+
Color:this.GetColor(increase,0)
|
|
47372
|
+
}
|
|
47373
|
+
aryText.push(item);
|
|
47374
|
+
}
|
|
47375
|
+
|
|
47376
|
+
if(MARKET_SUFFIX_NAME.IsSHSZStockA(this.Symbol) && data.FlowCapital>0) //换手率
|
|
47377
|
+
{
|
|
47378
|
+
var value=data.Vol/data.FlowCapital*100;
|
|
47379
|
+
var item=
|
|
47380
|
+
{
|
|
47381
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Exchange',this.LanguageID),
|
|
47382
|
+
Text:`${value.toFixed(2)}%`,
|
|
47383
|
+
Color:this.TurnoverRateColor
|
|
47384
|
+
}
|
|
47385
|
+
aryText.push(item);
|
|
47386
|
+
}
|
|
47387
|
+
|
|
47388
|
+
if (MARKET_SUFFIX_NAME.IsFutures(upperSymbol) && IFrameSplitOperator.IsNumber(data.Position))
|
|
47389
|
+
{
|
|
47390
|
+
var item=
|
|
47391
|
+
{
|
|
47392
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Position',this.LanguageID),
|
|
47393
|
+
Text:`${data.Position}`,
|
|
47394
|
+
Color:this.PositionColor
|
|
47395
|
+
}
|
|
47396
|
+
}
|
|
47397
|
+
|
|
47398
|
+
//叠加股票
|
|
47399
|
+
if (this.Value.ChartPaint.Name=="Overlay-KLine")
|
|
47400
|
+
{
|
|
47401
|
+
result.Name=this.Value.ChartPaint.Title;
|
|
47402
|
+
}
|
|
47403
|
+
|
|
47404
|
+
result.AryText=aryText;
|
|
47405
|
+
}
|
|
47406
|
+
|
|
47407
|
+
|
|
47408
|
+
return result;
|
|
47228
47409
|
}
|
|
47229
47410
|
|
|
47230
47411
|
this.GetColor=function(price,yclse)
|
|
@@ -51215,7 +51215,16 @@ function HistoryDataStringFormat()
|
|
|
51215
51215
|
|
|
51216
51216
|
this.Width=157;
|
|
51217
51217
|
if (this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID) this.Width=180;
|
|
51218
|
+
var titleData=this.GetFormatTitle(data);
|
|
51219
|
+
if (!titleData) return false;
|
|
51220
|
+
var outData=this.GenerateTitleHtml(titleData);
|
|
51221
|
+
if (!outData) return false;
|
|
51218
51222
|
|
|
51223
|
+
this.Text=outData.Html;
|
|
51224
|
+
this.Height=outData.LineCount*this.LineHeight;
|
|
51225
|
+
return true;
|
|
51226
|
+
|
|
51227
|
+
/*
|
|
51219
51228
|
var date=new Date(parseInt(data.Date/10000),(data.Date/100%100-1),data.Date%100);
|
|
51220
51229
|
var strDate=IFrameSplitOperator.FormatDateString(data.Date);
|
|
51221
51230
|
var title2=g_JSChartLocalization.GetText(WEEK_NAME[date.getDay()],this.LanguageID);
|
|
@@ -51305,6 +51314,178 @@ function HistoryDataStringFormat()
|
|
|
51305
51314
|
|
|
51306
51315
|
this.Height=this.LineCount*this.LineHeight;
|
|
51307
51316
|
return true;
|
|
51317
|
+
*/
|
|
51318
|
+
}
|
|
51319
|
+
|
|
51320
|
+
this.GenerateTitleHtml=function(data)
|
|
51321
|
+
{
|
|
51322
|
+
var lineCount=0;
|
|
51323
|
+
var strHtml="", text;
|
|
51324
|
+
if (data.Name)
|
|
51325
|
+
{
|
|
51326
|
+
text=`<span style='color:rgb(0,0,0);font:微软雅黑;font-size:12px;text-align:center;display: block;'>${data.Name}</span>`;
|
|
51327
|
+
strHtml+=text;
|
|
51328
|
+
++lineCount;
|
|
51329
|
+
}
|
|
51330
|
+
|
|
51331
|
+
if (data.Title)
|
|
51332
|
+
{
|
|
51333
|
+
text=`<span class='tooltip-title'>${data.Title}</span>`;
|
|
51334
|
+
strHtml+=text;
|
|
51335
|
+
++lineCount;
|
|
51336
|
+
}
|
|
51337
|
+
|
|
51338
|
+
if (IFrameSplitOperator.IsNonEmptyArray(data.AryText))
|
|
51339
|
+
{
|
|
51340
|
+
for(var i=0;i<data.AryText.length;++i)
|
|
51341
|
+
{
|
|
51342
|
+
var item=data.AryText[i];
|
|
51343
|
+
if (i>0) strHtml+='<br/>';
|
|
51344
|
+
var text=`<span class='tooltip-con'>${item.Title}</span><span class='tooltip-num' style='color:${item.Color};'>${item.Text}</span>`;
|
|
51345
|
+
strHtml+=text;
|
|
51346
|
+
++lineCount;
|
|
51347
|
+
}
|
|
51348
|
+
}
|
|
51349
|
+
|
|
51350
|
+
return { Html:strHtml, LineCount:lineCount };
|
|
51351
|
+
}
|
|
51352
|
+
|
|
51353
|
+
this.GetFormatTitle=function(data)
|
|
51354
|
+
{
|
|
51355
|
+
if (!data) return null;
|
|
51356
|
+
|
|
51357
|
+
var upperSymbol=this.Symbol.toUpperCase();
|
|
51358
|
+
var defaultfloatPrecision=GetfloatPrecision(this.Symbol);//价格小数位数
|
|
51359
|
+
var date=new Date(parseInt(data.Date/10000),(data.Date/100%100-1),data.Date%100);
|
|
51360
|
+
var strDate=IFrameSplitOperator.FormatDateString(data.Date);
|
|
51361
|
+
|
|
51362
|
+
var title2=g_JSChartLocalization.GetText(WEEK_NAME[date.getDay()],this.LanguageID);
|
|
51363
|
+
var isTickPeriod=ChartData.IsTickPeriod(this.Value.ChartPaint.Data.Period);
|
|
51364
|
+
if (ChartData.IsMinutePeriod(this.Value.ChartPaint.Data.Period,true)) // 分钟周期
|
|
51365
|
+
{
|
|
51366
|
+
title2=IFrameSplitOperator.FormatTimeString(data.Time);
|
|
51367
|
+
}
|
|
51368
|
+
else if (ChartData.IsSecondPeriod(this.Value.ChartPaint.Data.Period) || isTickPeriod)
|
|
51369
|
+
{
|
|
51370
|
+
title2=IFrameSplitOperator.FormatTimeString(data.Time,'HH:MM:SS');
|
|
51371
|
+
}
|
|
51372
|
+
|
|
51373
|
+
var result={ AryText:null, Title:`${strDate}  ${title2}`, Name:null };
|
|
51374
|
+
if (isTickPeriod)
|
|
51375
|
+
{
|
|
51376
|
+
var aryText=
|
|
51377
|
+
[
|
|
51378
|
+
{
|
|
51379
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Price',this.LanguageID),
|
|
51380
|
+
Text:IFrameSplitOperator.IsNumber(data.Open)? data.Open.toFixed(defaultfloatPrecision):'--',
|
|
51381
|
+
Color:this.GetColor(data.Open,data.YClose)
|
|
51382
|
+
},
|
|
51383
|
+
];
|
|
51384
|
+
|
|
51385
|
+
if (IFrameSplitOperator.IsNumber(data.YClose))
|
|
51386
|
+
{
|
|
51387
|
+
var increase=(data.Close-data.YClose)/data.YClose*100;
|
|
51388
|
+
var item=
|
|
51389
|
+
{
|
|
51390
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Increase',this.LanguageID),
|
|
51391
|
+
Text:`${increase.toFixed(2)}%`,
|
|
51392
|
+
Color:this.GetColor(increase,0)
|
|
51393
|
+
}
|
|
51394
|
+
aryText.push(item);
|
|
51395
|
+
}
|
|
51396
|
+
|
|
51397
|
+
result.AryText=aryText;
|
|
51398
|
+
}
|
|
51399
|
+
else if (data.IsNonTrade)
|
|
51400
|
+
{
|
|
51401
|
+
|
|
51402
|
+
}
|
|
51403
|
+
else
|
|
51404
|
+
{
|
|
51405
|
+
var vol=data.Vol;
|
|
51406
|
+
if (upperSymbol && MARKET_SUFFIX_NAME.IsSHSZ(upperSymbol)) vol/=100; //A股统一转成手
|
|
51407
|
+
var eventUnchangeKLine=null; //定制平盘K线颜色事件
|
|
51408
|
+
if (this.GetEventCallback) eventUnchangeKLine=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_UNCHANGE_KLINE_TITLE_COLOR);
|
|
51409
|
+
|
|
51410
|
+
var aryText=
|
|
51411
|
+
[
|
|
51412
|
+
{
|
|
51413
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Open',this.LanguageID),
|
|
51414
|
+
Text:IFrameSplitOperator.IsNumber(data.Open)? data.Open.toFixed(defaultfloatPrecision):'--',
|
|
51415
|
+
Color:this.GetPriceColor("DivTooltip-Open",data.Open,data.YClose,data,eventUnchangeKLine),
|
|
51416
|
+
},
|
|
51417
|
+
{
|
|
51418
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-High',this.LanguageID),
|
|
51419
|
+
Text:IFrameSplitOperator.IsNumber(data.High)? data.High.toFixed(defaultfloatPrecision):'--',
|
|
51420
|
+
Color:this.GetPriceColor("DivTooltip-High",data.High,data.YClose,data,eventUnchangeKLine)
|
|
51421
|
+
},
|
|
51422
|
+
{
|
|
51423
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Low',this.LanguageID),
|
|
51424
|
+
Text:IFrameSplitOperator.IsNumber(data.Low)? data.Low.toFixed(defaultfloatPrecision):'--',
|
|
51425
|
+
Color:this.GetPriceColor('DivTooltip-Low',data.Low,data.YClose,data,eventUnchangeKLine)
|
|
51426
|
+
},
|
|
51427
|
+
{
|
|
51428
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Close',this.LanguageID),
|
|
51429
|
+
Text:IFrameSplitOperator.IsNumber(data.Close)? data.Close.toFixed(defaultfloatPrecision):'--',
|
|
51430
|
+
Color:this.GetPriceColor('DivTooltip-Close',data.Close,data.YClose,data,eventUnchangeKLine)
|
|
51431
|
+
},
|
|
51432
|
+
{
|
|
51433
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Vol',this.LanguageID),
|
|
51434
|
+
Text:IFrameSplitOperator.IsNumber(vol)? IFrameSplitOperator.FormatValueString(vol,2,this.LanguageID):'--',
|
|
51435
|
+
Color:this.VolColor
|
|
51436
|
+
},
|
|
51437
|
+
{
|
|
51438
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Amount',this.LanguageID),
|
|
51439
|
+
Text:IFrameSplitOperator.IsNumber(data.Amount)? IFrameSplitOperator.FormatValueString(data.Amount,2,this.LanguageID):'--',
|
|
51440
|
+
Color:this.AmountColor
|
|
51441
|
+
}
|
|
51442
|
+
];
|
|
51443
|
+
|
|
51444
|
+
if (IFrameSplitOperator.IsNumber(data.YClose))
|
|
51445
|
+
{
|
|
51446
|
+
var increase=(data.Close-data.YClose)/data.YClose*100;
|
|
51447
|
+
var item=
|
|
51448
|
+
{
|
|
51449
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Increase',this.LanguageID),
|
|
51450
|
+
Text:`${increase.toFixed(2)}%`,
|
|
51451
|
+
Color:this.GetColor(increase,0)
|
|
51452
|
+
}
|
|
51453
|
+
aryText.push(item);
|
|
51454
|
+
}
|
|
51455
|
+
|
|
51456
|
+
if(MARKET_SUFFIX_NAME.IsSHSZStockA(this.Symbol) && data.FlowCapital>0) //换手率
|
|
51457
|
+
{
|
|
51458
|
+
var value=data.Vol/data.FlowCapital*100;
|
|
51459
|
+
var item=
|
|
51460
|
+
{
|
|
51461
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Exchange',this.LanguageID),
|
|
51462
|
+
Text:`${value.toFixed(2)}%`,
|
|
51463
|
+
Color:this.TurnoverRateColor
|
|
51464
|
+
}
|
|
51465
|
+
aryText.push(item);
|
|
51466
|
+
}
|
|
51467
|
+
|
|
51468
|
+
if (MARKET_SUFFIX_NAME.IsFutures(upperSymbol) && IFrameSplitOperator.IsNumber(data.Position))
|
|
51469
|
+
{
|
|
51470
|
+
var item=
|
|
51471
|
+
{
|
|
51472
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Position',this.LanguageID),
|
|
51473
|
+
Text:`${data.Position}`,
|
|
51474
|
+
Color:this.PositionColor
|
|
51475
|
+
}
|
|
51476
|
+
}
|
|
51477
|
+
|
|
51478
|
+
//叠加股票
|
|
51479
|
+
if (this.Value.ChartPaint.Name=="Overlay-KLine")
|
|
51480
|
+
{
|
|
51481
|
+
result.Name=this.Value.ChartPaint.Title;
|
|
51482
|
+
}
|
|
51483
|
+
|
|
51484
|
+
result.AryText=aryText;
|
|
51485
|
+
}
|
|
51486
|
+
|
|
51487
|
+
|
|
51488
|
+
return result;
|
|
51308
51489
|
}
|
|
51309
51490
|
|
|
51310
51491
|
this.GetColor=function(price,yclse)
|
|
@@ -128141,7 +128322,7 @@ function ScrollBarBGChart()
|
|
|
128141
128322
|
|
|
128142
128323
|
|
|
128143
128324
|
|
|
128144
|
-
var HQCHART_VERSION="1.1.
|
|
128325
|
+
var HQCHART_VERSION="1.1.12504";
|
|
128145
128326
|
|
|
128146
128327
|
function PrintHQChartVersion()
|
|
128147
128328
|
{
|
|
@@ -51259,7 +51259,16 @@ function HistoryDataStringFormat()
|
|
|
51259
51259
|
|
|
51260
51260
|
this.Width=157;
|
|
51261
51261
|
if (this.LanguageID==JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID) this.Width=180;
|
|
51262
|
+
var titleData=this.GetFormatTitle(data);
|
|
51263
|
+
if (!titleData) return false;
|
|
51264
|
+
var outData=this.GenerateTitleHtml(titleData);
|
|
51265
|
+
if (!outData) return false;
|
|
51262
51266
|
|
|
51267
|
+
this.Text=outData.Html;
|
|
51268
|
+
this.Height=outData.LineCount*this.LineHeight;
|
|
51269
|
+
return true;
|
|
51270
|
+
|
|
51271
|
+
/*
|
|
51263
51272
|
var date=new Date(parseInt(data.Date/10000),(data.Date/100%100-1),data.Date%100);
|
|
51264
51273
|
var strDate=IFrameSplitOperator.FormatDateString(data.Date);
|
|
51265
51274
|
var title2=g_JSChartLocalization.GetText(WEEK_NAME[date.getDay()],this.LanguageID);
|
|
@@ -51349,6 +51358,178 @@ function HistoryDataStringFormat()
|
|
|
51349
51358
|
|
|
51350
51359
|
this.Height=this.LineCount*this.LineHeight;
|
|
51351
51360
|
return true;
|
|
51361
|
+
*/
|
|
51362
|
+
}
|
|
51363
|
+
|
|
51364
|
+
this.GenerateTitleHtml=function(data)
|
|
51365
|
+
{
|
|
51366
|
+
var lineCount=0;
|
|
51367
|
+
var strHtml="", text;
|
|
51368
|
+
if (data.Name)
|
|
51369
|
+
{
|
|
51370
|
+
text=`<span style='color:rgb(0,0,0);font:微软雅黑;font-size:12px;text-align:center;display: block;'>${data.Name}</span>`;
|
|
51371
|
+
strHtml+=text;
|
|
51372
|
+
++lineCount;
|
|
51373
|
+
}
|
|
51374
|
+
|
|
51375
|
+
if (data.Title)
|
|
51376
|
+
{
|
|
51377
|
+
text=`<span class='tooltip-title'>${data.Title}</span>`;
|
|
51378
|
+
strHtml+=text;
|
|
51379
|
+
++lineCount;
|
|
51380
|
+
}
|
|
51381
|
+
|
|
51382
|
+
if (IFrameSplitOperator.IsNonEmptyArray(data.AryText))
|
|
51383
|
+
{
|
|
51384
|
+
for(var i=0;i<data.AryText.length;++i)
|
|
51385
|
+
{
|
|
51386
|
+
var item=data.AryText[i];
|
|
51387
|
+
if (i>0) strHtml+='<br/>';
|
|
51388
|
+
var text=`<span class='tooltip-con'>${item.Title}</span><span class='tooltip-num' style='color:${item.Color};'>${item.Text}</span>`;
|
|
51389
|
+
strHtml+=text;
|
|
51390
|
+
++lineCount;
|
|
51391
|
+
}
|
|
51392
|
+
}
|
|
51393
|
+
|
|
51394
|
+
return { Html:strHtml, LineCount:lineCount };
|
|
51395
|
+
}
|
|
51396
|
+
|
|
51397
|
+
this.GetFormatTitle=function(data)
|
|
51398
|
+
{
|
|
51399
|
+
if (!data) return null;
|
|
51400
|
+
|
|
51401
|
+
var upperSymbol=this.Symbol.toUpperCase();
|
|
51402
|
+
var defaultfloatPrecision=GetfloatPrecision(this.Symbol);//价格小数位数
|
|
51403
|
+
var date=new Date(parseInt(data.Date/10000),(data.Date/100%100-1),data.Date%100);
|
|
51404
|
+
var strDate=IFrameSplitOperator.FormatDateString(data.Date);
|
|
51405
|
+
|
|
51406
|
+
var title2=g_JSChartLocalization.GetText(WEEK_NAME[date.getDay()],this.LanguageID);
|
|
51407
|
+
var isTickPeriod=ChartData.IsTickPeriod(this.Value.ChartPaint.Data.Period);
|
|
51408
|
+
if (ChartData.IsMinutePeriod(this.Value.ChartPaint.Data.Period,true)) // 分钟周期
|
|
51409
|
+
{
|
|
51410
|
+
title2=IFrameSplitOperator.FormatTimeString(data.Time);
|
|
51411
|
+
}
|
|
51412
|
+
else if (ChartData.IsSecondPeriod(this.Value.ChartPaint.Data.Period) || isTickPeriod)
|
|
51413
|
+
{
|
|
51414
|
+
title2=IFrameSplitOperator.FormatTimeString(data.Time,'HH:MM:SS');
|
|
51415
|
+
}
|
|
51416
|
+
|
|
51417
|
+
var result={ AryText:null, Title:`${strDate}  ${title2}`, Name:null };
|
|
51418
|
+
if (isTickPeriod)
|
|
51419
|
+
{
|
|
51420
|
+
var aryText=
|
|
51421
|
+
[
|
|
51422
|
+
{
|
|
51423
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Price',this.LanguageID),
|
|
51424
|
+
Text:IFrameSplitOperator.IsNumber(data.Open)? data.Open.toFixed(defaultfloatPrecision):'--',
|
|
51425
|
+
Color:this.GetColor(data.Open,data.YClose)
|
|
51426
|
+
},
|
|
51427
|
+
];
|
|
51428
|
+
|
|
51429
|
+
if (IFrameSplitOperator.IsNumber(data.YClose))
|
|
51430
|
+
{
|
|
51431
|
+
var increase=(data.Close-data.YClose)/data.YClose*100;
|
|
51432
|
+
var item=
|
|
51433
|
+
{
|
|
51434
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Increase',this.LanguageID),
|
|
51435
|
+
Text:`${increase.toFixed(2)}%`,
|
|
51436
|
+
Color:this.GetColor(increase,0)
|
|
51437
|
+
}
|
|
51438
|
+
aryText.push(item);
|
|
51439
|
+
}
|
|
51440
|
+
|
|
51441
|
+
result.AryText=aryText;
|
|
51442
|
+
}
|
|
51443
|
+
else if (data.IsNonTrade)
|
|
51444
|
+
{
|
|
51445
|
+
|
|
51446
|
+
}
|
|
51447
|
+
else
|
|
51448
|
+
{
|
|
51449
|
+
var vol=data.Vol;
|
|
51450
|
+
if (upperSymbol && MARKET_SUFFIX_NAME.IsSHSZ(upperSymbol)) vol/=100; //A股统一转成手
|
|
51451
|
+
var eventUnchangeKLine=null; //定制平盘K线颜色事件
|
|
51452
|
+
if (this.GetEventCallback) eventUnchangeKLine=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_UNCHANGE_KLINE_TITLE_COLOR);
|
|
51453
|
+
|
|
51454
|
+
var aryText=
|
|
51455
|
+
[
|
|
51456
|
+
{
|
|
51457
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Open',this.LanguageID),
|
|
51458
|
+
Text:IFrameSplitOperator.IsNumber(data.Open)? data.Open.toFixed(defaultfloatPrecision):'--',
|
|
51459
|
+
Color:this.GetPriceColor("DivTooltip-Open",data.Open,data.YClose,data,eventUnchangeKLine),
|
|
51460
|
+
},
|
|
51461
|
+
{
|
|
51462
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-High',this.LanguageID),
|
|
51463
|
+
Text:IFrameSplitOperator.IsNumber(data.High)? data.High.toFixed(defaultfloatPrecision):'--',
|
|
51464
|
+
Color:this.GetPriceColor("DivTooltip-High",data.High,data.YClose,data,eventUnchangeKLine)
|
|
51465
|
+
},
|
|
51466
|
+
{
|
|
51467
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Low',this.LanguageID),
|
|
51468
|
+
Text:IFrameSplitOperator.IsNumber(data.Low)? data.Low.toFixed(defaultfloatPrecision):'--',
|
|
51469
|
+
Color:this.GetPriceColor('DivTooltip-Low',data.Low,data.YClose,data,eventUnchangeKLine)
|
|
51470
|
+
},
|
|
51471
|
+
{
|
|
51472
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Close',this.LanguageID),
|
|
51473
|
+
Text:IFrameSplitOperator.IsNumber(data.Close)? data.Close.toFixed(defaultfloatPrecision):'--',
|
|
51474
|
+
Color:this.GetPriceColor('DivTooltip-Close',data.Close,data.YClose,data,eventUnchangeKLine)
|
|
51475
|
+
},
|
|
51476
|
+
{
|
|
51477
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Vol',this.LanguageID),
|
|
51478
|
+
Text:IFrameSplitOperator.IsNumber(vol)? IFrameSplitOperator.FormatValueString(vol,2,this.LanguageID):'--',
|
|
51479
|
+
Color:this.VolColor
|
|
51480
|
+
},
|
|
51481
|
+
{
|
|
51482
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Amount',this.LanguageID),
|
|
51483
|
+
Text:IFrameSplitOperator.IsNumber(data.Amount)? IFrameSplitOperator.FormatValueString(data.Amount,2,this.LanguageID):'--',
|
|
51484
|
+
Color:this.AmountColor
|
|
51485
|
+
}
|
|
51486
|
+
];
|
|
51487
|
+
|
|
51488
|
+
if (IFrameSplitOperator.IsNumber(data.YClose))
|
|
51489
|
+
{
|
|
51490
|
+
var increase=(data.Close-data.YClose)/data.YClose*100;
|
|
51491
|
+
var item=
|
|
51492
|
+
{
|
|
51493
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Increase',this.LanguageID),
|
|
51494
|
+
Text:`${increase.toFixed(2)}%`,
|
|
51495
|
+
Color:this.GetColor(increase,0)
|
|
51496
|
+
}
|
|
51497
|
+
aryText.push(item);
|
|
51498
|
+
}
|
|
51499
|
+
|
|
51500
|
+
if(MARKET_SUFFIX_NAME.IsSHSZStockA(this.Symbol) && data.FlowCapital>0) //换手率
|
|
51501
|
+
{
|
|
51502
|
+
var value=data.Vol/data.FlowCapital*100;
|
|
51503
|
+
var item=
|
|
51504
|
+
{
|
|
51505
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Exchange',this.LanguageID),
|
|
51506
|
+
Text:`${value.toFixed(2)}%`,
|
|
51507
|
+
Color:this.TurnoverRateColor
|
|
51508
|
+
}
|
|
51509
|
+
aryText.push(item);
|
|
51510
|
+
}
|
|
51511
|
+
|
|
51512
|
+
if (MARKET_SUFFIX_NAME.IsFutures(upperSymbol) && IFrameSplitOperator.IsNumber(data.Position))
|
|
51513
|
+
{
|
|
51514
|
+
var item=
|
|
51515
|
+
{
|
|
51516
|
+
Title:g_JSChartLocalization.GetText('DivTooltip-Position',this.LanguageID),
|
|
51517
|
+
Text:`${data.Position}`,
|
|
51518
|
+
Color:this.PositionColor
|
|
51519
|
+
}
|
|
51520
|
+
}
|
|
51521
|
+
|
|
51522
|
+
//叠加股票
|
|
51523
|
+
if (this.Value.ChartPaint.Name=="Overlay-KLine")
|
|
51524
|
+
{
|
|
51525
|
+
result.Name=this.Value.ChartPaint.Title;
|
|
51526
|
+
}
|
|
51527
|
+
|
|
51528
|
+
result.AryText=aryText;
|
|
51529
|
+
}
|
|
51530
|
+
|
|
51531
|
+
|
|
51532
|
+
return result;
|
|
51352
51533
|
}
|
|
51353
51534
|
|
|
51354
51535
|
this.GetColor=function(price,yclse)
|
|
@@ -128294,7 +128475,7 @@ function HQChartScriptWorker()
|
|
|
128294
128475
|
|
|
128295
128476
|
|
|
128296
128477
|
|
|
128297
|
-
var HQCHART_VERSION="1.1.
|
|
128478
|
+
var HQCHART_VERSION="1.1.12504";
|
|
128298
128479
|
|
|
128299
128480
|
function PrintHQChartVersion()
|
|
128300
128481
|
{
|