hqchart 1.1.12598 → 1.1.12607
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 +64 -5
- package/package.json +1 -1
- package/src/jscommon/umychart.deal.js +36 -9
- package/src/jscommon/umychart.js +66 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +103 -10
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +103 -10
- package/src/jscommon/umychart.wechat/umychart.framesplit.wechat.js +18 -0
- package/src/jscommon/umychart.wechat/umychart.version.wechat.js +1 -1
package/lib/umychart.vue.js
CHANGED
|
@@ -4922,8 +4922,66 @@ if(!pageInfo)return;if(!this.OverlayIndex)return;if(!IFrameSplitOperator.IsNonEm
|
|
|
4922
4922
|
info.IsLast=pageInfo.IsLast;//是否是最后一个数据
|
|
4923
4923
|
if(IFrameSplitOperator.IsNumber(option.LineType))info.LineType=option.LineType;info.Value=item.Value;var text=IFrameSplitOperator.FormatValueString(item.Value,floatPrecision,this.LanguageID);if(option.Position=='left')info.Message[0]=text;else info.Message[1]=text;if(!pageInfo.IsLast){var config={};if(!pageInfo.IsLast)config.EmptyBGColor=g_JSChartResource.FrameLatestPrice.EmptyBGColor;info.ExtendData={Custom:config};}if(event){var sendData={PreventDefault:false,Label:info,Data:item,IndexName:chart.IndexName,OverlayIdentify:this.OverlayIndex.Identify};event.Callback(event,sendData,this);if(sendData.PreventDefault)continue;}this.Frame.CustomHorizontalInfo.push(info);}}};}//字符串格式化 千分位分割
|
|
4924
4924
|
IFrameSplitOperator.FormatValueThousandsString=function(value,floatPrecision){if(value==null||isNaN(value)){if(floatPrecision>0){var nullText='-.';for(var i=0;i<floatPrecision;++i){nullText+='-';}return nullText;}return'--';}var result='';var num=value.toFixed(floatPrecision);if(floatPrecision>0){var numFloat=num.split('.')[1];var numM=num.split('.')[0];while(numM.length>3){result=','+numM.slice(-3)+result;numM=numM.slice(0,numM.length-3);}if(numM){result=numM+result+'.'+numFloat;}}else{while(num.length>3){result=','+num.slice(-3)+result;num=num.slice(0,num.length-3);}if(num){result=num+result;}}return result;};//数据输出格式化 floatPrecision=小数位数
|
|
4925
|
-
IFrameSplitOperator.FormatValueString=function(value,floatPrecision,languageID){
|
|
4926
|
-
|
|
4925
|
+
IFrameSplitOperator.FormatValueString=function(value,floatPrecision,languageID){/*
|
|
4926
|
+
if (value==null || isNaN(value))
|
|
4927
|
+
{
|
|
4928
|
+
if (floatPrecision>0)
|
|
4929
|
+
{
|
|
4930
|
+
var nullText='-.';
|
|
4931
|
+
for(var i=0;i<floatPrecision;++i)
|
|
4932
|
+
nullText+='-';
|
|
4933
|
+
return nullText;
|
|
4934
|
+
}
|
|
4935
|
+
|
|
4936
|
+
return '--';
|
|
4937
|
+
}
|
|
4938
|
+
|
|
4939
|
+
if (value<0.00000000001 && value>-0.00000000001)
|
|
4940
|
+
{
|
|
4941
|
+
return "0";
|
|
4942
|
+
}
|
|
4943
|
+
|
|
4944
|
+
var absValue = Math.abs(value);
|
|
4945
|
+
if (languageID===JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID)
|
|
4946
|
+
{
|
|
4947
|
+
if (absValue < 10000)
|
|
4948
|
+
return value.toFixed(floatPrecision);
|
|
4949
|
+
else if (absValue < 1000000)
|
|
4950
|
+
return (value/1000).toFixed(floatPrecision)+"K";
|
|
4951
|
+
else if (absValue < 1000000000)
|
|
4952
|
+
return (value/1000000).toFixed(floatPrecision)+"M";
|
|
4953
|
+
else if (absValue < 1000000000000)
|
|
4954
|
+
return (value/1000000000).toFixed(floatPrecision)+"B";
|
|
4955
|
+
else
|
|
4956
|
+
return (value/1000000000000).toFixed(floatPrecision)+"T";
|
|
4957
|
+
}
|
|
4958
|
+
else if (languageID===JSCHART_LANGUAGE_ID.LANGUAGE_TRADITIONAL_CHINESE_ID) //繁体
|
|
4959
|
+
{
|
|
4960
|
+
if (absValue < 10000)
|
|
4961
|
+
return value.toFixed(floatPrecision);
|
|
4962
|
+
else if (absValue < 100000000)
|
|
4963
|
+
return (value/10000).toFixed(floatPrecision)+"萬";
|
|
4964
|
+
else if (absValue < 1000000000000)
|
|
4965
|
+
return (value/100000000).toFixed(floatPrecision)+"億";
|
|
4966
|
+
else
|
|
4967
|
+
return (value/1000000000000).toFixed(floatPrecision)+"萬億";
|
|
4968
|
+
}
|
|
4969
|
+
else
|
|
4970
|
+
{
|
|
4971
|
+
if (absValue < 10000)
|
|
4972
|
+
return value.toFixed(floatPrecision);
|
|
4973
|
+
else if (absValue<1000000)
|
|
4974
|
+
return (value/10000).toFixed(floatPrecision)+"万";
|
|
4975
|
+
else if (absValue < 100000000)
|
|
4976
|
+
return (value/10000).toFixed(floatPrecision)+"万";
|
|
4977
|
+
else if (absValue < 1000000000000)
|
|
4978
|
+
return (value/100000000).toFixed(floatPrecision)+"亿";
|
|
4979
|
+
else
|
|
4980
|
+
return (value/1000000000000).toFixed(floatPrecision)+"万亿";
|
|
4981
|
+
}
|
|
4982
|
+
*/return IFrameSplitOperator.FormatValueStringV2(value,floatPrecision,floatPrecision,languageID);};//数据输出格式化 floatPrecision=原始小数位数 floatPrecision2=转换成'万','亿'..的小数位
|
|
4983
|
+
IFrameSplitOperator.FormatValueStringV2=function(value,floatPrecision,floatPrecision2,languageID){if(value==null||isNaN(value)){if(floatPrecision>0){var nullText='-.';for(var i=0;i<floatPrecision;++i){nullText+='-';}return nullText;}return'--';}if(value<0.00000000001&&value>-0.00000000001){return"0";}var absValue=Math.abs(value);if(languageID===JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID){if(absValue<10000)return value.toFixed(floatPrecision);else if(absValue<1000000)return(value/1000).toFixed(floatPrecision2)+"K";else if(absValue<1000000000)return(value/1000000).toFixed(floatPrecision2)+"M";else if(absValue<1000000000000)return(value/1000000000).toFixed(floatPrecision2)+"B";else return(value/1000000000000).toFixed(floatPrecision2)+"T";}else if(languageID===JSCHART_LANGUAGE_ID.LANGUAGE_TRADITIONAL_CHINESE_ID)//繁体
|
|
4984
|
+
{if(absValue<10000)return value.toFixed(floatPrecision);else if(absValue<100000000)return(value/10000).toFixed(floatPrecision2)+"萬";else if(absValue<1000000000000)return(value/100000000).toFixed(floatPrecision2)+"億";else return(value/1000000000000).toFixed(floatPrecision2)+"萬億";}else{if(absValue<10000)return value.toFixed(floatPrecision);else if(absValue<1000000)return(value/10000).toFixed(floatPrecision2)+"万";else if(absValue<100000000)return(value/10000).toFixed(floatPrecision2)+"万";else if(absValue<1000000000000)return(value/100000000).toFixed(floatPrecision2)+"亿";else return(value/1000000000000).toFixed(floatPrecision2)+"万亿";}return'';};//成交量显示
|
|
4927
4985
|
IFrameSplitOperator.FormatVolString=function(value,languageID){var absValue=Math.abs(value);if(absValue<100000)return value.toFixed(0);else if(absValue<10000000)return(value/10000).toFixed(1)+"万";else if(absValue<100000000)return(value/10000).toFixed(0)+"万";else if(absValue<1000000000)return(value/100000000).toFixed(2)+"亿";else if(absValue<1000000000000)return(value/100000000).toFixed(1)+"亿";else return(value/1000000000000).toFixed(1)+"万亿";};//整形输出格式化 floatPrecision=小数位数
|
|
4928
4986
|
IFrameSplitOperator.FromatIntegerString=function(value,floatPrecision,languageID){if(value<10000&&IFrameSplitOperator.IsInteger(value))floatPrecision=0;//<10000的整形 去掉小数位数
|
|
4929
4987
|
return IFrameSplitOperator.FormatValueString(value,floatPrecision,languageID);};IFrameSplitOperator.NumberToString=function(value){if(value<10)return'0'+value.toString();return value.toString();};//毫秒格式 固定3位, 不足前面自动补0
|
|
@@ -11855,7 +11913,7 @@ WHITE_ID:0//白色风格
|
|
|
11855
11913
|
this.CanvasElement=document.createElement("canvas");this.CanvasElement.className='jsdeallist-drawing';this.CanvasElement.id=Guid();this.CanvasElement.setAttribute("tabindex",0);if(this.CanvasElement.style)this.CanvasElement.style.outline='none';if(divElement.hasChildNodes()){JSConsole.Chart.Log("[JSDealChart::JSDealList] divElement hasChildNodes",divElement.childNodes);}divElement.appendChild(this.CanvasElement);this.OnSize=function(){//画布大小通过div获取
|
|
11856
11914
|
var height=parseInt(this.DivElement.style.height.replace("px",""));this.CanvasElement.height=height;this.CanvasElement.width=parseInt(this.DivElement.style.width.replace("px",""));this.CanvasElement.style.width=this.CanvasElement.width+'px';this.CanvasElement.style.height=this.CanvasElement.height+'px';var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
|
|
11857
11915
|
this.CanvasElement.height*=pixelTatio;this.CanvasElement.width*=pixelTatio;JSConsole.Chart.Log('[JSDealChart::OnSize] devicePixelRatio='+window.devicePixelRatio+', height='+this.CanvasElement.height+', width='+this.CanvasElement.width);if(this.JSChartContainer&&this.JSChartContainer.OnSize){this.JSChartContainer.OnSize();}};this.SetOption=function(option){var chart=this.CreateJSDealChartContainer(option);if(!chart)return false;if(option.OnCreatedCallback)option.OnCreatedCallback(chart);this.JSChartContainer=chart;this.DivElement.JSChart=this;//div中保存一份
|
|
11858
|
-
if(!option.Symbol){chart.Draw();}else{chart.ChangeSymbol(option.Symbol);}};this.CreateJSDealChartContainer=function(option){var chart=new JSDealChartContainer(this.CanvasElement);chart.Create(option);if(option.NetworkFilter)chart.NetworkFilter=option.NetworkFilter;if(IFrameSplitOperator.IsNonEmptyArray(option.Column))chart.SetColumn(option.Column);this.SetChartBorder(chart,option);//是否自动更新
|
|
11916
|
+
if(!option.Symbol){chart.Draw();}else{chart.ChangeSymbol(option.Symbol);}};this.CreateJSDealChartContainer=function(option){var chart=new JSDealChartContainer(this.CanvasElement);chart.Create(option);if(option.NetworkFilter)chart.NetworkFilter=option.NetworkFilter;if(IFrameSplitOperator.IsNonEmptyArray(option.Column))chart.SetColumn(option.Column);if(IFrameSplitOperator.IsNumber(option.ShowOrder))chart.ChartPaint[0].ShowOrder=option.ShowOrder;this.SetChartBorder(chart,option);//是否自动更新
|
|
11859
11917
|
if(option.IsAutoUpdate!=null)chart.IsAutoUpdate=option.IsAutoUpdate;if(option.AutoUpdateFrequency>0)chart.AutoUpdateFrequency=option.AutoUpdateFrequency;if(IFrameSplitOperator.IsBool(option.EnableFilter))chart.EnableFilter=option.EnableFilter;//注册事件
|
|
11860
11918
|
if(option.EventCallback){for(var i=0;i<option.EventCallback.length;++i){var item=option.EventCallback[i];chart.AddEventCallback(item);}}return chart;};this.SetChartBorder=function(chart,option){if(!option.Border)return;var item=option.Border;if(IFrameSplitOperator.IsNumber(option.Border.Left))chart.Frame.ChartBorder.Left=option.Border.Left;if(IFrameSplitOperator.IsNumber(option.Border.Right))chart.Frame.ChartBorder.Right=option.Border.Right;if(IFrameSplitOperator.IsNumber(option.Border.Top))chart.Frame.ChartBorder.Top=option.Border.Top;if(IFrameSplitOperator.IsNumber(option.Border.Bottom))chart.Frame.ChartBorder.Bottom=option.Border.Bottom;var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
|
|
11861
11919
|
chart.Frame.ChartBorder.Left*=pixelTatio;chart.Frame.ChartBorder.Right*=pixelTatio;chart.Frame.ChartBorder.Top*=pixelTatio;chart.Frame.ChartBorder.Bottom*=pixelTatio;};/////////////////////////////////////////////////////////////////////////////
|
|
@@ -11958,6 +12016,7 @@ this.Open;//开盘价
|
|
|
11958
12016
|
this.Decimal=2;//小数位数
|
|
11959
12017
|
this.IsSingleTable=false;//单表模式
|
|
11960
12018
|
this.IsShowHeader=true;//是否显示表头
|
|
12019
|
+
this.ShowOrder=1;//0=顺序 1=倒序
|
|
11961
12020
|
this.SizeChange=true;//涨跌颜色
|
|
11962
12021
|
this.UpColor=g_JSChartResource.DealList.UpTextColor;this.DownColor=g_JSChartResource.DealList.DownTextColor;this.UnchagneColor=g_JSChartResource.DealList.UnchagneTextColor;this.BorderColor=g_JSChartResource.DealList.BorderColor;//边框线
|
|
11963
12022
|
//表头配置
|
|
@@ -11970,7 +12029,7 @@ this.ItemFontConfig={Size:g_JSChartResource.DealList.Row.Font.Size,Name:g_JSChar
|
|
|
11970
12029
|
}this.Column.push(colItem);}};this.GetDefaultColunm=function(id){var DEFAULT_COLUMN=[{Type:DEAL_COLUMN_ID.TIME_ID,Title:"时间",TextAlign:"center",Width:null,TextColor:g_JSChartResource.DealList.FieldColor.Time,MaxText:"88:88:88",Foramt:"HH:MM:SS"},{Type:DEAL_COLUMN_ID.PRICE_ID,Title:"价格",TextAlign:"center",Width:null,MaxText:"888888.88"},{Type:DEAL_COLUMN_ID.VOL_ID,Title:"成交",TextAlign:"right",Width:null,TextColor:g_JSChartResource.DealList.FieldColor.Vol,MaxText:"888888"},{Type:DEAL_COLUMN_ID.BS_ID,Title:"",TextAlign:"right",Width:null,MaxText:"擎"},{Type:DEAL_COLUMN_ID.DEAL_ID,Title:"笔数",TextAlign:"right",Width:null,TextColor:g_JSChartResource.DealList.FieldColor.Deal,MaxText:"8888"},{Type:DEAL_COLUMN_ID.UPDOWN_ID,Title:"涨跌",TextAlign:"right",Width:null,MaxText:"-8888.88"},{Type:DEAL_COLUMN_ID.STRING_TIME_ID,Title:"时间",TextAlign:"center",Width:null,TextColor:g_JSChartResource.DealList.FieldColor.Time,MaxText:"88:88:88"},{Type:DEAL_COLUMN_ID.INDEX_ID,Title:"序号",TextAlign:"center",Width:null,TextColor:g_JSChartResource.DealList.FieldColor.Index,MaxText:"88888"},{Type:DEAL_COLUMN_ID.MULTI_BAR_ID,Title:"柱子",TextAlign:"center",Width:null,TextColor:g_JSChartResource.DealList.FieldColor.BarTitle,MaxText:"888888"},{Type:DEAL_COLUMN_ID.CENTER_BAR_ID,Title:"柱子2",TextAlign:"center",Width:null,TextColor:g_JSChartResource.DealList.FieldColor.BarTitle,MaxText:"888888"},{Type:DEAL_COLUMN_ID.CUSTOM_TEXT_ID,Title:"自定义",TextAlign:"center",Width:null,TextColor:g_JSChartResource.DealList.FieldColor.Text,MaxText:"擎擎擎擎擎"}];for(var i=0;i<DEFAULT_COLUMN.length;++i){var item=DEFAULT_COLUMN[i];if(item.Type==id)return item;}return null;};this.Draw=function(){if(this.SizeChange)this.CalculateSize();else this.UpdateCacheData();this.DrawBorder();this.DrawHeader();this.DrawBody();this.SizeChange=false;};//更新缓存变量
|
|
11971
12030
|
this.UpdateCacheData=function(){this.RectClient.Left=this.ChartBorder.GetLeft();this.RectClient.Right=this.ChartBorder.GetRight();this.RectClient.Top=this.ChartBorder.GetTop();this.RectClient.Bottom=this.ChartBorder.GetBottom();this.Decimal=GetfloatPrecision(this.Symbol);};this.GetPageSize=function(recalculate)//recalculate 是否重新计算
|
|
11972
12031
|
{if(recalculate)this.CalculateSize();var size=this.TableCount*this.RowCount;return size;};this.CalculateSize=function()//计算大小
|
|
11973
|
-
{this.UpdateCacheData();var pixelRatio=GetDevicePixelRatio();this.HeaderFont=this.HeaderFontConfig.Size*pixelRatio+'px '+this.HeaderFontConfig.Name;this.ItemFont=this.ItemFontConfig.Size*pixelRatio+'px '+this.ItemFontConfig.Name;this.Canvas.font=this.ItemFont;var sumWidth=0,itemWidth=0;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];itemWidth=this.Canvas.measureText(item.MaxText).width;item.Width=itemWidth+4;sumWidth+=item.Width;}var clientWidth=this.RectClient.Right-this.RectClient.Left;this.TableCount=parseInt(clientWidth/sumWidth);if(this.IsSingleTable)this.TableCount=1;this.TableWidth=clientWidth/this.TableCount;this.HeaderHeight=this.GetFontHeight(this.HeaderFont,"擎")+this.HeaderMergin.Top+this.HeaderMergin.Bottom;if(!this.IsShowHeader)this.HeaderHeight=0;this.RowHeight=this.GetFontHeight(this.ItemFont,"擎")+this.HeaderMergin.Top+this.HeaderMergin.Bottom;this.RowCount=parseInt((this.RectClient.Bottom-this.RectClient.Top-this.HeaderHeight)/this.RowHeight);};this.DrawHeader=function(){if(!this.IsShowHeader)return;var left=this.RectClient.Left+this.HeaderMergin.Left;var top=this.RectClient.Top;var y=top+this.HeaderMergin.Top+(this.HeaderHeight-this.HeaderMergin.Top-this.HeaderMergin.Bottom)/2;this.Canvas.font=this.HeaderFont;this.Canvas.fillStyle=this.HeaderColor;for(var i=0,j=0;i<this.TableCount;++i){var tableLeft=left+this.TableWidth*i;var textLeft=tableLeft;for(j=0;j<this.Column.length;++j){var item=this.Column[j];var itemWidth=item.Width;if(j==this.Column.length-1)itemWidth=this.TableWidth-(textLeft-tableLeft)-this.HeaderMergin.Right-this.HeaderMergin.Left;var x=textLeft;if(item.TextAlign=='center'){x=textLeft+itemWidth/2;this.Canvas.textAlign="center";}else if(item.TextAlign=='right'){x=textLeft+itemWidth;this.Canvas.textAlign="right";}else{this.Canvas.textAlign="left";}this.Canvas.textBaseline="middle";this.Canvas.fillText(item.Title,x,y);textLeft+=item.Width;}}};this.DrawBorder=function(){var left=ToFixedPoint(this.RectClient.Left);var right=ToFixedPoint(this.RectClient.Right);var top=ToFixedPoint(this.RectClient.Top);var bottom=ToFixedPoint(this.RectClient.Bottom);this.Canvas.strokeStyle=this.BorderColor;this.Canvas.beginPath();if(this.IsShowHeader){this.Canvas.moveTo(left,top+this.HeaderHeight);this.Canvas.lineTo(right,top+this.HeaderHeight);}var tableLeft=ToFixedPoint(left+this.TableWidth);for(var i=1;i<this.TableCount;++i){this.Canvas.moveTo(tableLeft,top);this.Canvas.lineTo(tableLeft,bottom);tableLeft=ToFixedPoint(tableLeft+this.TableWidth);}this.Canvas.stroke();};this.DrawBody=function(){if(!this.Data)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;this.Canvas.font=this.ItemFont;var top=this.RectClient.Top+this.HeaderHeight;var left=this.RectClient.Left+this.HeaderMergin.Left;var dataCount=this.Data.Data.length;var index=this.Data.DataOffset;for(var i=0,j=0;i<this.TableCount;++i){var tableLeft=left+this.TableWidth*i;var textLeft=tableLeft;var textTop=top;for(j=0;j<this.RowCount&&index<dataCount;++j,++index){var dataItem=this.Data.Data[index];this.DrawRow(dataItem,textLeft,textTop,index);textTop+=this.RowHeight;}}};this.DrawRow=function(data,left,top,dataIndex,colIndex){var tableLeft=left;var tableRight=left+this.TableWidth;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];var textColor=item.TextColor;var text=null;var itemWidth=item.Width;var textAlign=item.TextAlign;if(left+itemWidth>tableRight)break;if(i==this.Column.length-1)itemWidth=this.TableWidth-(left-tableLeft)-this.HeaderMergin.Right-this.HeaderMergin.Left;if(item.Type==DEAL_COLUMN_ID.TIME_ID){text=IFrameSplitOperator.FormatTimeString(data.Time,item.Foramt);}else if(item.Type==DEAL_COLUMN_ID.STRING_TIME_ID){text=data.StrTime;}else if(item.Type==DEAL_COLUMN_ID.PRICE_ID){if(data.Price>this.YClose)textColor=this.UpColor;else if(data.Price<this.YClose)textColor=this.DownColor;else textColor=this.UnchagneColor;text=data.Price.toFixed(this.Decimal);}else if(item.Type==DEAL_COLUMN_ID.VOL_ID){text=IFrameSplitOperator.FormatValueString(data.Vol,0);textColor=this.GetVolColor(item,data);}else if(item.Type==DEAL_COLUMN_ID.DEAL_ID){text=IFrameSplitOperator.FormatValueString(data.Deal,0);}else if(item.Type==DEAL_COLUMN_ID.BS_ID){if(data.BS==1){text="B";textColor=this.UpColor;}else if(data.BS==2){text="S";textColor=this.DownColor;}}else if(item.Type==DEAL_COLUMN_ID.UPDOWN_ID){if(IFrameSplitOperator.IsNumber(this.YClose)){var value=data.Price-this.YClose;text=value.toFixed(2);if(value>0)textColor=this.UpColor;else if(value<0)textColor=this.DownColor;else textColor=this.UnchagneColor;}}else if(item.Type==DEAL_COLUMN_ID.INDEX_ID){text=(dataIndex+1).toString();}else if(item.Type==DEAL_COLUMN_ID.MULTI_BAR_ID){var rtItem={Left:left,Top:top,Width:itemWidth,Height:this.RowHeight};this.DrawMultiBar(item,data,rtItem);}else if(item.Type==DEAL_COLUMN_ID.CENTER_BAR_ID){var rtItem={Left:left,Top:top,Width:itemWidth,Height:this.RowHeight};this.DrawCenterBar(item,data,rtItem);}else if(item.Type==DEAL_COLUMN_ID.CUSTOM_TEXT_ID){var out={Text:null,TextColor:null,TextAlign:null};//输出
|
|
12032
|
+
{this.UpdateCacheData();var pixelRatio=GetDevicePixelRatio();this.HeaderFont=this.HeaderFontConfig.Size*pixelRatio+'px '+this.HeaderFontConfig.Name;this.ItemFont=this.ItemFontConfig.Size*pixelRatio+'px '+this.ItemFontConfig.Name;this.Canvas.font=this.ItemFont;var sumWidth=0,itemWidth=0;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];itemWidth=this.Canvas.measureText(item.MaxText).width;item.Width=itemWidth+4;sumWidth+=item.Width;}var clientWidth=this.RectClient.Right-this.RectClient.Left;this.TableCount=parseInt(clientWidth/sumWidth);if(this.IsSingleTable)this.TableCount=1;this.TableWidth=clientWidth/this.TableCount;this.HeaderHeight=this.GetFontHeight(this.HeaderFont,"擎")+this.HeaderMergin.Top+this.HeaderMergin.Bottom;if(!this.IsShowHeader)this.HeaderHeight=0;this.RowHeight=this.GetFontHeight(this.ItemFont,"擎")+this.HeaderMergin.Top+this.HeaderMergin.Bottom;this.RowCount=parseInt((this.RectClient.Bottom-this.RectClient.Top-this.HeaderHeight)/this.RowHeight);};this.DrawHeader=function(){if(!this.IsShowHeader)return;var left=this.RectClient.Left+this.HeaderMergin.Left;var top=this.RectClient.Top;var y=top+this.HeaderMergin.Top+(this.HeaderHeight-this.HeaderMergin.Top-this.HeaderMergin.Bottom)/2;this.Canvas.font=this.HeaderFont;this.Canvas.fillStyle=this.HeaderColor;for(var i=0,j=0;i<this.TableCount;++i){var tableLeft=left+this.TableWidth*i;var textLeft=tableLeft;for(j=0;j<this.Column.length;++j){var item=this.Column[j];var itemWidth=item.Width;if(j==this.Column.length-1)itemWidth=this.TableWidth-(textLeft-tableLeft)-this.HeaderMergin.Right-this.HeaderMergin.Left;var x=textLeft;if(item.TextAlign=='center'){x=textLeft+itemWidth/2;this.Canvas.textAlign="center";}else if(item.TextAlign=='right'){x=textLeft+itemWidth;this.Canvas.textAlign="right";}else{this.Canvas.textAlign="left";}this.Canvas.textBaseline="middle";this.Canvas.fillText(item.Title,x,y);textLeft+=item.Width;}}};this.DrawBorder=function(){var left=ToFixedPoint(this.RectClient.Left);var right=ToFixedPoint(this.RectClient.Right);var top=ToFixedPoint(this.RectClient.Top);var bottom=ToFixedPoint(this.RectClient.Bottom);this.Canvas.strokeStyle=this.BorderColor;this.Canvas.beginPath();if(this.IsShowHeader){this.Canvas.moveTo(left,top+this.HeaderHeight);this.Canvas.lineTo(right,top+this.HeaderHeight);}var tableLeft=ToFixedPoint(left+this.TableWidth);for(var i=1;i<this.TableCount;++i){this.Canvas.moveTo(tableLeft,top);this.Canvas.lineTo(tableLeft,bottom);tableLeft=ToFixedPoint(tableLeft+this.TableWidth);}this.Canvas.stroke();};this.DrawBody=function(){if(!this.Data)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;this.Canvas.font=this.ItemFont;var top=this.RectClient.Top+this.HeaderHeight;var left=this.RectClient.Left+this.HeaderMergin.Left;var dataCount=this.Data.Data.length;var index=this.Data.DataOffset;if(this.ShowOrder==1){var index=this.Data.DataOffset+this.TableCount*this.RowCount;if(index>=dataCount)index=dataCount-1;for(var i=0,j=0;i<this.TableCount;++i){var tableLeft=left+this.TableWidth*i;var textLeft=tableLeft;var textTop=top;for(j=0;j<this.RowCount&&index>=0;++j,--index){var dataItem=this.Data.Data[index];this.DrawRow(dataItem,textLeft,textTop,index);textTop+=this.RowHeight;}}}else{for(var i=0,j=0;i<this.TableCount;++i){var tableLeft=left+this.TableWidth*i;var textLeft=tableLeft;var textTop=top;for(j=0;j<this.RowCount&&index<dataCount;++j,++index){var dataItem=this.Data.Data[index];this.DrawRow(dataItem,textLeft,textTop,index);textTop+=this.RowHeight;}}}};this.DrawRow=function(data,left,top,dataIndex,colIndex){var tableLeft=left;var tableRight=left+this.TableWidth;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];var textColor=item.TextColor;var text=null;var itemWidth=item.Width;var textAlign=item.TextAlign;if(left+itemWidth>tableRight)break;if(i==this.Column.length-1)itemWidth=this.TableWidth-(left-tableLeft)-this.HeaderMergin.Right-this.HeaderMergin.Left;if(item.Type==DEAL_COLUMN_ID.TIME_ID){text=IFrameSplitOperator.FormatTimeString(data.Time,item.Foramt);}else if(item.Type==DEAL_COLUMN_ID.STRING_TIME_ID){text=data.StrTime;}else if(item.Type==DEAL_COLUMN_ID.PRICE_ID){if(data.Price>this.YClose)textColor=this.UpColor;else if(data.Price<this.YClose)textColor=this.DownColor;else textColor=this.UnchagneColor;text=data.Price.toFixed(this.Decimal);}else if(item.Type==DEAL_COLUMN_ID.VOL_ID){text=IFrameSplitOperator.FormatValueString(data.Vol,0);textColor=this.GetVolColor(item,data);}else if(item.Type==DEAL_COLUMN_ID.DEAL_ID){text=IFrameSplitOperator.FormatValueString(data.Deal,0);}else if(item.Type==DEAL_COLUMN_ID.BS_ID){if(data.BS==1){text="B";textColor=this.UpColor;}else if(data.BS==2){text="S";textColor=this.DownColor;}}else if(item.Type==DEAL_COLUMN_ID.UPDOWN_ID){if(IFrameSplitOperator.IsNumber(this.YClose)){var value=data.Price-this.YClose;text=value.toFixed(2);if(value>0)textColor=this.UpColor;else if(value<0)textColor=this.DownColor;else textColor=this.UnchagneColor;}}else if(item.Type==DEAL_COLUMN_ID.INDEX_ID){text=(dataIndex+1).toString();}else if(item.Type==DEAL_COLUMN_ID.MULTI_BAR_ID){var rtItem={Left:left,Top:top,Width:itemWidth,Height:this.RowHeight};this.DrawMultiBar(item,data,rtItem);}else if(item.Type==DEAL_COLUMN_ID.CENTER_BAR_ID){var rtItem={Left:left,Top:top,Width:itemWidth,Height:this.RowHeight};this.DrawCenterBar(item,data,rtItem);}else if(item.Type==DEAL_COLUMN_ID.CUSTOM_TEXT_ID){var out={Text:null,TextColor:null,TextAlign:null};//输出
|
|
11974
12033
|
var rtItem={Left:left,Top:top,Width:itemWidth,Height:this.RowHeight};if(this.DrawCustomText(item,data,rtItem,dataIndex,i,out)){if(out.Text)text=out.Text;if(out.TextColor)textColor=out.TextColor;if(out.TextAlign)textAlign=out.TextAlign;}}this.DrawItemText(text,textColor,textAlign,left,top,itemWidth);left+=item.Width;}};this.DrawItemText=function(text,textColor,textAlign,left,top,width){var x=left;if(textAlign=='center'){x=left+width/2;this.Canvas.textAlign="center";}else if(textAlign=='right'){x=left+width;this.Canvas.textAlign="right";}else{this.Canvas.textAlign="left";}this.Canvas.textBaseline="middle";this.Canvas.fillStyle=textColor;if(text)this.Canvas.fillText(text,x,top+this.RowHeight/2);};this.DrawMultiBar=function(colunmInfo,data,rtItem){if(!data.Source||!IFrameSplitOperator.IsNonEmptyArray(data.Source))return false;var barData=data.Source[colunmInfo.DataIndex];//{ Value:[0.4,0,2], Color:[0,1] };
|
|
11975
12034
|
if(!barData)return false;if(!IFrameSplitOperator.IsNonEmptyArray(barData.Value))return false;var width=rtItem.Width-this.BarMergin.Left-this.BarMergin.Right;var left=rtItem.Left+this.BarMergin.Left;var top=rtItem.Top+this.RowMergin.Top+this.BarMergin.Top;var height=rtItem.Height-this.RowMergin.Top-this.RowMergin.Bottom-this.BarMergin.Top-this.BarMergin.Bottom;var right=left+width;for(var i=0;i<barData.Value.length;++i){var value=barData.Value[i];if(value<=0)continue;if(left>=right)break;var barWidth=width*value;if(barWidth<1)barWidth=1;if(left+barWidth>right)barWidth=right-left;var colorIndex=i;if(IFrameSplitOperator.IsNonEmptyArray(barData.Color)&&i<barData.Color.length)colorIndex=barData.Color[i];this.Canvas.fillStyle=g_JSChartResource.DealList.FieldColor.Bar[colorIndex];this.Canvas.fillRect(left,top,barWidth,height);left+=barWidth;}return true;};this.DrawCenterBar=function(colunmInfo,data,rtItem){if(!data.Source||!IFrameSplitOperator.IsNonEmptyArray(data.Source))return false;var barData=data.Source[colunmInfo.DataIndex];//{ Value:[0.4,0,2], Color:[0,1] };
|
|
11976
12035
|
if(!barData)return false;if(!IFrameSplitOperator.IsNonEmptyArray(barData.Value))return false;var width=(rtItem.Width-this.BarMergin.Left-this.BarMergin.Right)/2;var left=rtItem.Left+this.BarMergin.Left;var center=left+width;var top=rtItem.Top+this.RowMergin.Top+this.BarMergin.Top;var height=rtItem.Height-this.RowMergin.Top-this.RowMergin.Bottom-this.BarMergin.Top-this.BarMergin.Bottom;var right=left+width;for(var i=0;i<barData.Value.length&&i<2;++i){var value=barData.Value[i];if(value<=0)continue;if(value>1)value=1;var barWidth=width*value;if(barWidth<1)barWidth=1;var colorIndex=i;if(IFrameSplitOperator.IsNonEmptyArray(barData.Color)&&i<barData.Color.length)colorIndex=barData.Color[i];this.Canvas.fillStyle=g_JSChartResource.DealList.FieldColor.Bar[colorIndex];if(i==0)//左边
|
|
@@ -12662,7 +12721,7 @@ function HQChartScriptWorker(){this.Create=function(){var _this60=this;addEventL
|
|
|
12662
12721
|
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);};}/********************************************************************************
|
|
12663
12722
|
* 版本信息输出
|
|
12664
12723
|
*
|
|
12665
|
-
*/var HQCHART_VERSION="1.1.
|
|
12724
|
+
*/var HQCHART_VERSION="1.1.12606";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();//把给外界调用的方法暴露出来
|
|
12666
12725
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
12667
12726
|
// BaseIndex:BaseIndex,
|
|
12668
12727
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
|
@@ -78,6 +78,8 @@ function JSDealChart(divElement)
|
|
|
78
78
|
if (option.NetworkFilter) chart.NetworkFilter=option.NetworkFilter;
|
|
79
79
|
if (IFrameSplitOperator.IsNonEmptyArray(option.Column)) chart.SetColumn(option.Column);
|
|
80
80
|
|
|
81
|
+
if (IFrameSplitOperator.IsNumber(option.ShowOrder)) chart.ChartPaint[0].ShowOrder=option.ShowOrder;
|
|
82
|
+
|
|
81
83
|
this.SetChartBorder(chart, option);
|
|
82
84
|
|
|
83
85
|
//是否自动更新
|
|
@@ -896,6 +898,7 @@ function ChartDealList()
|
|
|
896
898
|
this.Decimal=2; //小数位数
|
|
897
899
|
this.IsSingleTable=false; //单表模式
|
|
898
900
|
this.IsShowHeader=true; //是否显示表头
|
|
901
|
+
this.ShowOrder=1; //0=顺序 1=倒序
|
|
899
902
|
|
|
900
903
|
this.SizeChange=true;
|
|
901
904
|
|
|
@@ -1182,18 +1185,42 @@ function ChartDealList()
|
|
|
1182
1185
|
var left=this.RectClient.Left+this.HeaderMergin.Left;
|
|
1183
1186
|
var dataCount=this.Data.Data.length;
|
|
1184
1187
|
var index=this.Data.DataOffset;
|
|
1185
|
-
|
|
1188
|
+
|
|
1189
|
+
if (this.ShowOrder==1)
|
|
1186
1190
|
{
|
|
1187
|
-
var
|
|
1188
|
-
|
|
1189
|
-
var
|
|
1190
|
-
for(j=0;j<this.RowCount && index<dataCount;++j, ++index)
|
|
1191
|
+
var index=this.Data.DataOffset+(this.TableCount*this.RowCount);
|
|
1192
|
+
if (index>=dataCount) index=dataCount-1;
|
|
1193
|
+
for(var i=0,j=0;i<this.TableCount;++i)
|
|
1191
1194
|
{
|
|
1192
|
-
var
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
+
var tableLeft=left+(this.TableWidth*i);
|
|
1196
|
+
var textLeft=tableLeft;
|
|
1197
|
+
var textTop=top;
|
|
1195
1198
|
|
|
1196
|
-
|
|
1199
|
+
for(j=0;j<this.RowCount && index>=0;++j, --index)
|
|
1200
|
+
{
|
|
1201
|
+
var dataItem=this.Data.Data[index];
|
|
1202
|
+
|
|
1203
|
+
this.DrawRow(dataItem, textLeft, textTop, index);
|
|
1204
|
+
|
|
1205
|
+
textTop+=this.RowHeight;
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
else
|
|
1210
|
+
{
|
|
1211
|
+
for(var i=0,j=0;i<this.TableCount;++i)
|
|
1212
|
+
{
|
|
1213
|
+
var tableLeft=left+(this.TableWidth*i);
|
|
1214
|
+
var textLeft=tableLeft;
|
|
1215
|
+
var textTop=top;
|
|
1216
|
+
for(j=0;j<this.RowCount && index<dataCount;++j, ++index)
|
|
1217
|
+
{
|
|
1218
|
+
var dataItem=this.Data.Data[index];
|
|
1219
|
+
|
|
1220
|
+
this.DrawRow(dataItem, textLeft, textTop, index);
|
|
1221
|
+
|
|
1222
|
+
textTop+=this.RowHeight;
|
|
1223
|
+
}
|
|
1197
1224
|
}
|
|
1198
1225
|
}
|
|
1199
1226
|
}
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -42421,6 +42421,7 @@ IFrameSplitOperator.FormatValueThousandsString=function(value,floatPrecision)
|
|
|
42421
42421
|
//数据输出格式化 floatPrecision=小数位数
|
|
42422
42422
|
IFrameSplitOperator.FormatValueString=function(value, floatPrecision,languageID)
|
|
42423
42423
|
{
|
|
42424
|
+
/*
|
|
42424
42425
|
if (value==null || isNaN(value))
|
|
42425
42426
|
{
|
|
42426
42427
|
if (floatPrecision>0)
|
|
@@ -42477,6 +42478,71 @@ IFrameSplitOperator.FormatValueString=function(value, floatPrecision,languageID)
|
|
|
42477
42478
|
else
|
|
42478
42479
|
return (value/1000000000000).toFixed(floatPrecision)+"万亿";
|
|
42479
42480
|
}
|
|
42481
|
+
*/
|
|
42482
|
+
|
|
42483
|
+
|
|
42484
|
+
return IFrameSplitOperator.FormatValueStringV2(value, floatPrecision, floatPrecision, languageID);
|
|
42485
|
+
}
|
|
42486
|
+
|
|
42487
|
+
//数据输出格式化 floatPrecision=原始小数位数 floatPrecision2=转换成'万','亿'..的小数位
|
|
42488
|
+
IFrameSplitOperator.FormatValueStringV2=function(value, floatPrecision, floatPrecision2, languageID)
|
|
42489
|
+
{
|
|
42490
|
+
if (value==null || isNaN(value))
|
|
42491
|
+
{
|
|
42492
|
+
if (floatPrecision>0)
|
|
42493
|
+
{
|
|
42494
|
+
var nullText='-.';
|
|
42495
|
+
for(var i=0;i<floatPrecision;++i)
|
|
42496
|
+
nullText+='-';
|
|
42497
|
+
return nullText;
|
|
42498
|
+
}
|
|
42499
|
+
|
|
42500
|
+
return '--';
|
|
42501
|
+
}
|
|
42502
|
+
|
|
42503
|
+
if (value<0.00000000001 && value>-0.00000000001)
|
|
42504
|
+
{
|
|
42505
|
+
return "0";
|
|
42506
|
+
}
|
|
42507
|
+
|
|
42508
|
+
var absValue = Math.abs(value);
|
|
42509
|
+
if (languageID===JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID)
|
|
42510
|
+
{
|
|
42511
|
+
if (absValue < 10000)
|
|
42512
|
+
return value.toFixed(floatPrecision);
|
|
42513
|
+
else if (absValue < 1000000)
|
|
42514
|
+
return (value/1000).toFixed(floatPrecision2)+"K";
|
|
42515
|
+
else if (absValue < 1000000000)
|
|
42516
|
+
return (value/1000000).toFixed(floatPrecision2)+"M";
|
|
42517
|
+
else if (absValue < 1000000000000)
|
|
42518
|
+
return (value/1000000000).toFixed(floatPrecision2)+"B";
|
|
42519
|
+
else
|
|
42520
|
+
return (value/1000000000000).toFixed(floatPrecision2)+"T";
|
|
42521
|
+
}
|
|
42522
|
+
else if (languageID===JSCHART_LANGUAGE_ID.LANGUAGE_TRADITIONAL_CHINESE_ID) //繁体
|
|
42523
|
+
{
|
|
42524
|
+
if (absValue < 10000)
|
|
42525
|
+
return value.toFixed(floatPrecision);
|
|
42526
|
+
else if (absValue < 100000000)
|
|
42527
|
+
return (value/10000).toFixed(floatPrecision2)+"萬";
|
|
42528
|
+
else if (absValue < 1000000000000)
|
|
42529
|
+
return (value/100000000).toFixed(floatPrecision2)+"億";
|
|
42530
|
+
else
|
|
42531
|
+
return (value/1000000000000).toFixed(floatPrecision2)+"萬億";
|
|
42532
|
+
}
|
|
42533
|
+
else
|
|
42534
|
+
{
|
|
42535
|
+
if (absValue < 10000)
|
|
42536
|
+
return value.toFixed(floatPrecision);
|
|
42537
|
+
else if (absValue<1000000)
|
|
42538
|
+
return (value/10000).toFixed(floatPrecision2)+"万";
|
|
42539
|
+
else if (absValue < 100000000)
|
|
42540
|
+
return (value/10000).toFixed(floatPrecision2)+"万";
|
|
42541
|
+
else if (absValue < 1000000000000)
|
|
42542
|
+
return (value/100000000).toFixed(floatPrecision2)+"亿";
|
|
42543
|
+
else
|
|
42544
|
+
return (value/1000000000000).toFixed(floatPrecision2)+"万亿";
|
|
42545
|
+
}
|
|
42480
42546
|
|
|
42481
42547
|
return '';
|
|
42482
42548
|
}
|
|
@@ -46501,6 +46501,7 @@ IFrameSplitOperator.FormatValueThousandsString=function(value,floatPrecision)
|
|
|
46501
46501
|
//数据输出格式化 floatPrecision=小数位数
|
|
46502
46502
|
IFrameSplitOperator.FormatValueString=function(value, floatPrecision,languageID)
|
|
46503
46503
|
{
|
|
46504
|
+
/*
|
|
46504
46505
|
if (value==null || isNaN(value))
|
|
46505
46506
|
{
|
|
46506
46507
|
if (floatPrecision>0)
|
|
@@ -46557,6 +46558,71 @@ IFrameSplitOperator.FormatValueString=function(value, floatPrecision,languageID)
|
|
|
46557
46558
|
else
|
|
46558
46559
|
return (value/1000000000000).toFixed(floatPrecision)+"万亿";
|
|
46559
46560
|
}
|
|
46561
|
+
*/
|
|
46562
|
+
|
|
46563
|
+
|
|
46564
|
+
return IFrameSplitOperator.FormatValueStringV2(value, floatPrecision, floatPrecision, languageID);
|
|
46565
|
+
}
|
|
46566
|
+
|
|
46567
|
+
//数据输出格式化 floatPrecision=原始小数位数 floatPrecision2=转换成'万','亿'..的小数位
|
|
46568
|
+
IFrameSplitOperator.FormatValueStringV2=function(value, floatPrecision, floatPrecision2, languageID)
|
|
46569
|
+
{
|
|
46570
|
+
if (value==null || isNaN(value))
|
|
46571
|
+
{
|
|
46572
|
+
if (floatPrecision>0)
|
|
46573
|
+
{
|
|
46574
|
+
var nullText='-.';
|
|
46575
|
+
for(var i=0;i<floatPrecision;++i)
|
|
46576
|
+
nullText+='-';
|
|
46577
|
+
return nullText;
|
|
46578
|
+
}
|
|
46579
|
+
|
|
46580
|
+
return '--';
|
|
46581
|
+
}
|
|
46582
|
+
|
|
46583
|
+
if (value<0.00000000001 && value>-0.00000000001)
|
|
46584
|
+
{
|
|
46585
|
+
return "0";
|
|
46586
|
+
}
|
|
46587
|
+
|
|
46588
|
+
var absValue = Math.abs(value);
|
|
46589
|
+
if (languageID===JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID)
|
|
46590
|
+
{
|
|
46591
|
+
if (absValue < 10000)
|
|
46592
|
+
return value.toFixed(floatPrecision);
|
|
46593
|
+
else if (absValue < 1000000)
|
|
46594
|
+
return (value/1000).toFixed(floatPrecision2)+"K";
|
|
46595
|
+
else if (absValue < 1000000000)
|
|
46596
|
+
return (value/1000000).toFixed(floatPrecision2)+"M";
|
|
46597
|
+
else if (absValue < 1000000000000)
|
|
46598
|
+
return (value/1000000000).toFixed(floatPrecision2)+"B";
|
|
46599
|
+
else
|
|
46600
|
+
return (value/1000000000000).toFixed(floatPrecision2)+"T";
|
|
46601
|
+
}
|
|
46602
|
+
else if (languageID===JSCHART_LANGUAGE_ID.LANGUAGE_TRADITIONAL_CHINESE_ID) //繁体
|
|
46603
|
+
{
|
|
46604
|
+
if (absValue < 10000)
|
|
46605
|
+
return value.toFixed(floatPrecision);
|
|
46606
|
+
else if (absValue < 100000000)
|
|
46607
|
+
return (value/10000).toFixed(floatPrecision2)+"萬";
|
|
46608
|
+
else if (absValue < 1000000000000)
|
|
46609
|
+
return (value/100000000).toFixed(floatPrecision2)+"億";
|
|
46610
|
+
else
|
|
46611
|
+
return (value/1000000000000).toFixed(floatPrecision2)+"萬億";
|
|
46612
|
+
}
|
|
46613
|
+
else
|
|
46614
|
+
{
|
|
46615
|
+
if (absValue < 10000)
|
|
46616
|
+
return value.toFixed(floatPrecision);
|
|
46617
|
+
else if (absValue<1000000)
|
|
46618
|
+
return (value/10000).toFixed(floatPrecision2)+"万";
|
|
46619
|
+
else if (absValue < 100000000)
|
|
46620
|
+
return (value/10000).toFixed(floatPrecision2)+"万";
|
|
46621
|
+
else if (absValue < 1000000000000)
|
|
46622
|
+
return (value/100000000).toFixed(floatPrecision2)+"亿";
|
|
46623
|
+
else
|
|
46624
|
+
return (value/1000000000000).toFixed(floatPrecision2)+"万亿";
|
|
46625
|
+
}
|
|
46560
46626
|
|
|
46561
46627
|
return '';
|
|
46562
46628
|
}
|
|
@@ -119401,6 +119467,8 @@ function JSDealChart(divElement)
|
|
|
119401
119467
|
if (option.NetworkFilter) chart.NetworkFilter=option.NetworkFilter;
|
|
119402
119468
|
if (IFrameSplitOperator.IsNonEmptyArray(option.Column)) chart.SetColumn(option.Column);
|
|
119403
119469
|
|
|
119470
|
+
if (IFrameSplitOperator.IsNumber(option.ShowOrder)) chart.ChartPaint[0].ShowOrder=option.ShowOrder;
|
|
119471
|
+
|
|
119404
119472
|
this.SetChartBorder(chart, option);
|
|
119405
119473
|
|
|
119406
119474
|
//是否自动更新
|
|
@@ -120219,6 +120287,7 @@ function ChartDealList()
|
|
|
120219
120287
|
this.Decimal=2; //小数位数
|
|
120220
120288
|
this.IsSingleTable=false; //单表模式
|
|
120221
120289
|
this.IsShowHeader=true; //是否显示表头
|
|
120290
|
+
this.ShowOrder=1; //0=顺序 1=倒序
|
|
120222
120291
|
|
|
120223
120292
|
this.SizeChange=true;
|
|
120224
120293
|
|
|
@@ -120505,18 +120574,42 @@ function ChartDealList()
|
|
|
120505
120574
|
var left=this.RectClient.Left+this.HeaderMergin.Left;
|
|
120506
120575
|
var dataCount=this.Data.Data.length;
|
|
120507
120576
|
var index=this.Data.DataOffset;
|
|
120508
|
-
|
|
120577
|
+
|
|
120578
|
+
if (this.ShowOrder==1)
|
|
120509
120579
|
{
|
|
120510
|
-
var
|
|
120511
|
-
|
|
120512
|
-
var
|
|
120513
|
-
for(j=0;j<this.RowCount && index<dataCount;++j, ++index)
|
|
120580
|
+
var index=this.Data.DataOffset+(this.TableCount*this.RowCount);
|
|
120581
|
+
if (index>=dataCount) index=dataCount-1;
|
|
120582
|
+
for(var i=0,j=0;i<this.TableCount;++i)
|
|
120514
120583
|
{
|
|
120515
|
-
var
|
|
120584
|
+
var tableLeft=left+(this.TableWidth*i);
|
|
120585
|
+
var textLeft=tableLeft;
|
|
120586
|
+
var textTop=top;
|
|
120516
120587
|
|
|
120517
|
-
this.
|
|
120518
|
-
|
|
120519
|
-
|
|
120588
|
+
for(j=0;j<this.RowCount && index>=0;++j, --index)
|
|
120589
|
+
{
|
|
120590
|
+
var dataItem=this.Data.Data[index];
|
|
120591
|
+
|
|
120592
|
+
this.DrawRow(dataItem, textLeft, textTop, index);
|
|
120593
|
+
|
|
120594
|
+
textTop+=this.RowHeight;
|
|
120595
|
+
}
|
|
120596
|
+
}
|
|
120597
|
+
}
|
|
120598
|
+
else
|
|
120599
|
+
{
|
|
120600
|
+
for(var i=0,j=0;i<this.TableCount;++i)
|
|
120601
|
+
{
|
|
120602
|
+
var tableLeft=left+(this.TableWidth*i);
|
|
120603
|
+
var textLeft=tableLeft;
|
|
120604
|
+
var textTop=top;
|
|
120605
|
+
for(j=0;j<this.RowCount && index<dataCount;++j, ++index)
|
|
120606
|
+
{
|
|
120607
|
+
var dataItem=this.Data.Data[index];
|
|
120608
|
+
|
|
120609
|
+
this.DrawRow(dataItem, textLeft, textTop, index);
|
|
120610
|
+
|
|
120611
|
+
textTop+=this.RowHeight;
|
|
120612
|
+
}
|
|
120520
120613
|
}
|
|
120521
120614
|
}
|
|
120522
120615
|
}
|
|
@@ -129560,7 +129653,7 @@ function ScrollBarBGChart()
|
|
|
129560
129653
|
|
|
129561
129654
|
|
|
129562
129655
|
|
|
129563
|
-
var HQCHART_VERSION="1.1.
|
|
129656
|
+
var HQCHART_VERSION="1.1.12606";
|
|
129564
129657
|
|
|
129565
129658
|
function PrintHQChartVersion()
|
|
129566
129659
|
{
|
|
@@ -46545,6 +46545,7 @@ IFrameSplitOperator.FormatValueThousandsString=function(value,floatPrecision)
|
|
|
46545
46545
|
//数据输出格式化 floatPrecision=小数位数
|
|
46546
46546
|
IFrameSplitOperator.FormatValueString=function(value, floatPrecision,languageID)
|
|
46547
46547
|
{
|
|
46548
|
+
/*
|
|
46548
46549
|
if (value==null || isNaN(value))
|
|
46549
46550
|
{
|
|
46550
46551
|
if (floatPrecision>0)
|
|
@@ -46601,6 +46602,71 @@ IFrameSplitOperator.FormatValueString=function(value, floatPrecision,languageID)
|
|
|
46601
46602
|
else
|
|
46602
46603
|
return (value/1000000000000).toFixed(floatPrecision)+"万亿";
|
|
46603
46604
|
}
|
|
46605
|
+
*/
|
|
46606
|
+
|
|
46607
|
+
|
|
46608
|
+
return IFrameSplitOperator.FormatValueStringV2(value, floatPrecision, floatPrecision, languageID);
|
|
46609
|
+
}
|
|
46610
|
+
|
|
46611
|
+
//数据输出格式化 floatPrecision=原始小数位数 floatPrecision2=转换成'万','亿'..的小数位
|
|
46612
|
+
IFrameSplitOperator.FormatValueStringV2=function(value, floatPrecision, floatPrecision2, languageID)
|
|
46613
|
+
{
|
|
46614
|
+
if (value==null || isNaN(value))
|
|
46615
|
+
{
|
|
46616
|
+
if (floatPrecision>0)
|
|
46617
|
+
{
|
|
46618
|
+
var nullText='-.';
|
|
46619
|
+
for(var i=0;i<floatPrecision;++i)
|
|
46620
|
+
nullText+='-';
|
|
46621
|
+
return nullText;
|
|
46622
|
+
}
|
|
46623
|
+
|
|
46624
|
+
return '--';
|
|
46625
|
+
}
|
|
46626
|
+
|
|
46627
|
+
if (value<0.00000000001 && value>-0.00000000001)
|
|
46628
|
+
{
|
|
46629
|
+
return "0";
|
|
46630
|
+
}
|
|
46631
|
+
|
|
46632
|
+
var absValue = Math.abs(value);
|
|
46633
|
+
if (languageID===JSCHART_LANGUAGE_ID.LANGUAGE_ENGLISH_ID)
|
|
46634
|
+
{
|
|
46635
|
+
if (absValue < 10000)
|
|
46636
|
+
return value.toFixed(floatPrecision);
|
|
46637
|
+
else if (absValue < 1000000)
|
|
46638
|
+
return (value/1000).toFixed(floatPrecision2)+"K";
|
|
46639
|
+
else if (absValue < 1000000000)
|
|
46640
|
+
return (value/1000000).toFixed(floatPrecision2)+"M";
|
|
46641
|
+
else if (absValue < 1000000000000)
|
|
46642
|
+
return (value/1000000000).toFixed(floatPrecision2)+"B";
|
|
46643
|
+
else
|
|
46644
|
+
return (value/1000000000000).toFixed(floatPrecision2)+"T";
|
|
46645
|
+
}
|
|
46646
|
+
else if (languageID===JSCHART_LANGUAGE_ID.LANGUAGE_TRADITIONAL_CHINESE_ID) //繁体
|
|
46647
|
+
{
|
|
46648
|
+
if (absValue < 10000)
|
|
46649
|
+
return value.toFixed(floatPrecision);
|
|
46650
|
+
else if (absValue < 100000000)
|
|
46651
|
+
return (value/10000).toFixed(floatPrecision2)+"萬";
|
|
46652
|
+
else if (absValue < 1000000000000)
|
|
46653
|
+
return (value/100000000).toFixed(floatPrecision2)+"億";
|
|
46654
|
+
else
|
|
46655
|
+
return (value/1000000000000).toFixed(floatPrecision2)+"萬億";
|
|
46656
|
+
}
|
|
46657
|
+
else
|
|
46658
|
+
{
|
|
46659
|
+
if (absValue < 10000)
|
|
46660
|
+
return value.toFixed(floatPrecision);
|
|
46661
|
+
else if (absValue<1000000)
|
|
46662
|
+
return (value/10000).toFixed(floatPrecision2)+"万";
|
|
46663
|
+
else if (absValue < 100000000)
|
|
46664
|
+
return (value/10000).toFixed(floatPrecision2)+"万";
|
|
46665
|
+
else if (absValue < 1000000000000)
|
|
46666
|
+
return (value/100000000).toFixed(floatPrecision2)+"亿";
|
|
46667
|
+
else
|
|
46668
|
+
return (value/1000000000000).toFixed(floatPrecision2)+"万亿";
|
|
46669
|
+
}
|
|
46604
46670
|
|
|
46605
46671
|
return '';
|
|
46606
46672
|
}
|
|
@@ -119445,6 +119511,8 @@ function JSDealChart(divElement)
|
|
|
119445
119511
|
if (option.NetworkFilter) chart.NetworkFilter=option.NetworkFilter;
|
|
119446
119512
|
if (IFrameSplitOperator.IsNonEmptyArray(option.Column)) chart.SetColumn(option.Column);
|
|
119447
119513
|
|
|
119514
|
+
if (IFrameSplitOperator.IsNumber(option.ShowOrder)) chart.ChartPaint[0].ShowOrder=option.ShowOrder;
|
|
119515
|
+
|
|
119448
119516
|
this.SetChartBorder(chart, option);
|
|
119449
119517
|
|
|
119450
119518
|
//是否自动更新
|
|
@@ -120263,6 +120331,7 @@ function ChartDealList()
|
|
|
120263
120331
|
this.Decimal=2; //小数位数
|
|
120264
120332
|
this.IsSingleTable=false; //单表模式
|
|
120265
120333
|
this.IsShowHeader=true; //是否显示表头
|
|
120334
|
+
this.ShowOrder=1; //0=顺序 1=倒序
|
|
120266
120335
|
|
|
120267
120336
|
this.SizeChange=true;
|
|
120268
120337
|
|
|
@@ -120549,18 +120618,42 @@ function ChartDealList()
|
|
|
120549
120618
|
var left=this.RectClient.Left+this.HeaderMergin.Left;
|
|
120550
120619
|
var dataCount=this.Data.Data.length;
|
|
120551
120620
|
var index=this.Data.DataOffset;
|
|
120552
|
-
|
|
120621
|
+
|
|
120622
|
+
if (this.ShowOrder==1)
|
|
120553
120623
|
{
|
|
120554
|
-
var
|
|
120555
|
-
|
|
120556
|
-
var
|
|
120557
|
-
for(j=0;j<this.RowCount && index<dataCount;++j, ++index)
|
|
120624
|
+
var index=this.Data.DataOffset+(this.TableCount*this.RowCount);
|
|
120625
|
+
if (index>=dataCount) index=dataCount-1;
|
|
120626
|
+
for(var i=0,j=0;i<this.TableCount;++i)
|
|
120558
120627
|
{
|
|
120559
|
-
var
|
|
120628
|
+
var tableLeft=left+(this.TableWidth*i);
|
|
120629
|
+
var textLeft=tableLeft;
|
|
120630
|
+
var textTop=top;
|
|
120560
120631
|
|
|
120561
|
-
this.
|
|
120562
|
-
|
|
120563
|
-
|
|
120632
|
+
for(j=0;j<this.RowCount && index>=0;++j, --index)
|
|
120633
|
+
{
|
|
120634
|
+
var dataItem=this.Data.Data[index];
|
|
120635
|
+
|
|
120636
|
+
this.DrawRow(dataItem, textLeft, textTop, index);
|
|
120637
|
+
|
|
120638
|
+
textTop+=this.RowHeight;
|
|
120639
|
+
}
|
|
120640
|
+
}
|
|
120641
|
+
}
|
|
120642
|
+
else
|
|
120643
|
+
{
|
|
120644
|
+
for(var i=0,j=0;i<this.TableCount;++i)
|
|
120645
|
+
{
|
|
120646
|
+
var tableLeft=left+(this.TableWidth*i);
|
|
120647
|
+
var textLeft=tableLeft;
|
|
120648
|
+
var textTop=top;
|
|
120649
|
+
for(j=0;j<this.RowCount && index<dataCount;++j, ++index)
|
|
120650
|
+
{
|
|
120651
|
+
var dataItem=this.Data.Data[index];
|
|
120652
|
+
|
|
120653
|
+
this.DrawRow(dataItem, textLeft, textTop, index);
|
|
120654
|
+
|
|
120655
|
+
textTop+=this.RowHeight;
|
|
120656
|
+
}
|
|
120564
120657
|
}
|
|
120565
120658
|
}
|
|
120566
120659
|
}
|
|
@@ -129713,7 +129806,7 @@ function HQChartScriptWorker()
|
|
|
129713
129806
|
|
|
129714
129807
|
|
|
129715
129808
|
|
|
129716
|
-
var HQCHART_VERSION="1.1.
|
|
129809
|
+
var HQCHART_VERSION="1.1.12606";
|
|
129717
129810
|
|
|
129718
129811
|
function PrintHQChartVersion()
|
|
129719
129812
|
{
|
|
@@ -440,6 +440,24 @@ IFrameSplitOperator.FormatValueColor = function (value, value2)
|
|
|
440
440
|
else return 'PriceDown';
|
|
441
441
|
}
|
|
442
442
|
|
|
443
|
+
//成交量显示
|
|
444
|
+
IFrameSplitOperator.FormatVolString=function(value,languageID)
|
|
445
|
+
{
|
|
446
|
+
var absValue = Math.abs(value);
|
|
447
|
+
if (absValue<100000)
|
|
448
|
+
return value.toFixed(0);
|
|
449
|
+
else if (absValue<10000000)
|
|
450
|
+
return (value/10000).toFixed(1)+"万";
|
|
451
|
+
else if (absValue<100000000)
|
|
452
|
+
return (value/10000).toFixed(0)+"万";
|
|
453
|
+
else if (absValue<1000000000)
|
|
454
|
+
return (value/100000000).toFixed(2)+"亿";
|
|
455
|
+
else if (absValue < 1000000000000)
|
|
456
|
+
return (value/100000000).toFixed(1)+"亿";
|
|
457
|
+
else
|
|
458
|
+
return (value/1000000000000).toFixed(1)+"万亿";
|
|
459
|
+
}
|
|
460
|
+
|
|
443
461
|
IFrameSplitOperator.IsNumber=function(value)
|
|
444
462
|
{
|
|
445
463
|
if (value==null) return false;
|