hqchart 1.1.14432 → 1.1.14439
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 +14 -14
- package/package.json +1 -1
- package/src/jscommon/umychart.js +7 -14
- package/src/jscommon/umychart.report.js +56 -5
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +64 -20
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +64 -20
package/lib/umychart.vue.js
CHANGED
|
@@ -1132,8 +1132,7 @@ TBP:REF(REF(C,1)+IF(DIRECT0>50,MIN(MF0,MF1),MAX(MF0,MF1)),1);\n\
|
|
|
1132
1132
|
*///日志输出类
|
|
1133
1133
|
if(!JSConsole){var JSConsole={Chart:{Log:console.log,Warn:console.warn},//图形日志
|
|
1134
1134
|
Complier:{Log:console.log,Warn:console.warn//编译器日志
|
|
1135
|
-
}};}function JSChart(divElement,bOffscreen,bCacheCanvas){this.DivElement=divElement;this.
|
|
1136
|
-
this.JSChartContainer;//画图控件
|
|
1135
|
+
}};}function JSChart(divElement,bOffscreen,bCacheCanvas){this.DivElement=divElement;this.JSChartContainer;//画图控件
|
|
1137
1136
|
this.ResizeListener;//h5 canvas
|
|
1138
1137
|
this.CanvasElement=document.createElement("canvas");this.CanvasElement.className='jschart-drawing';this.CanvasElement.id=Guid();this.CanvasElement.setAttribute("tabindex",0);if(this.CanvasElement.style){this.CanvasElement.style.outline='none';//this.CanvasElement.style.position="absolute"; //外部自己设置
|
|
1139
1138
|
}if(divElement.hasChildNodes()){JSConsole.Chart.Log("[JSChart::JSChart] divElement hasChildNodes",divElement.childNodes);}divElement.appendChild(this.CanvasElement);//离屏
|
|
@@ -1144,10 +1143,9 @@ this.CreateExtraCanvasElement=function(name,option){if(this.MapExtraCanvasElemen
|
|
|
1144
1143
|
{ Type: 1=K线柱子宽度不变 2=K线全部显示
|
|
1145
1144
|
Redraw:是否重绘, XYSplit:是否重新计算分割线 }
|
|
1146
1145
|
*/this.OnSize=function(option){//画布大小通过div获取 如果有style里的大小 使用style里的
|
|
1147
|
-
var height=this.DivElement.offsetHeight;var width=this.DivElement.offsetWidth;
|
|
1148
|
-
height
|
|
1149
|
-
|
|
1150
|
-
this.CanvasElement.height*=pixelTatio;this.CanvasElement.width*=pixelTatio;if(this.OffscreenCanvasElement){this.OffscreenCanvasElement.height=this.CanvasElement.height;this.OffscreenCanvasElement.width=this.CanvasElement.width;}if(this.CacheCanvasElement){this.CacheCanvasElement.height=this.CanvasElement.height;this.CacheCanvasElement.width=this.CanvasElement.width;}var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=(0,_getIterator3.default)(this.MapExtraCanvasElement),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var mapItem=_step.value;var item=mapItem[1];var element=item.Element;if(!element)continue;element.height=this.CanvasElement.height;element.width=this.CanvasElement.width;element.style.width=this.CanvasElement.style.width;element.style.height=this.CanvasElement.style.height;}}catch(err){_didIteratorError=true;_iteratorError=err;}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return();}}finally{if(_didIteratorError){throw _iteratorError;}}}JSConsole.Chart.Log('[JSChart::OnSize] devicePixelRatio='+window.devicePixelRatio+', height='+this.CanvasElement.height+', width='+this.CanvasElement.width);if(option&&option.Redraw==false)return;if(this.JSChartContainer){if(option&&option.XYSplit===true)this.JSChartContainer.ResetFrameXYSplit();if(this.JSChartContainer.OnSize&&option&&option.Type==1)//K线宽度不变
|
|
1146
|
+
var height=this.DivElement.offsetHeight;var width=this.DivElement.offsetWidth;var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率s
|
|
1147
|
+
if(this.DivElement.style.height&&this.DivElement.style.width){if(this.DivElement.style.height.includes("px"))height=parseInt(this.DivElement.style.height.replace("px",""));if(this.DivElement.style.width.includes("px"))width=parseInt(this.DivElement.style.width.replace("px",""));}this.CanvasElement.style.width=width+'px';this.CanvasElement.style.height=height+'px';this.CanvasElement.height=parseInt(pixelTatio*height);//根据分辨率缩放
|
|
1148
|
+
this.CanvasElement.width=parseInt(pixelTatio*width);if(this.OffscreenCanvasElement){this.OffscreenCanvasElement.height=this.CanvasElement.height;this.OffscreenCanvasElement.width=this.CanvasElement.width;}if(this.CacheCanvasElement){this.CacheCanvasElement.height=this.CanvasElement.height;this.CacheCanvasElement.width=this.CanvasElement.width;}var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=(0,_getIterator3.default)(this.MapExtraCanvasElement),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var mapItem=_step.value;var item=mapItem[1];var element=item.Element;if(!element)continue;element.height=this.CanvasElement.height;element.width=this.CanvasElement.width;element.style.width=this.CanvasElement.style.width;element.style.height=this.CanvasElement.style.height;}}catch(err){_didIteratorError=true;_iteratorError=err;}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return();}}finally{if(_didIteratorError){throw _iteratorError;}}}JSConsole.Chart.Log('[JSChart::OnSize] devicePixelRatio='+window.devicePixelRatio+', height='+this.CanvasElement.height+', width='+this.CanvasElement.width);if(option&&option.Redraw==false)return;if(this.JSChartContainer){if(option&&option.XYSplit===true)this.JSChartContainer.ResetFrameXYSplit();if(this.JSChartContainer.OnSize&&option&&option.Type==1)//K线宽度不变
|
|
1151
1149
|
{this.JSChartContainer.OnSize();}else if(this.JSChartContainer.ShowAllKLine&&option&&option.Type==2){this.JSChartContainer.ShowAllKLine();}else{if(this.JSChartContainer.Frame)this.JSChartContainer.Frame.SetSizeChage(true);this.JSChartContainer.Draw();}}};//手机屏需要调整 间距
|
|
1152
1150
|
this.AdjustChartBorder=function(chart){var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
|
|
1153
1151
|
chart.Frame.ChartBorder.Left*=pixelTatio;chart.Frame.ChartBorder.Right*=pixelTatio;chart.Frame.ChartBorder.Top*=pixelTatio;chart.Frame.ChartBorder.Bottom*=pixelTatio;if(chart.Frame.AutoLeftBorder){var item=chart.Frame.AutoLeftBorder;if(IFrameSplitOperator.IsNumber(item.MinWidth))item.MinWidth*=pixelTatio;if(IFrameSplitOperator.IsNumber(item.Blank))item.Blank*=pixelTatio;}if(chart.Frame.AutoRightBorder){var item=chart.Frame.AutoRightBorder;if(IFrameSplitOperator.IsNumber(item.MinWidth))item.MinWidth*=pixelTatio;if(IFrameSplitOperator.IsNumber(item.Blank))item.Blank*=pixelTatio;}};this.AdjustTitleHeight=function(chart){var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
|
|
@@ -7766,7 +7764,7 @@ chart.SetOption(option);this.ExtendChartPaint.push(chart);this.Frame.ChartBorder
|
|
|
7766
7764
|
this.GlobalOption.RightHorizontal.Show=false;return chart;};this.CreateExtendChart=function(name,option)//创建扩展图形
|
|
7767
7765
|
{var chart;switch(name){case'筹码分布':case"StockChip":chart=new StockChip();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.Left=this.Frame.ChartBorder.Right;//左边间距使用当前框架间距
|
|
7768
7766
|
chart.SetOption(option);this.ExtendChartPaint.push(chart);this.Frame.ChartBorder.Right+=chart.Width;//创建筹码需要增加右边的间距
|
|
7769
|
-
return chart;case"StockChipPhone":return this.CreateStockChipPhone(option);case'KLineTooltip':if(option.Create&&typeof option.Create=='function')chart=option.Create();else chart=new KLineTooltipPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;option.LanguageID=this.LanguageID;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"深度图":chart=new DepthMapPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"K线Y轴背景图":chart=new KLineYAxisBGPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case'背景图':chart=new BackgroundPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"FrameSplitPaint"://框架分割
|
|
7767
|
+
return chart;case"StockChipPhone":return this.CreateStockChipPhone(option);case'KLineTooltip':if(option.Create&&typeof option.Create=='function')chart=option.Create();else chart=new KLineTooltipPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;option.LanguageID=this.LanguageID;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"深度图":chart=new DepthMapPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"K线Y轴背景图":chart=new KLineYAxisBGPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"BackgroundPaint":case'背景图':chart=new BackgroundPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"FrameSplitPaint"://框架分割
|
|
7770
7768
|
chart=new FrameSplitPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;default:chart=g_ExtendChartPaintFactory.Create(name);if(!chart)return null;chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;}};this.OnTouchFinished=function(){if(this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID){if(this.TouchStatus.CorssCursorShow==true&&this.TouchDrawCount>0)return;this.TouchStatus.CorssCursorShow=false;this.DrawDynamicInfo();return;}if(this.EnableClickModel===true){if(this.ClickModel.IsShowCorssCursor==true&&this.TouchDrawCount>0)return;this.ClickModel.IsShowCorssCursor=false;this.DrawDynamicInfo();return;}if(this.CorssCursorTouchEnd===true)//手势离开十字光标消失
|
|
7771
7769
|
{if(this.TouchDrawCount>0)this.DrawDynamicInfo();return;}for(var i in this.ExtendChartPaint){var item=this.ExtendChartPaint[i];if(item.ClassName==='KLineTooltipPaint'){this.DrawDynamicInfo();}}};//锁|解锁指标 { Index:指标名字,IsLocked:是否要锁上,Callback:回调 }
|
|
7772
7770
|
this.LockIndex=function(lockData){if(!lockData)return;if(!lockData.IndexName)return;for(var _i12 in this.WindowIndex){var _item4=this.WindowIndex[_i12];if(!_item4)conintue;if(_item4.Name==lockData.IndexName){_item4.SetLock(lockData);this.Update();break;}}};this.TryClickLock=function(x,y){for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i];if(!item.Frame.IsLocked)continue;if(!item.Frame.LockPaint)continue;var tooltip=new TooltipData();if(!item.Frame.LockPaint.GetTooltipData(x,y,tooltip))continue;tooltip.HQChart=this;if(tooltip.Data.Callback)tooltip.Data.Callback(tooltip);return true;}return false;};this.TryClickIndexTitle=function(x,y){for(var i in this.TitlePaint){var item=this.TitlePaint[i];if(!item.IsClickTitle)continue;if(!item.IsClickTitle(x,y))continue;var data={Point:{X:x,Y:y},Title:item.Title,FrameID:item.Frame.Identify};JSConsole.Chart.Log('[KLineChartContainer::TryClickIndexTitle] click title ',data);var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEXTITLE);if(event&&event.Callback)event.Callback(event,data,this);return true;}return false;};this.SetSizeChange=function(bChanged){this.Frame.SetSizeChage(bChanged);for(var i in this.ExtendChartPaint){var item=this.ExtendChartPaint[i];item.SizeChange=bChanged;}};this.SetSizeChage=this.SetSizeChange;//单词拼错了, 还没替换完
|
|
@@ -8605,7 +8603,7 @@ this.CreateWindowIndex=function(windowIndex){this.WindowIndex[windowIndex].Creat
|
|
|
8605
8603
|
}
|
|
8606
8604
|
}
|
|
8607
8605
|
*/};this.CreateExtendChart=function(name,option)//创建扩展图形
|
|
8608
|
-
{var chart;switch(name){case'MinuteTooltip':if(option.Create&&typeof option.Create=='function')chart=option.Create();else chart=new MinuteTooltipPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;option.LanguageID=this.LanguageID;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"MinutePCTooltip":if(option.Create&&typeof option.Create=="function")chart=option.Create();else chart=new MinuteLeftTooltipPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;option.LanguageID=this.LanguageID;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"MinuteBackgroundPaint":chart=new MinuteBackgroundPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;option.LanguageID=this.LanguageID;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"背景图":chart=new BackgroundPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;default:chart=g_ExtendChartPaintFactory.Create(name);if(!chart)return null;chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;}};this.SetMinuteInfo=function(aryInfo,bUpdate){this.ChartInfo=[];//先清空
|
|
8606
|
+
{var chart;switch(name){case'MinuteTooltip':if(option.Create&&typeof option.Create=='function')chart=option.Create();else chart=new MinuteTooltipPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;option.LanguageID=this.LanguageID;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"MinutePCTooltip":if(option.Create&&typeof option.Create=="function")chart=option.Create();else chart=new MinuteLeftTooltipPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;option.LanguageID=this.LanguageID;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"MinuteBackgroundPaint":chart=new MinuteBackgroundPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;option.LanguageID=this.LanguageID;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;case"BackgroundPaint":case"背景图":chart=new BackgroundPaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;default:chart=g_ExtendChartPaintFactory.Create(name);if(!chart)return null;chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);return chart;}};this.SetMinuteInfo=function(aryInfo,bUpdate){this.ChartInfo=[];//先清空
|
|
8609
8607
|
for(var i in aryInfo){var infoItem=JSMinuteInfoMap.Get(aryInfo[i]);if(!infoItem)continue;var item=infoItem.Create();this.ChartInfo.push(item);}if(bUpdate==true)this.RequestMinuteInfoData();};this.GetChartMinuteInfo=function(){return this.ChartInfoPaint;};this.CreateMinuteInfo=function(option)//在Create()以后 在调用
|
|
8610
8608
|
{var chart=new ChartMinuteInfo();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.SubFrame[0].Frame.ChartBorder;chart.ChartFrame=this.Frame.SubFrame[0].Frame;chart.HQChartBorder=this.Frame.ChartBorder;chart.ChartMinutePrice=this.ChartPaint[0];if(option&&chart.SetOption)chart.SetOption(option);this.ChartInfoPaint=chart;return chart;};//信息地雷数据请求
|
|
8611
8609
|
this.RequestMinuteInfoData=function(){if(this.ChartInfo.length<=0)return;var chart=this.GetChartMinuteInfo();if(!chart)chart=this.CreateMinuteInfo(null);//不存在就创建
|
|
@@ -12718,8 +12716,8 @@ this.AddEventCallback=function(object){if(!object||!object.event||!object.callba
|
|
|
12718
12716
|
this.HideMinuteChartTooltip();this.HideFloatTooltip();switch(keyID){case 33://page up
|
|
12719
12717
|
if(this.GotoPreviousPage(this.PageUpDownCycle)){this.Draw();this.DelayUpdateStockData();}break;case 34://page down
|
|
12720
12718
|
if(this.GotoNextPage(this.PageUpDownCycle)){this.Draw();this.DelayUpdateStockData();}break;case 38://up
|
|
12721
|
-
var result=this.MoveSelectedRow(-1);if(result){if(result.Redraw)this.Draw();if(result.Update)this.DelayUpdateStockData();}break;case 40://down
|
|
12722
|
-
var result=this.MoveSelectedRow(1);if(result){if(result.Redraw)this.Draw();if(result.Update)this.DelayUpdateStockData();}break;case 37://left
|
|
12719
|
+
var result=this.MoveSelectedRow(-1,{EnablePageCycle:this.PageUpDownCycle});if(result){if(result.Redraw)this.Draw();if(result.Update)this.DelayUpdateStockData();this.MoveSelectedRowEvent(result.OldIndex,result.NewIndex);}break;case 40://down
|
|
12720
|
+
var result=this.MoveSelectedRow(1,{EnablePageCycle:this.PageUpDownCycle});if(result){if(result.Redraw)this.Draw();if(result.Update)this.DelayUpdateStockData();this.MoveSelectedRowEvent(result.OldIndex,result.NewIndex);}break;case 37://left
|
|
12723
12721
|
if(this.MoveXOffset(-1))this.Draw();break;case 39://right
|
|
12724
12722
|
if(this.MoveXOffset(1))this.Draw();break;}//不让滚动条滚动
|
|
12725
12723
|
if(e.preventDefault)e.preventDefault();else e.returnValue=false;};this.UIOnDblClick=function(e){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var chart=this.ChartPaint[0];if(chart)chart.OnDblClick(x,y,e);};this.UIOnMouseDown=function(e){var _this58=this;this.DragXScroll=null;this.DragYScroll=null;this.DragHeader=null;this.DragColumnWidth=null;this.DragMove={Click:{X:e.clientX,Y:e.clientY},Move:{X:e.clientX,Y:e.clientY},PreMove:{X:e.clientX,Y:e.clientY}};var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var chart=this.ChartPaint[0];if(chart){var dragColumnWidth=chart.PtInHeaderDragBorder(x,y);if(dragColumnWidth){this.DragColumnWidth={ClickPoint:{X:x,Y:y},LastPoint:{X:x,Y:y},//Click:{ X:e.clientX, Y:e.clientY },
|
|
@@ -12787,10 +12785,12 @@ return true;}else{return false;}}this.Data.YOffset+=pageSize;var showDataCount=d
|
|
|
12787
12785
|
return true;}else{return false;}}var offset=this.Data.YOffset;offset-=pageSize;if(offset<0)offset=0;this.Data.YOffset=offset;return true;};this.MoveYOffset=function(setp,bCycle)//bCycle 是否循环
|
|
12788
12786
|
{if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return false;var chart=this.ChartPaint[0];if(!chart)return false;var pageStatus=chart.GetCurrentPageStatus();if(pageStatus.IsSinglePage)return false;if(setp>0)//向上
|
|
12789
12787
|
{var count=this.Data.Data.length;var pageSize=pageStatus.PageSize;var offset=this.Data.YOffset;if(bCycle){for(var i=0;i<setp;++i){++offset;if(offset+pageSize>count)offset=0;}}else{if(offset+pageSize>=count)return false;for(var i=0;i<setp;++i){if(offset+pageSize+1>count)break;++offset;}}this.Data.YOffset=offset;return true;}else if(setp<0)//向下
|
|
12790
|
-
{setp=Math.abs(setp);var offset=this.Data.YOffset;if(bCycle){var pageSize=pageStatus.PageSize;for(var i=0;i<setp;++i){--offset;if(offset<0)offset=this.Data.Data.length-pageSize;}}else{if(this.Data.YOffset<=0)return false;for(var i=0;i<setp;++i){if(offset-1<0)break;--offset;}}this.Data.YOffset=offset;return true;}return false;}
|
|
12788
|
+
{setp=Math.abs(setp);var offset=this.Data.YOffset;if(bCycle){var pageSize=pageStatus.PageSize;for(var i=0;i<setp;++i){--offset;if(offset<0)offset=this.Data.Data.length-pageSize;}}else{if(this.Data.YOffset<=0)return false;for(var i=0;i<setp;++i){if(offset-1<0)break;--offset;}}this.Data.YOffset=offset;return true;}return false;};// option={ EnablePageCycle: true/false(是否循环翻页) }
|
|
12789
|
+
this.MoveSelectedRow=function(step,option){var chart=this.ChartPaint[0];if(!chart)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;var bPageCycle=false;if(option){if(IFrameSplitOperator.IsBool(option.EnablePageCycle))bPageCycle=option.EnablePageCycle;}var result={Redraw:false,Update:false,OldIndex:-1,NewIndex:-1};//Redraw=重绘, Update=更新数据
|
|
12791
12790
|
if(chart.MultiSelectModel==1){var pageStatus=chart.GetCurrentPageStatus();if(IFrameSplitOperator.IsNonEmptyArray(pageStatus.MultiSelectedRow)){var selected=pageStatus.MultiSelectedRow[0];if(step>0){if(selected==this.Data.Data.length-1)return result;if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.MultiSelectedRow=[pageStatus.Start];result.Redraw=true;return result;}var offset=this.Data.YOffset;for(var i=0;i<step;++i){++selected;if(selected>pageStatus.End)++offset;if(selected>=this.Data.Data.length){selected=0;offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.MultiSelectedRow=[selected];this.Data.YOffset=offset;return result;}else if(step<0){if(selected==0)return result;if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.MultiSelectedRow=[pageStatus.End];result.Redraw=true;return result;}step=Math.abs(step);var offset=this.Data.YOffset;for(var i=0;i<step;++i){--selected;if(selected<pageStatus.Start)--offset;if(selected<0){selected=this.Data.Data.length-1;offset=this.Data.Data.length-pageSize;if(offset<0)offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.MultiSelectedRow=[selected];this.Data.YOffset=offset;return result;}else{return null;}return result;}else{var selected=-1;if(step>0)selected=pageStatus.Start;else if(step<0)selected=pageStatus.End;else return null;chart.MultiSelectedRow=[selected];result.Redraw=true;}return result;}if(chart.SelectedModel==0)//不可翻页模式, 只能在当前页移动
|
|
12792
|
-
{var pageStatus=chart.GetCurrentPageStatus();var pageSize=pageStatus.End-pageStatus.Start+1;var selected=pageStatus.SelectedRow;if(step>0){selected+=step;selected=selected%pageSize;chart.SelectedRow=selected;chart.SelectedFixedRow=-1;result.Redraw=true;return result;}else if(step<0){selected+=step;if(selected<0){selected=selected%pageSize;selected=pageSize+selected;}chart.SelectedRow=selected;chart.SelectedFixedRow=-1;result.Redraw=true;return result;}}else if(chart.SelectedModel==1)//可翻页模式
|
|
12793
|
-
{var pageStatus=chart.GetCurrentPageStatus();var pageSize=pageStatus.PageSize;var selected=pageStatus.SelectedRow;if(step>0){if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.SelectedRow=pageStatus.Start;result.Redraw=true;return result;}var offset=this.Data.YOffset;for(var i=0;i<step;++i){
|
|
12791
|
+
{var pageStatus=chart.GetCurrentPageStatus();var pageSize=pageStatus.End-pageStatus.Start+1;var selected=pageStatus.SelectedRow;result.OldIndex=this.Data.YOffset+selected;if(step>0){selected+=step;selected=selected%pageSize;chart.SelectedRow=selected;chart.SelectedFixedRow=-1;result.Redraw=true;result.NewIndex=this.Data.YOffset+selected;return result;}else if(step<0){selected+=step;if(selected<0){selected=selected%pageSize;selected=pageSize+selected;}chart.SelectedRow=selected;chart.SelectedFixedRow=-1;result.NewIndex=this.Data.YOffset+selected;result.Redraw=true;return result;}}else if(chart.SelectedModel==1)//可翻页模式
|
|
12792
|
+
{var pageStatus=chart.GetCurrentPageStatus();var pageSize=pageStatus.PageSize;var selected=pageStatus.SelectedRow;result.OldIndex=pageStatus.SelectedRow;if(step>0){if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.SelectedRow=pageStatus.Start;result.Redraw=true;result.NewIndex=pageStatus.Start;return result;}var offset=this.Data.YOffset;for(var i=0;i<step;++i){if(selected+1>=this.Data.Data.length&&!bPageCycle)break;++selected;if(selected>pageStatus.End)++offset;if(selected>=this.Data.Data.length){selected=0;offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.SelectedRow=selected;this.Data.YOffset=offset;result.NewIndex=selected;return result;}else if(step<0){if(selected<0||selected<pageStatus.Start||selected>pageStatus.End){chart.SelectedRow=pageStatus.End;result.Redraw=true;result.NewIndex=pageStatus.End;return result;}step=Math.abs(step);var offset=this.Data.YOffset;for(var i=0;i<step;++i){if(selected<=0&&!bPageCycle)//不能循环翻页
|
|
12793
|
+
break;--selected;if(selected<pageStatus.Start)--offset;if(selected<0){selected=this.Data.Data.length-1;offset=this.Data.Data.length-pageSize;if(offset<0)offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.SelectedRow=selected;this.Data.YOffset=offset;result.NewIndex=selected;return result;}}return null;};this.MoveSelectedRowEvent=function(oldIndex,newIndex){var chart=this.ChartPaint[0];if(!chart)return null;if(oldIndex==newIndex)return;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOVE_SELECTED_REPORT_ROW);if(!event||!event.Callback)return;if(!IFrameSplitOperator.IsNonEmptyArray(chart.Data.Data))return;var arySymbol=chart.Data.Data;var oldData=null,newData=null;if(oldIndex>=0&&oldIndex<arySymbol.length){var symbol=arySymbol[oldIndex];oldData={Symbol:symbol,Index:oldIndex};}if(newIndex>=0&&newIndex<arySymbol.length){var symbol=arySymbol[newIndex];newData={Symbol:symbol,Index:newIndex};}var endData={Old:oldData,Now:newData};event.Callback(event,endData,this);};//左右移动
|
|
12794
12794
|
this.MoveXOffset=function(step){var chart=this.ChartPaint[0];if(!chart)return false;var maxOffset=chart.GetXScrollRange();if(maxOffset<=0)return false;if(step>0){if(this.Data.XOffset>=maxOffset)return false;for(var i=0;i<step;++i){if(this.Data.XOffset>=maxOffset)break;++this.Data.XOffset;}return true;}else if(step<0){if(this.Data.XOffset<=0)return false;step=Math.abs(step);for(var i=0;i<step;++i){if(this.Data.XOffset-1<0)break;--this.Data.XOffset;}return true;}return false;};this.SetXOffset=function(pos){if(!IFrameSplitOperator.IsNumber(pos))return false;var chart=this.ChartPaint[0];if(!chart)return false;var maxOffset=chart.GetXScrollRange();if(pos<0)pos=0;if(pos>maxOffset)pos=maxOffset;this.Data.XOffset=pos;return true;};this.SetYOffset=function(pos){if(!IFrameSplitOperator.IsNumber(pos))return false;var chart=this.ChartPaint[0];if(!chart)return false;var maxOffset=chart.GetYScrollRange();if(pos<0)pos=0;if(pos>maxOffset)pos=maxOffset;this.Data.YOffset=pos;return true;};this.GotoLastPage=function(){var chart=this.ChartPaint[0];if(!chart)return;//显示最后一屏
|
|
12795
12795
|
var pageSize=chart.GetPageSize(true);var offset=this.Data.Data.length-pageSize;if(offset<0)offset=0;this.Data.DataOffset=offset;};this.SetColumn=function(aryColunm,option){var chart=this.ChartPaint[0];if(!chart)return;chart.SetColumn(aryColunm);chart.SizeChange=true;if(option&&option.Redraw)this.Draw();};this.SetTab=function(aryTab,option){var chart=this.ChartPaint[0];;if(!chart)return;var chartTab=chart.Tab;if(!chartTab)return;chartTab.SetTabList(aryTab);if(option&&option.Redraw)this.Draw();};this.SetVScrollbar=function(option){var chart=this.GetReportChart();if(!chart)return;var scrollbar=chart.VScrollbar;if(!scrollbar)return;scrollbar.SetOption(option);};this.SetSelectedTab=function(index,opiton){var chart=this.ChartPaint[0];;if(!chart)return;var chartTab=chart.Tab;if(!chartTab)return;chartTab.SelectedTabIndex=index;};this.ReloadResource=function(option){this.Frame.ReloadResource(option);for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(item.ReloadResource)item.ReloadResource(option);}if(option&&option.Redraw){this.SetSizeChange(true);this.Draw();}if(this.MinuteChartTooltip)this.MinuteChartTooltip.ReloadResource(option);};//列排序
|
|
12796
12796
|
this.SortColumn=function(index,sortType){var _this60=this;if(index<0)return false;var reportChart=this.GetReportChart();if(!reportChart)return false;var column=reportChart.Column[index];if(!column)return false;if(column.Sort!=1&&column.Sort!=2)return false;var sortInfo={Field:index,Sort:sortType};if(this.Data.Virtual&&this.Data.Virtual.Enable){this.SortInfo.Field=sortInfo.Field;this.SortInfo.Sort=sortInfo.Sort;this.Data.YOffset=0;this.ResetReportSelectStatus();this.RequestVirtualStockData();//虚拟表格
|
|
@@ -14329,7 +14329,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
14329
14329
|
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);};}/********************************************************************************
|
|
14330
14330
|
* 版本信息输出
|
|
14331
14331
|
*
|
|
14332
|
-
*/var HQCHART_VERSION="1.1.
|
|
14332
|
+
*/var HQCHART_VERSION="1.1.14438";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
|
|
14333
14333
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
14334
14334
|
// BaseIndex:BaseIndex,
|
|
14335
14335
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -25,7 +25,6 @@ if (!JSConsole)
|
|
|
25
25
|
function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
26
26
|
{
|
|
27
27
|
this.DivElement=divElement;
|
|
28
|
-
this.DivToolElement=null; //工具条
|
|
29
28
|
this.JSChartContainer; //画图控件
|
|
30
29
|
this.ResizeListener;
|
|
31
30
|
|
|
@@ -121,6 +120,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
121
120
|
//画布大小通过div获取 如果有style里的大小 使用style里的
|
|
122
121
|
var height=this.DivElement.offsetHeight;
|
|
123
122
|
var width=this.DivElement.offsetWidth;
|
|
123
|
+
var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率s
|
|
124
124
|
if (this.DivElement.style.height && this.DivElement.style.width)
|
|
125
125
|
{
|
|
126
126
|
if (this.DivElement.style.height.includes("px"))
|
|
@@ -128,21 +128,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
128
128
|
if (this.DivElement.style.width.includes("px"))
|
|
129
129
|
width=parseInt(this.DivElement.style.width.replace("px",""));
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
if (this.ToolElement)
|
|
133
|
-
{
|
|
134
|
-
//TODO调整工具条大小
|
|
135
|
-
height-=this.ToolElement.style.height.replace("px",""); //减去工具条的高度
|
|
136
|
-
}
|
|
137
131
|
|
|
138
|
-
this.CanvasElement.
|
|
139
|
-
this.CanvasElement.
|
|
140
|
-
this.CanvasElement.style.width=this.CanvasElement.width+'px';
|
|
141
|
-
this.CanvasElement.style.height=this.CanvasElement.height+'px';
|
|
132
|
+
this.CanvasElement.style.width=`${width}px`;
|
|
133
|
+
this.CanvasElement.style.height=`${height}px`;
|
|
142
134
|
|
|
143
|
-
|
|
144
|
-
this.CanvasElement.
|
|
145
|
-
this.CanvasElement.width*=pixelTatio;
|
|
135
|
+
this.CanvasElement.height=parseInt(pixelTatio*height); //根据分辨率缩放
|
|
136
|
+
this.CanvasElement.width=parseInt(pixelTatio*width);
|
|
146
137
|
|
|
147
138
|
if (this.OffscreenCanvasElement)
|
|
148
139
|
{
|
|
@@ -79712,6 +79703,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
79712
79703
|
chart.SetOption(option);
|
|
79713
79704
|
this.ExtendChartPaint.push(chart);
|
|
79714
79705
|
return chart;
|
|
79706
|
+
case "BackgroundPaint":
|
|
79715
79707
|
case '背景图':
|
|
79716
79708
|
chart=new BackgroundPaint();
|
|
79717
79709
|
chart.Canvas=this.Canvas;
|
|
@@ -88312,6 +88304,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
88312
88304
|
chart.SetOption(option);
|
|
88313
88305
|
this.ExtendChartPaint.push(chart);
|
|
88314
88306
|
return chart;
|
|
88307
|
+
case "BackgroundPaint":
|
|
88315
88308
|
case "背景图":
|
|
88316
88309
|
chart=new BackgroundPaint();
|
|
88317
88310
|
chart.Canvas=this.Canvas;
|
|
@@ -1842,19 +1842,21 @@ function JSReportChartContainer(uielement)
|
|
|
1842
1842
|
}
|
|
1843
1843
|
break;
|
|
1844
1844
|
case 38: //up
|
|
1845
|
-
var result=this.MoveSelectedRow(-1);
|
|
1845
|
+
var result=this.MoveSelectedRow(-1, {EnablePageCycle: this.PageUpDownCycle});
|
|
1846
1846
|
if (result)
|
|
1847
1847
|
{
|
|
1848
1848
|
if (result.Redraw) this.Draw();
|
|
1849
1849
|
if (result.Update) this.DelayUpdateStockData();
|
|
1850
|
+
this.MoveSelectedRowEvent(result.OldIndex, result.NewIndex);
|
|
1850
1851
|
}
|
|
1851
1852
|
break;
|
|
1852
1853
|
case 40: //down
|
|
1853
|
-
var result=this.MoveSelectedRow(1)
|
|
1854
|
+
var result=this.MoveSelectedRow(1, {EnablePageCycle: this.PageUpDownCycle})
|
|
1854
1855
|
if (result)
|
|
1855
1856
|
{
|
|
1856
1857
|
if (result.Redraw) this.Draw();
|
|
1857
1858
|
if (result.Update) this.DelayUpdateStockData();
|
|
1859
|
+
this.MoveSelectedRowEvent(result.OldIndex, result.NewIndex);
|
|
1858
1860
|
}
|
|
1859
1861
|
break;
|
|
1860
1862
|
case 37: //left
|
|
@@ -3015,13 +3017,19 @@ function JSReportChartContainer(uielement)
|
|
|
3015
3017
|
return false;
|
|
3016
3018
|
}
|
|
3017
3019
|
|
|
3018
|
-
|
|
3020
|
+
// option={ EnablePageCycle: true/false(是否循环翻页) }
|
|
3021
|
+
this.MoveSelectedRow=function(step, option)
|
|
3019
3022
|
{
|
|
3020
3023
|
var chart=this.ChartPaint[0];
|
|
3021
3024
|
if (!chart) return null;
|
|
3022
3025
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return null;
|
|
3026
|
+
var bPageCycle=false;
|
|
3027
|
+
if (option)
|
|
3028
|
+
{
|
|
3029
|
+
if (IFrameSplitOperator.IsBool(option.EnablePageCycle)) bPageCycle=option.EnablePageCycle;
|
|
3030
|
+
}
|
|
3023
3031
|
|
|
3024
|
-
var result={ Redraw:false, Update:false }; //Redraw=重绘, Update=更新数据
|
|
3032
|
+
var result={ Redraw:false, Update:false, OldIndex:-1, NewIndex:-1 }; //Redraw=重绘, Update=更新数据
|
|
3025
3033
|
|
|
3026
3034
|
if (chart.MultiSelectModel==1)
|
|
3027
3035
|
{
|
|
@@ -3123,6 +3131,7 @@ function JSReportChartContainer(uielement)
|
|
|
3123
3131
|
var pageStatus=chart.GetCurrentPageStatus();
|
|
3124
3132
|
var pageSize=pageStatus.End-pageStatus.Start+1;
|
|
3125
3133
|
var selected=pageStatus.SelectedRow;
|
|
3134
|
+
result.OldIndex=this.Data.YOffset+selected;
|
|
3126
3135
|
if (step>0)
|
|
3127
3136
|
{
|
|
3128
3137
|
selected+=step;
|
|
@@ -3130,6 +3139,7 @@ function JSReportChartContainer(uielement)
|
|
|
3130
3139
|
chart.SelectedRow=selected;
|
|
3131
3140
|
chart.SelectedFixedRow=-1;
|
|
3132
3141
|
result.Redraw=true;
|
|
3142
|
+
result.NewIndex=this.Data.YOffset+selected;
|
|
3133
3143
|
return result;
|
|
3134
3144
|
}
|
|
3135
3145
|
else if (step<0)
|
|
@@ -3143,6 +3153,7 @@ function JSReportChartContainer(uielement)
|
|
|
3143
3153
|
|
|
3144
3154
|
chart.SelectedRow=selected;
|
|
3145
3155
|
chart.SelectedFixedRow=-1;
|
|
3156
|
+
result.NewIndex=this.Data.YOffset+selected;
|
|
3146
3157
|
result.Redraw=true;
|
|
3147
3158
|
return result;
|
|
3148
3159
|
}
|
|
@@ -3152,18 +3163,23 @@ function JSReportChartContainer(uielement)
|
|
|
3152
3163
|
var pageStatus=chart.GetCurrentPageStatus();
|
|
3153
3164
|
var pageSize=pageStatus.PageSize;
|
|
3154
3165
|
var selected=pageStatus.SelectedRow;
|
|
3166
|
+
result.OldIndex=pageStatus.SelectedRow;
|
|
3155
3167
|
if (step>0)
|
|
3156
3168
|
{
|
|
3157
3169
|
if (selected<0 || selected<pageStatus.Start || selected>pageStatus.End)
|
|
3158
3170
|
{
|
|
3159
3171
|
chart.SelectedRow=pageStatus.Start;
|
|
3160
3172
|
result.Redraw=true;
|
|
3173
|
+
result.NewIndex=pageStatus.Start;
|
|
3161
3174
|
return result;
|
|
3162
3175
|
}
|
|
3163
3176
|
|
|
3164
3177
|
var offset=this.Data.YOffset;
|
|
3165
3178
|
for(var i=0;i<step;++i)
|
|
3166
3179
|
{
|
|
3180
|
+
if (selected+1>=this.Data.Data.length && !bPageCycle)
|
|
3181
|
+
break;
|
|
3182
|
+
|
|
3167
3183
|
++selected;
|
|
3168
3184
|
if (selected>pageStatus.End) ++offset;
|
|
3169
3185
|
|
|
@@ -3179,7 +3195,7 @@ function JSReportChartContainer(uielement)
|
|
|
3179
3195
|
|
|
3180
3196
|
chart.SelectedRow=selected;
|
|
3181
3197
|
this.Data.YOffset=offset;
|
|
3182
|
-
|
|
3198
|
+
result.NewIndex=selected;
|
|
3183
3199
|
return result;
|
|
3184
3200
|
}
|
|
3185
3201
|
else if (step<0)
|
|
@@ -3188,6 +3204,7 @@ function JSReportChartContainer(uielement)
|
|
|
3188
3204
|
{
|
|
3189
3205
|
chart.SelectedRow=pageStatus.End;
|
|
3190
3206
|
result.Redraw=true;
|
|
3207
|
+
result.NewIndex=pageStatus.End;
|
|
3191
3208
|
return result;
|
|
3192
3209
|
}
|
|
3193
3210
|
|
|
@@ -3195,6 +3212,9 @@ function JSReportChartContainer(uielement)
|
|
|
3195
3212
|
var offset=this.Data.YOffset;
|
|
3196
3213
|
for(var i=0;i<step;++i)
|
|
3197
3214
|
{
|
|
3215
|
+
if (selected<=0 && !bPageCycle) //不能循环翻页
|
|
3216
|
+
break;
|
|
3217
|
+
|
|
3198
3218
|
--selected;
|
|
3199
3219
|
if (selected<pageStatus.Start) --offset;
|
|
3200
3220
|
|
|
@@ -3211,6 +3231,7 @@ function JSReportChartContainer(uielement)
|
|
|
3211
3231
|
|
|
3212
3232
|
chart.SelectedRow=selected;
|
|
3213
3233
|
this.Data.YOffset=offset;
|
|
3234
|
+
result.NewIndex=selected;
|
|
3214
3235
|
|
|
3215
3236
|
return result;
|
|
3216
3237
|
}
|
|
@@ -3219,6 +3240,36 @@ function JSReportChartContainer(uielement)
|
|
|
3219
3240
|
return null;
|
|
3220
3241
|
}
|
|
3221
3242
|
|
|
3243
|
+
this.MoveSelectedRowEvent=function(oldIndex, newIndex)
|
|
3244
|
+
{
|
|
3245
|
+
var chart=this.ChartPaint[0];
|
|
3246
|
+
if (!chart) return null;
|
|
3247
|
+
|
|
3248
|
+
if (oldIndex==newIndex) return;
|
|
3249
|
+
|
|
3250
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOVE_SELECTED_REPORT_ROW);
|
|
3251
|
+
if (!event || !event.Callback) return;
|
|
3252
|
+
|
|
3253
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(chart.Data.Data)) return;
|
|
3254
|
+
var arySymbol=chart.Data.Data;
|
|
3255
|
+
|
|
3256
|
+
var oldData=null, newData=null;
|
|
3257
|
+
if (oldIndex>=0 && oldIndex<arySymbol.length)
|
|
3258
|
+
{
|
|
3259
|
+
var symbol=arySymbol[oldIndex];
|
|
3260
|
+
oldData={ Symbol:symbol, Index:oldIndex };
|
|
3261
|
+
}
|
|
3262
|
+
|
|
3263
|
+
if (newIndex>=0 && newIndex<arySymbol.length)
|
|
3264
|
+
{
|
|
3265
|
+
var symbol=arySymbol[newIndex];
|
|
3266
|
+
newData={ Symbol:symbol, Index:newIndex };
|
|
3267
|
+
}
|
|
3268
|
+
|
|
3269
|
+
var endData={ Old:oldData, Now:newData };
|
|
3270
|
+
event.Callback(event, endData, this);
|
|
3271
|
+
}
|
|
3272
|
+
|
|
3222
3273
|
//左右移动
|
|
3223
3274
|
this.MoveXOffset=function(step)
|
|
3224
3275
|
{
|
|
@@ -3950,7 +3950,6 @@ if (!JSConsole)
|
|
|
3950
3950
|
function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
3951
3951
|
{
|
|
3952
3952
|
this.DivElement=divElement;
|
|
3953
|
-
this.DivToolElement=null; //工具条
|
|
3954
3953
|
this.JSChartContainer; //画图控件
|
|
3955
3954
|
this.ResizeListener;
|
|
3956
3955
|
|
|
@@ -4046,6 +4045,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4046
4045
|
//画布大小通过div获取 如果有style里的大小 使用style里的
|
|
4047
4046
|
var height=this.DivElement.offsetHeight;
|
|
4048
4047
|
var width=this.DivElement.offsetWidth;
|
|
4048
|
+
var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率s
|
|
4049
4049
|
if (this.DivElement.style.height && this.DivElement.style.width)
|
|
4050
4050
|
{
|
|
4051
4051
|
if (this.DivElement.style.height.includes("px"))
|
|
@@ -4053,21 +4053,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4053
4053
|
if (this.DivElement.style.width.includes("px"))
|
|
4054
4054
|
width=parseInt(this.DivElement.style.width.replace("px",""));
|
|
4055
4055
|
}
|
|
4056
|
-
|
|
4057
|
-
if (this.ToolElement)
|
|
4058
|
-
{
|
|
4059
|
-
//TODO调整工具条大小
|
|
4060
|
-
height-=this.ToolElement.style.height.replace("px",""); //减去工具条的高度
|
|
4061
|
-
}
|
|
4062
4056
|
|
|
4063
|
-
this.CanvasElement.
|
|
4064
|
-
this.CanvasElement.
|
|
4065
|
-
this.CanvasElement.style.width=this.CanvasElement.width+'px';
|
|
4066
|
-
this.CanvasElement.style.height=this.CanvasElement.height+'px';
|
|
4057
|
+
this.CanvasElement.style.width=`${width}px`;
|
|
4058
|
+
this.CanvasElement.style.height=`${height}px`;
|
|
4067
4059
|
|
|
4068
|
-
|
|
4069
|
-
this.CanvasElement.
|
|
4070
|
-
this.CanvasElement.width*=pixelTatio;
|
|
4060
|
+
this.CanvasElement.height=parseInt(pixelTatio*height); //根据分辨率缩放
|
|
4061
|
+
this.CanvasElement.width=parseInt(pixelTatio*width);
|
|
4071
4062
|
|
|
4072
4063
|
if (this.OffscreenCanvasElement)
|
|
4073
4064
|
{
|
|
@@ -83637,6 +83628,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83637
83628
|
chart.SetOption(option);
|
|
83638
83629
|
this.ExtendChartPaint.push(chart);
|
|
83639
83630
|
return chart;
|
|
83631
|
+
case "BackgroundPaint":
|
|
83640
83632
|
case '背景图':
|
|
83641
83633
|
chart=new BackgroundPaint();
|
|
83642
83634
|
chart.Canvas=this.Canvas;
|
|
@@ -92237,6 +92229,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
92237
92229
|
chart.SetOption(option);
|
|
92238
92230
|
this.ExtendChartPaint.push(chart);
|
|
92239
92231
|
return chart;
|
|
92232
|
+
case "BackgroundPaint":
|
|
92240
92233
|
case "背景图":
|
|
92241
92234
|
chart=new BackgroundPaint();
|
|
92242
92235
|
chart.Canvas=this.Canvas;
|
|
@@ -132496,19 +132489,21 @@ function JSReportChartContainer(uielement)
|
|
|
132496
132489
|
}
|
|
132497
132490
|
break;
|
|
132498
132491
|
case 38: //up
|
|
132499
|
-
var result=this.MoveSelectedRow(-1);
|
|
132492
|
+
var result=this.MoveSelectedRow(-1, {EnablePageCycle: this.PageUpDownCycle});
|
|
132500
132493
|
if (result)
|
|
132501
132494
|
{
|
|
132502
132495
|
if (result.Redraw) this.Draw();
|
|
132503
132496
|
if (result.Update) this.DelayUpdateStockData();
|
|
132497
|
+
this.MoveSelectedRowEvent(result.OldIndex, result.NewIndex);
|
|
132504
132498
|
}
|
|
132505
132499
|
break;
|
|
132506
132500
|
case 40: //down
|
|
132507
|
-
var result=this.MoveSelectedRow(1)
|
|
132501
|
+
var result=this.MoveSelectedRow(1, {EnablePageCycle: this.PageUpDownCycle})
|
|
132508
132502
|
if (result)
|
|
132509
132503
|
{
|
|
132510
132504
|
if (result.Redraw) this.Draw();
|
|
132511
132505
|
if (result.Update) this.DelayUpdateStockData();
|
|
132506
|
+
this.MoveSelectedRowEvent(result.OldIndex, result.NewIndex);
|
|
132512
132507
|
}
|
|
132513
132508
|
break;
|
|
132514
132509
|
case 37: //left
|
|
@@ -133669,13 +133664,19 @@ function JSReportChartContainer(uielement)
|
|
|
133669
133664
|
return false;
|
|
133670
133665
|
}
|
|
133671
133666
|
|
|
133672
|
-
|
|
133667
|
+
// option={ EnablePageCycle: true/false(是否循环翻页) }
|
|
133668
|
+
this.MoveSelectedRow=function(step, option)
|
|
133673
133669
|
{
|
|
133674
133670
|
var chart=this.ChartPaint[0];
|
|
133675
133671
|
if (!chart) return null;
|
|
133676
133672
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return null;
|
|
133673
|
+
var bPageCycle=false;
|
|
133674
|
+
if (option)
|
|
133675
|
+
{
|
|
133676
|
+
if (IFrameSplitOperator.IsBool(option.EnablePageCycle)) bPageCycle=option.EnablePageCycle;
|
|
133677
|
+
}
|
|
133677
133678
|
|
|
133678
|
-
var result={ Redraw:false, Update:false }; //Redraw=重绘, Update=更新数据
|
|
133679
|
+
var result={ Redraw:false, Update:false, OldIndex:-1, NewIndex:-1 }; //Redraw=重绘, Update=更新数据
|
|
133679
133680
|
|
|
133680
133681
|
if (chart.MultiSelectModel==1)
|
|
133681
133682
|
{
|
|
@@ -133777,6 +133778,7 @@ function JSReportChartContainer(uielement)
|
|
|
133777
133778
|
var pageStatus=chart.GetCurrentPageStatus();
|
|
133778
133779
|
var pageSize=pageStatus.End-pageStatus.Start+1;
|
|
133779
133780
|
var selected=pageStatus.SelectedRow;
|
|
133781
|
+
result.OldIndex=this.Data.YOffset+selected;
|
|
133780
133782
|
if (step>0)
|
|
133781
133783
|
{
|
|
133782
133784
|
selected+=step;
|
|
@@ -133784,6 +133786,7 @@ function JSReportChartContainer(uielement)
|
|
|
133784
133786
|
chart.SelectedRow=selected;
|
|
133785
133787
|
chart.SelectedFixedRow=-1;
|
|
133786
133788
|
result.Redraw=true;
|
|
133789
|
+
result.NewIndex=this.Data.YOffset+selected;
|
|
133787
133790
|
return result;
|
|
133788
133791
|
}
|
|
133789
133792
|
else if (step<0)
|
|
@@ -133797,6 +133800,7 @@ function JSReportChartContainer(uielement)
|
|
|
133797
133800
|
|
|
133798
133801
|
chart.SelectedRow=selected;
|
|
133799
133802
|
chart.SelectedFixedRow=-1;
|
|
133803
|
+
result.NewIndex=this.Data.YOffset+selected;
|
|
133800
133804
|
result.Redraw=true;
|
|
133801
133805
|
return result;
|
|
133802
133806
|
}
|
|
@@ -133806,18 +133810,23 @@ function JSReportChartContainer(uielement)
|
|
|
133806
133810
|
var pageStatus=chart.GetCurrentPageStatus();
|
|
133807
133811
|
var pageSize=pageStatus.PageSize;
|
|
133808
133812
|
var selected=pageStatus.SelectedRow;
|
|
133813
|
+
result.OldIndex=pageStatus.SelectedRow;
|
|
133809
133814
|
if (step>0)
|
|
133810
133815
|
{
|
|
133811
133816
|
if (selected<0 || selected<pageStatus.Start || selected>pageStatus.End)
|
|
133812
133817
|
{
|
|
133813
133818
|
chart.SelectedRow=pageStatus.Start;
|
|
133814
133819
|
result.Redraw=true;
|
|
133820
|
+
result.NewIndex=pageStatus.Start;
|
|
133815
133821
|
return result;
|
|
133816
133822
|
}
|
|
133817
133823
|
|
|
133818
133824
|
var offset=this.Data.YOffset;
|
|
133819
133825
|
for(var i=0;i<step;++i)
|
|
133820
133826
|
{
|
|
133827
|
+
if (selected+1>=this.Data.Data.length && !bPageCycle)
|
|
133828
|
+
break;
|
|
133829
|
+
|
|
133821
133830
|
++selected;
|
|
133822
133831
|
if (selected>pageStatus.End) ++offset;
|
|
133823
133832
|
|
|
@@ -133833,7 +133842,7 @@ function JSReportChartContainer(uielement)
|
|
|
133833
133842
|
|
|
133834
133843
|
chart.SelectedRow=selected;
|
|
133835
133844
|
this.Data.YOffset=offset;
|
|
133836
|
-
|
|
133845
|
+
result.NewIndex=selected;
|
|
133837
133846
|
return result;
|
|
133838
133847
|
}
|
|
133839
133848
|
else if (step<0)
|
|
@@ -133842,6 +133851,7 @@ function JSReportChartContainer(uielement)
|
|
|
133842
133851
|
{
|
|
133843
133852
|
chart.SelectedRow=pageStatus.End;
|
|
133844
133853
|
result.Redraw=true;
|
|
133854
|
+
result.NewIndex=pageStatus.End;
|
|
133845
133855
|
return result;
|
|
133846
133856
|
}
|
|
133847
133857
|
|
|
@@ -133849,6 +133859,9 @@ function JSReportChartContainer(uielement)
|
|
|
133849
133859
|
var offset=this.Data.YOffset;
|
|
133850
133860
|
for(var i=0;i<step;++i)
|
|
133851
133861
|
{
|
|
133862
|
+
if (selected<=0 && !bPageCycle) //不能循环翻页
|
|
133863
|
+
break;
|
|
133864
|
+
|
|
133852
133865
|
--selected;
|
|
133853
133866
|
if (selected<pageStatus.Start) --offset;
|
|
133854
133867
|
|
|
@@ -133865,6 +133878,7 @@ function JSReportChartContainer(uielement)
|
|
|
133865
133878
|
|
|
133866
133879
|
chart.SelectedRow=selected;
|
|
133867
133880
|
this.Data.YOffset=offset;
|
|
133881
|
+
result.NewIndex=selected;
|
|
133868
133882
|
|
|
133869
133883
|
return result;
|
|
133870
133884
|
}
|
|
@@ -133873,6 +133887,36 @@ function JSReportChartContainer(uielement)
|
|
|
133873
133887
|
return null;
|
|
133874
133888
|
}
|
|
133875
133889
|
|
|
133890
|
+
this.MoveSelectedRowEvent=function(oldIndex, newIndex)
|
|
133891
|
+
{
|
|
133892
|
+
var chart=this.ChartPaint[0];
|
|
133893
|
+
if (!chart) return null;
|
|
133894
|
+
|
|
133895
|
+
if (oldIndex==newIndex) return;
|
|
133896
|
+
|
|
133897
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOVE_SELECTED_REPORT_ROW);
|
|
133898
|
+
if (!event || !event.Callback) return;
|
|
133899
|
+
|
|
133900
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(chart.Data.Data)) return;
|
|
133901
|
+
var arySymbol=chart.Data.Data;
|
|
133902
|
+
|
|
133903
|
+
var oldData=null, newData=null;
|
|
133904
|
+
if (oldIndex>=0 && oldIndex<arySymbol.length)
|
|
133905
|
+
{
|
|
133906
|
+
var symbol=arySymbol[oldIndex];
|
|
133907
|
+
oldData={ Symbol:symbol, Index:oldIndex };
|
|
133908
|
+
}
|
|
133909
|
+
|
|
133910
|
+
if (newIndex>=0 && newIndex<arySymbol.length)
|
|
133911
|
+
{
|
|
133912
|
+
var symbol=arySymbol[newIndex];
|
|
133913
|
+
newData={ Symbol:symbol, Index:newIndex };
|
|
133914
|
+
}
|
|
133915
|
+
|
|
133916
|
+
var endData={ Old:oldData, Now:newData };
|
|
133917
|
+
event.Callback(event, endData, this);
|
|
133918
|
+
}
|
|
133919
|
+
|
|
133876
133920
|
//左右移动
|
|
133877
133921
|
this.MoveXOffset=function(step)
|
|
133878
133922
|
{
|
|
@@ -143353,7 +143397,7 @@ function ScrollBarBGChart()
|
|
|
143353
143397
|
|
|
143354
143398
|
|
|
143355
143399
|
|
|
143356
|
-
var HQCHART_VERSION="1.1.
|
|
143400
|
+
var HQCHART_VERSION="1.1.14438";
|
|
143357
143401
|
|
|
143358
143402
|
function PrintHQChartVersion()
|
|
143359
143403
|
{
|
|
@@ -3994,7 +3994,6 @@ if (!JSConsole)
|
|
|
3994
3994
|
function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
3995
3995
|
{
|
|
3996
3996
|
this.DivElement=divElement;
|
|
3997
|
-
this.DivToolElement=null; //工具条
|
|
3998
3997
|
this.JSChartContainer; //画图控件
|
|
3999
3998
|
this.ResizeListener;
|
|
4000
3999
|
|
|
@@ -4090,6 +4089,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4090
4089
|
//画布大小通过div获取 如果有style里的大小 使用style里的
|
|
4091
4090
|
var height=this.DivElement.offsetHeight;
|
|
4092
4091
|
var width=this.DivElement.offsetWidth;
|
|
4092
|
+
var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率s
|
|
4093
4093
|
if (this.DivElement.style.height && this.DivElement.style.width)
|
|
4094
4094
|
{
|
|
4095
4095
|
if (this.DivElement.style.height.includes("px"))
|
|
@@ -4097,21 +4097,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4097
4097
|
if (this.DivElement.style.width.includes("px"))
|
|
4098
4098
|
width=parseInt(this.DivElement.style.width.replace("px",""));
|
|
4099
4099
|
}
|
|
4100
|
-
|
|
4101
|
-
if (this.ToolElement)
|
|
4102
|
-
{
|
|
4103
|
-
//TODO调整工具条大小
|
|
4104
|
-
height-=this.ToolElement.style.height.replace("px",""); //减去工具条的高度
|
|
4105
|
-
}
|
|
4106
4100
|
|
|
4107
|
-
this.CanvasElement.
|
|
4108
|
-
this.CanvasElement.
|
|
4109
|
-
this.CanvasElement.style.width=this.CanvasElement.width+'px';
|
|
4110
|
-
this.CanvasElement.style.height=this.CanvasElement.height+'px';
|
|
4101
|
+
this.CanvasElement.style.width=`${width}px`;
|
|
4102
|
+
this.CanvasElement.style.height=`${height}px`;
|
|
4111
4103
|
|
|
4112
|
-
|
|
4113
|
-
this.CanvasElement.
|
|
4114
|
-
this.CanvasElement.width*=pixelTatio;
|
|
4104
|
+
this.CanvasElement.height=parseInt(pixelTatio*height); //根据分辨率缩放
|
|
4105
|
+
this.CanvasElement.width=parseInt(pixelTatio*width);
|
|
4115
4106
|
|
|
4116
4107
|
if (this.OffscreenCanvasElement)
|
|
4117
4108
|
{
|
|
@@ -83681,6 +83672,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83681
83672
|
chart.SetOption(option);
|
|
83682
83673
|
this.ExtendChartPaint.push(chart);
|
|
83683
83674
|
return chart;
|
|
83675
|
+
case "BackgroundPaint":
|
|
83684
83676
|
case '背景图':
|
|
83685
83677
|
chart=new BackgroundPaint();
|
|
83686
83678
|
chart.Canvas=this.Canvas;
|
|
@@ -92281,6 +92273,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
92281
92273
|
chart.SetOption(option);
|
|
92282
92274
|
this.ExtendChartPaint.push(chart);
|
|
92283
92275
|
return chart;
|
|
92276
|
+
case "BackgroundPaint":
|
|
92284
92277
|
case "背景图":
|
|
92285
92278
|
chart=new BackgroundPaint();
|
|
92286
92279
|
chart.Canvas=this.Canvas;
|
|
@@ -132540,19 +132533,21 @@ function JSReportChartContainer(uielement)
|
|
|
132540
132533
|
}
|
|
132541
132534
|
break;
|
|
132542
132535
|
case 38: //up
|
|
132543
|
-
var result=this.MoveSelectedRow(-1);
|
|
132536
|
+
var result=this.MoveSelectedRow(-1, {EnablePageCycle: this.PageUpDownCycle});
|
|
132544
132537
|
if (result)
|
|
132545
132538
|
{
|
|
132546
132539
|
if (result.Redraw) this.Draw();
|
|
132547
132540
|
if (result.Update) this.DelayUpdateStockData();
|
|
132541
|
+
this.MoveSelectedRowEvent(result.OldIndex, result.NewIndex);
|
|
132548
132542
|
}
|
|
132549
132543
|
break;
|
|
132550
132544
|
case 40: //down
|
|
132551
|
-
var result=this.MoveSelectedRow(1)
|
|
132545
|
+
var result=this.MoveSelectedRow(1, {EnablePageCycle: this.PageUpDownCycle})
|
|
132552
132546
|
if (result)
|
|
132553
132547
|
{
|
|
132554
132548
|
if (result.Redraw) this.Draw();
|
|
132555
132549
|
if (result.Update) this.DelayUpdateStockData();
|
|
132550
|
+
this.MoveSelectedRowEvent(result.OldIndex, result.NewIndex);
|
|
132556
132551
|
}
|
|
132557
132552
|
break;
|
|
132558
132553
|
case 37: //left
|
|
@@ -133713,13 +133708,19 @@ function JSReportChartContainer(uielement)
|
|
|
133713
133708
|
return false;
|
|
133714
133709
|
}
|
|
133715
133710
|
|
|
133716
|
-
|
|
133711
|
+
// option={ EnablePageCycle: true/false(是否循环翻页) }
|
|
133712
|
+
this.MoveSelectedRow=function(step, option)
|
|
133717
133713
|
{
|
|
133718
133714
|
var chart=this.ChartPaint[0];
|
|
133719
133715
|
if (!chart) return null;
|
|
133720
133716
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return null;
|
|
133717
|
+
var bPageCycle=false;
|
|
133718
|
+
if (option)
|
|
133719
|
+
{
|
|
133720
|
+
if (IFrameSplitOperator.IsBool(option.EnablePageCycle)) bPageCycle=option.EnablePageCycle;
|
|
133721
|
+
}
|
|
133721
133722
|
|
|
133722
|
-
var result={ Redraw:false, Update:false }; //Redraw=重绘, Update=更新数据
|
|
133723
|
+
var result={ Redraw:false, Update:false, OldIndex:-1, NewIndex:-1 }; //Redraw=重绘, Update=更新数据
|
|
133723
133724
|
|
|
133724
133725
|
if (chart.MultiSelectModel==1)
|
|
133725
133726
|
{
|
|
@@ -133821,6 +133822,7 @@ function JSReportChartContainer(uielement)
|
|
|
133821
133822
|
var pageStatus=chart.GetCurrentPageStatus();
|
|
133822
133823
|
var pageSize=pageStatus.End-pageStatus.Start+1;
|
|
133823
133824
|
var selected=pageStatus.SelectedRow;
|
|
133825
|
+
result.OldIndex=this.Data.YOffset+selected;
|
|
133824
133826
|
if (step>0)
|
|
133825
133827
|
{
|
|
133826
133828
|
selected+=step;
|
|
@@ -133828,6 +133830,7 @@ function JSReportChartContainer(uielement)
|
|
|
133828
133830
|
chart.SelectedRow=selected;
|
|
133829
133831
|
chart.SelectedFixedRow=-1;
|
|
133830
133832
|
result.Redraw=true;
|
|
133833
|
+
result.NewIndex=this.Data.YOffset+selected;
|
|
133831
133834
|
return result;
|
|
133832
133835
|
}
|
|
133833
133836
|
else if (step<0)
|
|
@@ -133841,6 +133844,7 @@ function JSReportChartContainer(uielement)
|
|
|
133841
133844
|
|
|
133842
133845
|
chart.SelectedRow=selected;
|
|
133843
133846
|
chart.SelectedFixedRow=-1;
|
|
133847
|
+
result.NewIndex=this.Data.YOffset+selected;
|
|
133844
133848
|
result.Redraw=true;
|
|
133845
133849
|
return result;
|
|
133846
133850
|
}
|
|
@@ -133850,18 +133854,23 @@ function JSReportChartContainer(uielement)
|
|
|
133850
133854
|
var pageStatus=chart.GetCurrentPageStatus();
|
|
133851
133855
|
var pageSize=pageStatus.PageSize;
|
|
133852
133856
|
var selected=pageStatus.SelectedRow;
|
|
133857
|
+
result.OldIndex=pageStatus.SelectedRow;
|
|
133853
133858
|
if (step>0)
|
|
133854
133859
|
{
|
|
133855
133860
|
if (selected<0 || selected<pageStatus.Start || selected>pageStatus.End)
|
|
133856
133861
|
{
|
|
133857
133862
|
chart.SelectedRow=pageStatus.Start;
|
|
133858
133863
|
result.Redraw=true;
|
|
133864
|
+
result.NewIndex=pageStatus.Start;
|
|
133859
133865
|
return result;
|
|
133860
133866
|
}
|
|
133861
133867
|
|
|
133862
133868
|
var offset=this.Data.YOffset;
|
|
133863
133869
|
for(var i=0;i<step;++i)
|
|
133864
133870
|
{
|
|
133871
|
+
if (selected+1>=this.Data.Data.length && !bPageCycle)
|
|
133872
|
+
break;
|
|
133873
|
+
|
|
133865
133874
|
++selected;
|
|
133866
133875
|
if (selected>pageStatus.End) ++offset;
|
|
133867
133876
|
|
|
@@ -133877,7 +133886,7 @@ function JSReportChartContainer(uielement)
|
|
|
133877
133886
|
|
|
133878
133887
|
chart.SelectedRow=selected;
|
|
133879
133888
|
this.Data.YOffset=offset;
|
|
133880
|
-
|
|
133889
|
+
result.NewIndex=selected;
|
|
133881
133890
|
return result;
|
|
133882
133891
|
}
|
|
133883
133892
|
else if (step<0)
|
|
@@ -133886,6 +133895,7 @@ function JSReportChartContainer(uielement)
|
|
|
133886
133895
|
{
|
|
133887
133896
|
chart.SelectedRow=pageStatus.End;
|
|
133888
133897
|
result.Redraw=true;
|
|
133898
|
+
result.NewIndex=pageStatus.End;
|
|
133889
133899
|
return result;
|
|
133890
133900
|
}
|
|
133891
133901
|
|
|
@@ -133893,6 +133903,9 @@ function JSReportChartContainer(uielement)
|
|
|
133893
133903
|
var offset=this.Data.YOffset;
|
|
133894
133904
|
for(var i=0;i<step;++i)
|
|
133895
133905
|
{
|
|
133906
|
+
if (selected<=0 && !bPageCycle) //不能循环翻页
|
|
133907
|
+
break;
|
|
133908
|
+
|
|
133896
133909
|
--selected;
|
|
133897
133910
|
if (selected<pageStatus.Start) --offset;
|
|
133898
133911
|
|
|
@@ -133909,6 +133922,7 @@ function JSReportChartContainer(uielement)
|
|
|
133909
133922
|
|
|
133910
133923
|
chart.SelectedRow=selected;
|
|
133911
133924
|
this.Data.YOffset=offset;
|
|
133925
|
+
result.NewIndex=selected;
|
|
133912
133926
|
|
|
133913
133927
|
return result;
|
|
133914
133928
|
}
|
|
@@ -133917,6 +133931,36 @@ function JSReportChartContainer(uielement)
|
|
|
133917
133931
|
return null;
|
|
133918
133932
|
}
|
|
133919
133933
|
|
|
133934
|
+
this.MoveSelectedRowEvent=function(oldIndex, newIndex)
|
|
133935
|
+
{
|
|
133936
|
+
var chart=this.ChartPaint[0];
|
|
133937
|
+
if (!chart) return null;
|
|
133938
|
+
|
|
133939
|
+
if (oldIndex==newIndex) return;
|
|
133940
|
+
|
|
133941
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOVE_SELECTED_REPORT_ROW);
|
|
133942
|
+
if (!event || !event.Callback) return;
|
|
133943
|
+
|
|
133944
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(chart.Data.Data)) return;
|
|
133945
|
+
var arySymbol=chart.Data.Data;
|
|
133946
|
+
|
|
133947
|
+
var oldData=null, newData=null;
|
|
133948
|
+
if (oldIndex>=0 && oldIndex<arySymbol.length)
|
|
133949
|
+
{
|
|
133950
|
+
var symbol=arySymbol[oldIndex];
|
|
133951
|
+
oldData={ Symbol:symbol, Index:oldIndex };
|
|
133952
|
+
}
|
|
133953
|
+
|
|
133954
|
+
if (newIndex>=0 && newIndex<arySymbol.length)
|
|
133955
|
+
{
|
|
133956
|
+
var symbol=arySymbol[newIndex];
|
|
133957
|
+
newData={ Symbol:symbol, Index:newIndex };
|
|
133958
|
+
}
|
|
133959
|
+
|
|
133960
|
+
var endData={ Old:oldData, Now:newData };
|
|
133961
|
+
event.Callback(event, endData, this);
|
|
133962
|
+
}
|
|
133963
|
+
|
|
133920
133964
|
//左右移动
|
|
133921
133965
|
this.MoveXOffset=function(step)
|
|
133922
133966
|
{
|
|
@@ -153165,7 +153209,7 @@ function HQChartScriptWorker()
|
|
|
153165
153209
|
|
|
153166
153210
|
|
|
153167
153211
|
|
|
153168
|
-
var HQCHART_VERSION="1.1.
|
|
153212
|
+
var HQCHART_VERSION="1.1.14438";
|
|
153169
153213
|
|
|
153170
153214
|
function PrintHQChartVersion()
|
|
153171
153215
|
{
|