hqchart 1.1.13513 → 1.1.13520
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 +10 -7
- package/package.json +1 -1
- package/src/jscommon/umychart.js +1 -0
- package/src/jscommon/umychart.report.js +77 -8
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +79 -9
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +79 -9
package/lib/umychart.vue.js
CHANGED
|
@@ -5191,7 +5191,7 @@ var textSize={Width:textWidth,Height:this.TextHeight,Text:[]};var buttonData={Y:
|
|
|
5191
5191
|
{this.DrawTextBGRect(left,y-this.TextHeight/2,textWidth,this.TextHeight);this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,left+2,y,textWidth);}var complexText={ShowType:0,//0=单行(默认) 1=多行
|
|
5192
5192
|
Font:this.Font,Color:this.TextColor,Text:[{Text:text,Margin:this.RightMargin}]};var yTop=y-this.TextHeight/2;if(this.StringFormatY.PercentageText){if(this.TextFormat.Right==0){text=this.StringFormatY.PercentageText+'%';complexText.Text[0].Text=text;}}if(this.StringFormatY.RText){text=this.StringFormatY.RText;complexText.Text[0].Text=text;}if(this.StringFormatY.RComplexText&&IFrameSplitOperator.IsNonEmptyArray(this.StringFormatY.RComplexText.Text)){complexText=this.StringFormatY.RComplexText;if(!complexText.Font)complexText.Font=this.Font;if(!complexText.Color)complexText.Color=this.TextColor;}this.CalculateComplexTextSize(complexText,textSize);if(this.Frame.ChartBorder.Right>=30&&this.ShowTextMode.Right==1){var isOverlayIndex=false;//是否有叠加子坐标
|
|
5193
5193
|
var overlayIndexInterval=null;//子坐标间距
|
|
5194
|
-
if(yValueExtend.FrameID>=0){var frame=this.Frame.SubFrame[yValueExtend.FrameID];isOverlayIndex=frame.OverlayIndex.length>0;overlayIndexInterval=null;if(isOverlayIndex){for(var i=0;i<=frame.OverlayIndex.length;++i){var item=frame.OverlayIndex[i];if(item.Frame.IsShow===false)continue;if(!item.Frame.GetXHorizontal)continue;var overlayLeft=item.Frame.GetXHorizontal();overlayIndexInterval=overlayLeft-right;break;}}}//叠加坐标
|
|
5194
|
+
if(yValueExtend.FrameID>=0){var frame=this.Frame.SubFrame[yValueExtend.FrameID];isOverlayIndex=frame.OverlayIndex.length>0;overlayIndexInterval=null;if(isOverlayIndex){for(var i=0;i<=frame.OverlayIndex.length;++i){var item=frame.OverlayIndex[i];if(!item||!item.Frame)continue;if(item.Frame.IsShow===false)continue;if(!item.Frame.GetXHorizontal)continue;var overlayLeft=item.Frame.GetXHorizontal();overlayIndexInterval=overlayLeft-right;break;}}}//叠加坐标
|
|
5195
5195
|
if(isOverlayIndex&&textSize.Width>overlayIndexInterval&&overlayIndexInterval>0)//大于子坐标宽度
|
|
5196
5196
|
{var drawRight=right+overlayIndexInterval;if(drawRight>chartRight)drawRight=chartRight;var itemLeft=drawRight-2-textSize.Width;this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);this.DrawComplexTextV2(itemLeft,yTop,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButton(yTop,itemLeft,this.TextHeight,this.TextHeight,buttonData);}else if(rightWidth<textSize.Width)//右边空白显示不下,
|
|
5197
5197
|
{var itemLeft=chartRight-2-textSize.Width;this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);this.DrawComplexTextV2(itemLeft,yTop,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButton(yTop,chartRight-2-textSize.Width,this.TextHeight,this.TextHeight,buttonData);}else{var itemLeft=right+2;this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);this.DrawComplexTextV2(itemLeft,yTop,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButton(yTop,right+2,this.TextHeight,this.TextHeight,buttonData);}/*
|
|
@@ -12196,7 +12196,7 @@ this.CanvasElement=document.createElement("canvas");this.CanvasElement.className
|
|
|
12196
12196
|
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();//获取设备的分辨率
|
|
12197
12197
|
this.CanvasElement.height*=pixelTatio;this.CanvasElement.width*=pixelTatio;JSConsole.Chart.Log('[JSReportChart::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.CreateJSReportChartContainer(option);if(!chart)return false;if(option.OnCreatedCallback)option.OnCreatedCallback(chart);this.JSChartContainer=chart;this.DivElement.JSChart=this;//div中保存一份
|
|
12198
12198
|
if(option.EnablePopMenuV2===true)chart.InitalPopMenu();if(option.Symbol)chart.Symbol=option.Symbol;if(option.Name)chart.Name=option.Name;var requestOption={Callback:null};if(chart.Symbol)requestOption.Callback=function(){chart.RequestMemberListData();};if(option.LoadStockList===false){chart.ChartSplashPaint.IsEnableSplash=false;chart.Draw();}else{chart.RequestStockListData(requestOption);//下载码表
|
|
12199
|
-
}};this.CreateJSReportChartContainer=function(option){var chart=new JSReportChartContainer(this.CanvasElement);chart.Create(option);if(option.NetworkFilter)chart.NetworkFilter=option.NetworkFilter;if(IFrameSplitOperator.IsNonEmptyArray(option.Column))chart.SetColumn(option.Column);if(IFrameSplitOperator.IsNonEmptyArray(option.Tab))chart.SetTab(option.Tab);if(IFrameSplitOperator.IsNumber(option.TabSelected))chart.SetSelectedTab(option.TabSelected);if(IFrameSplitOperator.IsBool(option.EnableDragRow))chart.EnableDragRow=option.EnableDragRow;if(IFrameSplitOperator.IsNumber(option.DragRowType))chart.DragRowType=option.DragRowType;if(IFrameSplitOperator.IsBool(option.EnableDragHeader))chart.EnableDragHeader=option.EnableDragHeader;if(option.VScrollbar)chart.SetVScrollbar(option.VScrollbar);if(option.SortInfo){var item=option.SortInfo;if(IFrameSplitOperator.IsNumber(item.Field))chart.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))chart.SortInfo.Sort=item.Sort;}var reportChart=chart.GetReportChart();if(reportChart){if(IFrameSplitOperator.IsNumber(option.TextOverflowStyle))reportChart.TextOverflowStyle=option.TextOverflowStyle;}this.SetChartBorder(chart,option);//是否自动更新
|
|
12199
|
+
}};this.CreateJSReportChartContainer=function(option){var chart=new JSReportChartContainer(this.CanvasElement);chart.Create(option);if(option.NetworkFilter)chart.NetworkFilter=option.NetworkFilter;if(IFrameSplitOperator.IsNonEmptyArray(option.Column))chart.SetColumn(option.Column);if(IFrameSplitOperator.IsNonEmptyArray(option.Tab))chart.SetTab(option.Tab);if(IFrameSplitOperator.IsNumber(option.TabSelected))chart.SetSelectedTab(option.TabSelected);if(IFrameSplitOperator.IsBool(option.EnableDragRow))chart.EnableDragRow=option.EnableDragRow;if(IFrameSplitOperator.IsNumber(option.DragRowType))chart.DragRowType=option.DragRowType;if(IFrameSplitOperator.IsBool(option.EnableDragHeader))chart.EnableDragHeader=option.EnableDragHeader;if(IFrameSplitOperator.IsNumber(option.WheelPageType))chart.WheelPageType=option.WheelPageType;if(IFrameSplitOperator.IsBool(option.PageUpDownCycle))chart.PageUpDownCycle=option.PageUpDownCycle;if(option.VScrollbar)chart.SetVScrollbar(option.VScrollbar);if(option.SortInfo){var item=option.SortInfo;if(IFrameSplitOperator.IsNumber(item.Field))chart.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))chart.SortInfo.Sort=item.Sort;}var reportChart=chart.GetReportChart();if(reportChart){if(IFrameSplitOperator.IsNumber(option.TextOverflowStyle))reportChart.TextOverflowStyle=option.TextOverflowStyle;}this.SetChartBorder(chart,option);//是否自动更新
|
|
12200
12200
|
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;//注册事件
|
|
12201
12201
|
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();//获取设备的分辨率
|
|
12202
12202
|
chart.Frame.ChartBorder.Left*=pixelTatio;chart.Frame.ChartBorder.Right*=pixelTatio;chart.Frame.ChartBorder.Top*=pixelTatio;chart.Frame.ChartBorder.Bottom*=pixelTatio;};/////////////////////////////////////////////////////////////////////////////
|
|
@@ -12256,6 +12256,7 @@ this.UIElement=uielement;this.LastPoint=new Point();//鼠标位置
|
|
|
12256
12256
|
this.IsOnTouch=false;this.TouchDrag;this.TouchMoveMinAngle=70;//左右移动最小角度
|
|
12257
12257
|
this.YStepPixel=5*GetDevicePixelRatio();this.XStepPixel=10*GetDevicePixelRatio();this.PageUpDownCycle=true;//翻页循环
|
|
12258
12258
|
this.DragPageCycle=true;//手机翻页循环
|
|
12259
|
+
this.WheelPageType=0;//鼠标滚轴翻页模式 0=一页一页翻 1=一条一条翻
|
|
12259
12260
|
//拖拽滚动条
|
|
12260
12261
|
this.DragXScroll=null;//{Start:{x,y}, End:{x, y}}
|
|
12261
12262
|
this.DragYScroll=null;this.IsShowVScrollbar=false;this.IsDestroy=false;//是否已经销毁了
|
|
@@ -12354,9 +12355,11 @@ var frequency=this.AutoUpdateFrequency;if(marketStatus==1)//盘前
|
|
|
12354
12355
|
//{event:事件id, callback:回调函数}
|
|
12355
12356
|
this.AddEventCallback=function(object){if(!object||!object.event||!object.callback)return;var data={Callback:object.callback,Source:object};this.mapEvent.set(object.event,data);};this.RemoveEventCallback=function(eventid){if(!this.mapEvent.has(eventid))return;this.mapEvent.delete(eventid);};this.GetEventCallback=function(id)//获取事件回调
|
|
12356
12357
|
{if(!this.mapEvent.has(id))return null;var item=this.mapEvent.get(id);return item;};this.OnSize=function(){if(!this.Frame)return;this.SetSizeChange(true);this.Draw();this.DelayUpdateStockData();};this.SetSizeChange=function(bChanged){for(var i=0;i<this.ChartPaint.length;++i){var chart=this.ChartPaint[i];if(chart)chart.SizeChange=bChanged;}};this.OnWheel=function(e)//滚轴
|
|
12357
|
-
{JSConsole.Chart.Log('[JSReportChartContainer::OnWheel]',e);if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;var x=e.clientX-this.UIElement.getBoundingClientRect().left;var y=e.clientY-this.UIElement.getBoundingClientRect().top;var isInClient=false;this.Canvas.beginPath();this.Canvas.rect(this.Frame.ChartBorder.GetLeft(),this.Frame.ChartBorder.GetTop(),this.Frame.ChartBorder.GetWidth(),this.Frame.ChartBorder.GetHeight());isInClient=this.Canvas.isPointInPath(x,y);if(!isInClient)return;var chart=this.ChartPaint[0];if(!chart)return;var wheelValue=e.wheelDelta;if(!IFrameSplitOperator.IsObjectExist(e.wheelDelta))wheelValue=e.deltaY*-0.01;if(wheelValue<0)
|
|
12358
|
+
{JSConsole.Chart.Log('[JSReportChartContainer::OnWheel]',e);if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;var x=e.clientX-this.UIElement.getBoundingClientRect().left;var y=e.clientY-this.UIElement.getBoundingClientRect().top;var isInClient=false;this.Canvas.beginPath();this.Canvas.rect(this.Frame.ChartBorder.GetLeft(),this.Frame.ChartBorder.GetTop(),this.Frame.ChartBorder.GetWidth(),this.Frame.ChartBorder.GetHeight());isInClient=this.Canvas.isPointInPath(x,y);if(!isInClient)return;var chart=this.ChartPaint[0];if(!chart)return;var wheelValue=e.wheelDelta;if(!IFrameSplitOperator.IsObjectExist(e.wheelDelta))wheelValue=e.deltaY*-0.01;if(this.WheelPageType==1){console.log('[OnWheel] wheelValue='+wheelValue);if(wheelValue<0)//下
|
|
12359
|
+
{if(this.GotoNextItem(1)){this.Draw();this.DelayUpdateStockData();}}else if(wheelValue>0)//上
|
|
12360
|
+
{if(this.GotoNextItem(-1)){this.Draw();this.DelayUpdateStockData();}}}else{if(wheelValue<0)//下一页
|
|
12358
12361
|
{if(this.GotoNextPage(this.PageUpDownCycle)){this.Draw();this.DelayUpdateStockData();}}else if(wheelValue>0)//上一页
|
|
12359
|
-
{if(this.GotoPreviousPage(this.PageUpDownCycle)){this.Draw();this.DelayUpdateStockData();}}if(e.preventDefault)e.preventDefault();else e.returnValue=false;};this.OnKeyDown=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var reportChart=this.GetReportChart();if(!reportChart)return;var keyID=e.keyCode?e.keyCode:e.which;switch(keyID){case 33://page up
|
|
12362
|
+
{if(this.GotoPreviousPage(this.PageUpDownCycle)){this.Draw();this.DelayUpdateStockData();}}}if(e.preventDefault)e.preventDefault();else e.returnValue=false;};this.OnKeyDown=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var reportChart=this.GetReportChart();if(!reportChart)return;var keyID=e.keyCode?e.keyCode:e.which;switch(keyID){case 33://page up
|
|
12360
12363
|
if(this.GotoPreviousPage(this.PageUpDownCycle)){this.Draw();this.DelayUpdateStockData();}break;case 34://page down
|
|
12361
12364
|
if(this.GotoNextPage(this.PageUpDownCycle)){this.Draw();this.DelayUpdateStockData();}break;case 38://up
|
|
12362
12365
|
var result=this.MoveSelectedRow(-1);if(result){if(result.Redraw)this.Draw();if(result.Update)this.DelayUpdateStockData();}break;case 40://down
|
|
@@ -12406,7 +12409,7 @@ var oneStep=this.YStepPixel;if(oneStep<=0)oneStep=5;var step=parseInt(moveUpDown
|
|
|
12406
12409
|
var oneStep=this.XStepPixel;if(oneStep<=0)oneStep=5;var step=parseInt(moveLeftRight/oneStep);//除以4个像素
|
|
12407
12410
|
if(step<=0)return false;if(!isLeft)step*=-1;if(this.MoveXOffset(step)){drag.IsXMove=true;this.Draw();}return true;};this.OnTouchMove=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var reportChart=this.GetReportChart();if(!reportChart)return;var touches=this.GetTouchData(e);if(this.IsPhoneDragging(e)){var drag=this.TouchDrag;this.TouchInfo.Move={X:touches[0].clientX,Y:touches[0].clientY};if(drag){this.PreventTouchEvent(e);var moveAngle=this.GetMoveAngle(drag.LastMove,{X:touches[0].clientX,Y:touches[0].clientY});var moveLeftRight=Math.abs(drag.LastMove.X-touches[0].clientX);var moveUpDown=Math.abs(drag.LastMove.Y-touches[0].clientY);if(drag.IsYMove==true){this.ShowPageInfo(true);if(!this.OnDragYOffset(drag,touches,moveUpDown,e))return;}else if(drag.IsXMove==true){if(!this.OnDragXOffset(drag,touches,moveLeftRight,e))return;}else if(moveUpDown>0&&moveAngle<this.TouchMoveMinAngle){this.ShowPageInfo(true);if(!this.OnDragYOffset(drag,touches,moveUpDown,e))return;}else if(moveLeftRight>0&&moveAngle>=this.TouchMoveMinAngle){if(!this.OnDragXOffset(drag,touches,moveLeftRight,e))return;}else{return;}drag.LastMove.X=touches[0].clientX;drag.LastMove.Y=touches[0].clientY;}}};this.OnTouchEnd=function(e){JSConsole.Chart.Log('[JSReportChartContainer:OnTouchEnd]',e);if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;this.ShowPageInfo(false);this.OnTouchClick(this.TouchInfo,e);this.IsOnTouch=false;this.TouchDrag=null;this.TouchInfo=null;};this.OnTouchClick=function(touchInfo,e){if(!touchInfo||!touchInfo.Click)return false;if(touchInfo.Move)return false;var clickPoint=touchInfo.InsideClick;var reportChart=this.GetReportChart();if(!reportChart)return false;var clickData=reportChart.OnMouseDown(clickPoint.X,clickPoint.Y,e);if(!clickData)return false;if(clickData.Type==2||clickData.Type==4)//点击行
|
|
12408
12411
|
{if(clickData.Redraw==true)this.Draw();}else if(clickData.Type==3)//表头
|
|
12409
|
-
{this.OnClickHeader(clickData,e);}JSConsole.Chart.Log('[JSReportChartContainer:OnTouchClick] clickData',clickData);};this.GetTabChart=function(){var chart=this.ChartPaint[0];if(!chart)return null;return chart.Tab;};this.GetVScrollbarChart=function(){var chart=this.ChartPaint[0];if(!chart)return null;return chart.VScrollbar;};this.GetReportChart=function(){var chart=this.ChartPaint[0];return chart;};this.GotoNextPage=function(bCycle)//bCycle 是否循环
|
|
12412
|
+
{this.OnClickHeader(clickData,e);}JSConsole.Chart.Log('[JSReportChartContainer:OnTouchClick] clickData',clickData);};this.GetTabChart=function(){var chart=this.ChartPaint[0];if(!chart)return null;return chart.Tab;};this.GetVScrollbarChart=function(){var chart=this.ChartPaint[0];if(!chart)return null;return chart.VScrollbar;};this.GetReportChart=function(){var chart=this.ChartPaint[0];return chart;};this.GotoNextItem=function(step){if(step==0)return false;if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return false;var chart=this.ChartPaint[0];if(!chart)return false;var pageSize=chart.GetPageSize();if(pageSize>this.Data.Data.length)return false;var moveCount=0;if(step>0){for(var i=0;i<step;++i){if(this.Data.YOffset+pageSize>=this.Data.Data.length)break;++this.Data.YOffset;++moveCount;}}else if(step<0){step=Math.abs(step);for(var i=0;i<step;++i){if(this.Data.YOffset<=0)break;--this.Data.YOffset;++moveCount;}}return moveCount>0;};this.GotoNextPage=function(bCycle)//bCycle 是否循环
|
|
12410
12413
|
{if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return false;var chart=this.ChartPaint[0];if(!chart)return false;var pageSize=chart.GetPageSize();if(pageSize>this.Data.Data.length)return false;if(this.Data.YOffset+pageSize>=this.Data.Data.length){if(bCycle===true){this.Data.YOffset=0;//循环到第1页
|
|
12411
12414
|
return true;}else{return false;}}this.Data.YOffset+=pageSize;var showDataCount=this.Data.Data.length-this.Data.YOffset;if(chart.SelectedModel==0){if(chart.SelectedRow>showDataCount-1)chart.SelectedRow=showDataCount-1;}return true;};this.GotoPreviousPage=function(bCycle)//bCycle 是否循环
|
|
12412
12415
|
{if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return false;var chart=this.ChartPaint[0];if(!chart)return false;var pageSize=chart.GetPageSize();if(pageSize>this.Data.Data.length)return false;if(this.Data.YOffset<=0){if(bCycle===true){this.Data.YOffset=this.Data.Data.length-pageSize;//循环到最后一页
|
|
@@ -12641,7 +12644,7 @@ this.Report;this.MaxPos=15;//滚动条可移动长度
|
|
|
12641
12644
|
this.CurrentPos=15;//当前滚动条移动位置
|
|
12642
12645
|
this.Step=1;//滚动条移动步长
|
|
12643
12646
|
this.ButtonSize=25;this.Enable=false;this.LastStatus={Draw:false};this.GlobalOption;this.ScrollBarHeight=g_JSChartResource.Report.VScrollbar.ScrollBarHeight;this.ButtonColor=g_JSChartResource.Report.VScrollbar.ButtonColor;this.BarColor=g_JSChartResource.Report.VScrollbar.BarColor;this.BorderColor=g_JSChartResource.Report.VScrollbar.BorderColor;this.BGColor=g_JSChartResource.Report.VScrollbar.BGColor;this.Mergin={Left:2,Right:2,Top:2,Bottom:2};this.BarWithConfig={Size:g_JSChartResource.Report.VScrollbar.BarWidth.Size};this.RectScroll={Top:null,Bottom:null,Bar:null,Client:null};//滚动条区域
|
|
12644
|
-
this.ReloadResource=function(resource){this.ScrollBarHeight=g_JSChartResource.Report.VScrollbar.ScrollBarHeight;this.ButtonColor=g_JSChartResource.Report.VScrollbar.ButtonColor;this.BarColor=g_JSChartResource.Report.VScrollbar.BarColor;this.BorderColor=g_JSChartResource.Report.VScrollbar.BorderColor;this.BGColor=g_JSChartResource.Report.VScrollbar.BGColor;this.BarWithConfig={Size:g_JSChartResource.Report.VScrollbar.BarWidth.Size};};this.CalculateSize=function(){var pixelRatio=GetDevicePixelRatio();var width=this.BarWithConfig.Size*pixelRatio+this.Mergin.Left+this.Mergin.Right;this.ButtonSize=Math.min(25,width);};this.DrawScrollbar=function(left,top,right,bottom){this.LastStatus.Draw=false;this.RectScroll={Left:null,Right:null,Bar:null,Client:null};if(!this.Enable)return;var isShow=this.IsShowCallback();if(!isShow)return;var pageInfo=this.Report.GetCurrentPageStatus();if(pageInfo.IsSinglePage)return;var xOffset=pageInfo.Start;var dataCount=pageInfo.DataCount-pageInfo.PageSize;var buttonSize=this.ButtonSize;this.MaxPos=dataCount;this.CurrentPos=xOffset;var rtTop={Right:right-this.Mergin.Right,Top:top+this.Mergin.Top,Width:buttonSize,Height:buttonSize};rtTop.Left=rtTop.Right-buttonSize;rtTop.Bottom=rtTop.Top+buttonSize;var rtBottom={Right:right-this.Mergin.Right,Bottom:bottom-this.Mergin.Bottom,Width:buttonSize,Height:buttonSize};rtBottom.Left=rtBottom.Right-buttonSize;rtBottom.Top=rtBottom.Bottom-buttonSize;var centerHeight=rtBottom.Top-2-(rtTop.Bottom+2);var value=centerHeight-this.ScrollBarHeight;var yOffset=value*this.CurrentPos/this.MaxPos;var y=rtTop.Bottom+2+yOffset;var rtBar={Right:right-this.Mergin.Right,Top:y,Width:buttonSize,Height:this.ScrollBarHeight};rtBar.Left=rtBar.Right-buttonSize;rtBar.Bottom=rtBar.Top+rtBar.Height;this.RectScroll.Top=rtTop;this.RectScroll.Bottom=rtBottom;this.RectScroll.Bar=rtBar;this.RectScroll.Client={Left:rtTop.Left,Right:rtTop.Right,Top:rtTop.Bottom,Bottom:rtBottom.Top};var rtBG={Right:right,Top:top,Bottom:bottom,Width:buttonSize+this.Mergin.Right+this.Mergin.Left};rtBG.Left=rtBG.Right-rtBG.Width;rtBG.Height=rtBG.Bottom-rtBG.Top;this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.fillStyle=this.ButtonColor;this.Canvas.fillRect(rtTop.Left,rtTop.Top,rtTop.Width,rtTop.Height);this.Canvas.fillRect(rtBottom.Left,rtBottom.Top,rtBottom.Width,rtBottom.Height);this.Canvas.strokeStyle=this.BorderColor;this.Canvas.strokeRect(rtTop.Left,rtTop.Top,rtTop.Width,rtTop.Height);this.Canvas.strokeRect(rtBottom.Left,rtBottom.Top,rtBottom.Width,rtBottom.Height);this.Canvas.fillStyle=this.BarColor;this.Canvas.fillRect(rtBar.Left,rtBar.Top,rtBar.Width,rtBar.Height);this.LastStatus.Draw=true;};this.OnMouseDown=function(x,y,e){return this.PtInScroll(x,y);};// Type 1-4 滚动条
|
|
12647
|
+
this.ReloadResource=function(resource){this.ScrollBarHeight=g_JSChartResource.Report.VScrollbar.ScrollBarHeight;this.ButtonColor=g_JSChartResource.Report.VScrollbar.ButtonColor;this.BarColor=g_JSChartResource.Report.VScrollbar.BarColor;this.BorderColor=g_JSChartResource.Report.VScrollbar.BorderColor;this.BGColor=g_JSChartResource.Report.VScrollbar.BGColor;this.BarWithConfig={Size:g_JSChartResource.Report.VScrollbar.BarWidth.Size};};this.CalculateSize=function(){var pixelRatio=GetDevicePixelRatio();var width=this.BarWithConfig.Size*pixelRatio+this.Mergin.Left+this.Mergin.Right;this.ButtonSize=Math.min(25,width);};this.DrawScrollbar=function(left,top,right,bottom){this.LastStatus.Draw=false;this.RectScroll={Left:null,Right:null,Bar:null,Client:null};if(!this.Enable)return;var isShow=this.IsShowCallback();if(!isShow)return;var pageInfo=this.Report.GetCurrentPageStatus();if(pageInfo.IsSinglePage)return;var xOffset=pageInfo.Start;var dataCount=pageInfo.DataCount-pageInfo.PageSize;var buttonSize=this.ButtonSize;this.MaxPos=dataCount;this.CurrentPos=xOffset;var rtTop={Right:right-this.Mergin.Right,Top:top+this.Mergin.Top,Width:buttonSize,Height:buttonSize};rtTop.Left=rtTop.Right-buttonSize;rtTop.Bottom=rtTop.Top+buttonSize;var rtBottom={Right:right-this.Mergin.Right,Bottom:bottom-this.Mergin.Bottom,Width:buttonSize,Height:buttonSize};rtBottom.Left=rtBottom.Right-buttonSize;rtBottom.Top=rtBottom.Bottom-buttonSize;var centerHeight=rtBottom.Top-2-(rtTop.Bottom+2);var value=centerHeight-this.ScrollBarHeight;var yOffset=value*this.CurrentPos/this.MaxPos;var y=rtTop.Bottom+2+yOffset;var rtBar={Right:right-this.Mergin.Right,Top:y,Width:buttonSize,Height:this.ScrollBarHeight};rtBar.Left=rtBar.Right-buttonSize;rtBar.Bottom=rtBar.Top+rtBar.Height;if(rtBar.Bottom>rtBottom.Top-2){rtBar.Bottom=rtBottom.Top-2;rtBar.Top=rtBar.Bottom-rtBar.Height;}this.RectScroll.Top=rtTop;this.RectScroll.Bottom=rtBottom;this.RectScroll.Bar=rtBar;this.RectScroll.Client={Left:rtTop.Left,Right:rtTop.Right,Top:rtTop.Bottom,Bottom:rtBottom.Top};var rtBG={Right:right,Top:top,Bottom:bottom,Width:buttonSize+this.Mergin.Right+this.Mergin.Left};rtBG.Left=rtBG.Right-rtBG.Width;rtBG.Height=rtBG.Bottom-rtBG.Top;this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.fillStyle=this.ButtonColor;this.Canvas.fillRect(rtTop.Left,rtTop.Top,rtTop.Width,rtTop.Height);this.Canvas.fillRect(rtBottom.Left,rtBottom.Top,rtBottom.Width,rtBottom.Height);this.Canvas.strokeStyle=this.BorderColor;this.Canvas.strokeRect(rtTop.Left,rtTop.Top,rtTop.Width,rtTop.Height);this.Canvas.strokeRect(rtBottom.Left,rtBottom.Top,rtBottom.Width,rtBottom.Height);this.Canvas.fillStyle=this.BarColor;this.Canvas.fillRect(rtBar.Left,rtBar.Top,rtBar.Width,rtBar.Height);this.LastStatus.Draw=true;};this.OnMouseDown=function(x,y,e){return this.PtInScroll(x,y);};// Type 1-4 滚动条
|
|
12645
12648
|
this.PtInScroll=function(x,y){if(!this.RectScroll)return null;if(this.RectScroll.Top){var rtItem=this.RectScroll.Top;if(x>=rtItem.Left&&x<=rtItem.Right&&y>=rtItem.Top&&y<=rtItem.Bottom)return{Type:1,Rect:rtItem};}if(this.RectScroll.Bottom){var rtItem=this.RectScroll.Bottom;if(x>=rtItem.Left&&x<=rtItem.Right&&y>=rtItem.Top&&y<=rtItem.Bottom)return{Type:2,Rect:rtItem};}if(this.RectScroll.Bar){var rtItem=this.RectScroll.Bar;if(x>=rtItem.Left&&x<=rtItem.Right&&y>=rtItem.Top&&y<=rtItem.Bottom)return{Type:3,Rect:rtItem};}if(this.RectScroll.Client){var rtItem=this.RectScroll.Client;if(x>=rtItem.Left&&x<=rtItem.Right&&y>=rtItem.Top&&y<=rtItem.Bottom){return{Type:4,Rect:rtItem,Pos:this.GetScrollPostionByPoint(x,y)};}}return null;};this.GetScrollPostionByPoint=function(x,y){var rtItem=this.RectScroll.Client;var value=rtItem.Bottom-rtItem.Top-this.ScrollBarHeight;var pos=parseInt(this.MaxPos*(y-rtItem.Top)/value);return pos;};}/*
|
|
12646
12649
|
Copyright (c) 2018 jones
|
|
12647
12650
|
|
|
@@ -13264,7 +13267,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
13264
13267
|
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);};}/********************************************************************************
|
|
13265
13268
|
* 版本信息输出
|
|
13266
13269
|
*
|
|
13267
|
-
*/var HQCHART_VERSION="1.1.
|
|
13270
|
+
*/var HQCHART_VERSION="1.1.13519";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();//把给外界调用的方法暴露出来
|
|
13268
13271
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
13269
13272
|
// BaseIndex:BaseIndex,
|
|
13270
13273
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -49564,6 +49564,7 @@ function ChartCorssCursor()
|
|
|
49564
49564
|
for(var i=0;i<=frame.OverlayIndex.length;++i)
|
|
49565
49565
|
{
|
|
49566
49566
|
var item=frame.OverlayIndex[i];
|
|
49567
|
+
if (!item || !item.Frame) continue;
|
|
49567
49568
|
if (item.Frame.IsShow===false) continue;
|
|
49568
49569
|
if (!item.Frame.GetXHorizontal) continue;
|
|
49569
49570
|
|
|
@@ -92,6 +92,9 @@ function JSReportChart(divElement)
|
|
|
92
92
|
if (IFrameSplitOperator.IsBool(option.EnableDragRow)) chart.EnableDragRow=option.EnableDragRow;
|
|
93
93
|
if (IFrameSplitOperator.IsNumber(option.DragRowType)) chart.DragRowType=option.DragRowType;
|
|
94
94
|
if (IFrameSplitOperator.IsBool(option.EnableDragHeader)) chart.EnableDragHeader=option.EnableDragHeader;
|
|
95
|
+
if (IFrameSplitOperator.IsNumber(option.WheelPageType)) chart.WheelPageType=option.WheelPageType;
|
|
96
|
+
if (IFrameSplitOperator.IsBool(option.PageUpDownCycle)) chart.PageUpDownCycle=option.PageUpDownCycle;
|
|
97
|
+
|
|
95
98
|
if (option.VScrollbar) chart.SetVScrollbar(option.VScrollbar);
|
|
96
99
|
if (option.SortInfo)
|
|
97
100
|
{
|
|
@@ -337,6 +340,7 @@ function JSReportChartContainer(uielement)
|
|
|
337
340
|
|
|
338
341
|
this.PageUpDownCycle=true; //翻页循环
|
|
339
342
|
this.DragPageCycle=true; //手机翻页循环
|
|
343
|
+
this.WheelPageType=0; //鼠标滚轴翻页模式 0=一页一页翻 1=一条一条翻
|
|
340
344
|
|
|
341
345
|
//拖拽滚动条
|
|
342
346
|
this.DragXScroll=null; //{Start:{x,y}, End:{x, y}}
|
|
@@ -1361,20 +1365,43 @@ function JSReportChartContainer(uielement)
|
|
|
1361
1365
|
if (!IFrameSplitOperator.IsObjectExist(e.wheelDelta))
|
|
1362
1366
|
wheelValue=e.deltaY* -0.01;
|
|
1363
1367
|
|
|
1364
|
-
if (
|
|
1368
|
+
if (this.WheelPageType==1)
|
|
1365
1369
|
{
|
|
1366
|
-
|
|
1370
|
+
console.log(`[OnWheel] wheelValue=${wheelValue}`);
|
|
1371
|
+
if (wheelValue<0) //下
|
|
1367
1372
|
{
|
|
1368
|
-
this.
|
|
1369
|
-
|
|
1373
|
+
if (this.GotoNextItem(1))
|
|
1374
|
+
{
|
|
1375
|
+
this.Draw();
|
|
1376
|
+
this.DelayUpdateStockData();
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
else if (wheelValue>0) //上
|
|
1380
|
+
{
|
|
1381
|
+
if (this.GotoNextItem(-1))
|
|
1382
|
+
{
|
|
1383
|
+
this.Draw();
|
|
1384
|
+
this.DelayUpdateStockData();
|
|
1385
|
+
}
|
|
1370
1386
|
}
|
|
1371
1387
|
}
|
|
1372
|
-
else
|
|
1388
|
+
else
|
|
1373
1389
|
{
|
|
1374
|
-
if (
|
|
1390
|
+
if (wheelValue<0) //下一页
|
|
1375
1391
|
{
|
|
1376
|
-
this.
|
|
1377
|
-
|
|
1392
|
+
if (this.GotoNextPage(this.PageUpDownCycle))
|
|
1393
|
+
{
|
|
1394
|
+
this.Draw();
|
|
1395
|
+
this.DelayUpdateStockData();
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
else if (wheelValue>0) //上一页
|
|
1399
|
+
{
|
|
1400
|
+
if (this.GotoPreviousPage(this.PageUpDownCycle))
|
|
1401
|
+
{
|
|
1402
|
+
this.Draw();
|
|
1403
|
+
this.DelayUpdateStockData();
|
|
1404
|
+
}
|
|
1378
1405
|
}
|
|
1379
1406
|
}
|
|
1380
1407
|
|
|
@@ -2250,6 +2277,43 @@ function JSReportChartContainer(uielement)
|
|
|
2250
2277
|
return chart;
|
|
2251
2278
|
}
|
|
2252
2279
|
|
|
2280
|
+
this.GotoNextItem=function(step)
|
|
2281
|
+
{
|
|
2282
|
+
if (step==0) return false;
|
|
2283
|
+
if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return false;
|
|
2284
|
+
var chart=this.ChartPaint[0];
|
|
2285
|
+
if (!chart) return false;
|
|
2286
|
+
var pageSize=chart.GetPageSize();
|
|
2287
|
+
if (pageSize>this.Data.Data.length) return false;
|
|
2288
|
+
|
|
2289
|
+
var moveCount=0;
|
|
2290
|
+
if (step>0)
|
|
2291
|
+
{
|
|
2292
|
+
for(var i=0;i<step;++i)
|
|
2293
|
+
{
|
|
2294
|
+
if (this.Data.YOffset+pageSize>=this.Data.Data.length)
|
|
2295
|
+
break;
|
|
2296
|
+
|
|
2297
|
+
++this.Data.YOffset;
|
|
2298
|
+
++moveCount;
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
else if (step<0)
|
|
2302
|
+
{
|
|
2303
|
+
step=Math.abs(step);
|
|
2304
|
+
for(var i=0;i<step;++i)
|
|
2305
|
+
{
|
|
2306
|
+
if (this.Data.YOffset<=0)
|
|
2307
|
+
break;
|
|
2308
|
+
|
|
2309
|
+
--this.Data.YOffset;
|
|
2310
|
+
++moveCount;
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
return moveCount>0
|
|
2315
|
+
}
|
|
2316
|
+
|
|
2253
2317
|
this.GotoNextPage=function(bCycle) //bCycle 是否循环
|
|
2254
2318
|
{
|
|
2255
2319
|
if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return false;
|
|
@@ -6362,6 +6426,11 @@ function ChartVScrollbar()
|
|
|
6362
6426
|
var rtBar = {Right:right-this.Mergin.Right, Top:y, Width:buttonSize, Height: this.ScrollBarHeight };
|
|
6363
6427
|
rtBar.Left=rtBar.Right-buttonSize;
|
|
6364
6428
|
rtBar.Bottom=rtBar.Top+rtBar.Height;
|
|
6429
|
+
if (rtBar.Bottom>rtBottom.Top-2)
|
|
6430
|
+
{
|
|
6431
|
+
rtBar.Bottom=rtBottom.Top-2;
|
|
6432
|
+
rtBar.Top=rtBar.Bottom-rtBar.Height;
|
|
6433
|
+
}
|
|
6365
6434
|
|
|
6366
6435
|
this.RectScroll.Top=rtTop;
|
|
6367
6436
|
this.RectScroll.Bottom=rtBottom;
|
|
@@ -53489,6 +53489,7 @@ function ChartCorssCursor()
|
|
|
53489
53489
|
for(var i=0;i<=frame.OverlayIndex.length;++i)
|
|
53490
53490
|
{
|
|
53491
53491
|
var item=frame.OverlayIndex[i];
|
|
53492
|
+
if (!item || !item.Frame) continue;
|
|
53492
53493
|
if (item.Frame.IsShow===false) continue;
|
|
53493
53494
|
if (!item.Frame.GetXHorizontal) continue;
|
|
53494
53495
|
|
|
@@ -125221,6 +125222,9 @@ function JSReportChart(divElement)
|
|
|
125221
125222
|
if (IFrameSplitOperator.IsBool(option.EnableDragRow)) chart.EnableDragRow=option.EnableDragRow;
|
|
125222
125223
|
if (IFrameSplitOperator.IsNumber(option.DragRowType)) chart.DragRowType=option.DragRowType;
|
|
125223
125224
|
if (IFrameSplitOperator.IsBool(option.EnableDragHeader)) chart.EnableDragHeader=option.EnableDragHeader;
|
|
125225
|
+
if (IFrameSplitOperator.IsNumber(option.WheelPageType)) chart.WheelPageType=option.WheelPageType;
|
|
125226
|
+
if (IFrameSplitOperator.IsBool(option.PageUpDownCycle)) chart.PageUpDownCycle=option.PageUpDownCycle;
|
|
125227
|
+
|
|
125224
125228
|
if (option.VScrollbar) chart.SetVScrollbar(option.VScrollbar);
|
|
125225
125229
|
if (option.SortInfo)
|
|
125226
125230
|
{
|
|
@@ -125466,6 +125470,7 @@ function JSReportChartContainer(uielement)
|
|
|
125466
125470
|
|
|
125467
125471
|
this.PageUpDownCycle=true; //翻页循环
|
|
125468
125472
|
this.DragPageCycle=true; //手机翻页循环
|
|
125473
|
+
this.WheelPageType=0; //鼠标滚轴翻页模式 0=一页一页翻 1=一条一条翻
|
|
125469
125474
|
|
|
125470
125475
|
//拖拽滚动条
|
|
125471
125476
|
this.DragXScroll=null; //{Start:{x,y}, End:{x, y}}
|
|
@@ -126490,20 +126495,43 @@ function JSReportChartContainer(uielement)
|
|
|
126490
126495
|
if (!IFrameSplitOperator.IsObjectExist(e.wheelDelta))
|
|
126491
126496
|
wheelValue=e.deltaY* -0.01;
|
|
126492
126497
|
|
|
126493
|
-
if (
|
|
126498
|
+
if (this.WheelPageType==1)
|
|
126494
126499
|
{
|
|
126495
|
-
|
|
126500
|
+
console.log(`[OnWheel] wheelValue=${wheelValue}`);
|
|
126501
|
+
if (wheelValue<0) //下
|
|
126496
126502
|
{
|
|
126497
|
-
this.
|
|
126498
|
-
|
|
126503
|
+
if (this.GotoNextItem(1))
|
|
126504
|
+
{
|
|
126505
|
+
this.Draw();
|
|
126506
|
+
this.DelayUpdateStockData();
|
|
126507
|
+
}
|
|
126508
|
+
}
|
|
126509
|
+
else if (wheelValue>0) //上
|
|
126510
|
+
{
|
|
126511
|
+
if (this.GotoNextItem(-1))
|
|
126512
|
+
{
|
|
126513
|
+
this.Draw();
|
|
126514
|
+
this.DelayUpdateStockData();
|
|
126515
|
+
}
|
|
126499
126516
|
}
|
|
126500
126517
|
}
|
|
126501
|
-
else
|
|
126518
|
+
else
|
|
126502
126519
|
{
|
|
126503
|
-
if (
|
|
126520
|
+
if (wheelValue<0) //下一页
|
|
126504
126521
|
{
|
|
126505
|
-
this.
|
|
126506
|
-
|
|
126522
|
+
if (this.GotoNextPage(this.PageUpDownCycle))
|
|
126523
|
+
{
|
|
126524
|
+
this.Draw();
|
|
126525
|
+
this.DelayUpdateStockData();
|
|
126526
|
+
}
|
|
126527
|
+
}
|
|
126528
|
+
else if (wheelValue>0) //上一页
|
|
126529
|
+
{
|
|
126530
|
+
if (this.GotoPreviousPage(this.PageUpDownCycle))
|
|
126531
|
+
{
|
|
126532
|
+
this.Draw();
|
|
126533
|
+
this.DelayUpdateStockData();
|
|
126534
|
+
}
|
|
126507
126535
|
}
|
|
126508
126536
|
}
|
|
126509
126537
|
|
|
@@ -127379,6 +127407,43 @@ function JSReportChartContainer(uielement)
|
|
|
127379
127407
|
return chart;
|
|
127380
127408
|
}
|
|
127381
127409
|
|
|
127410
|
+
this.GotoNextItem=function(step)
|
|
127411
|
+
{
|
|
127412
|
+
if (step==0) return false;
|
|
127413
|
+
if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return false;
|
|
127414
|
+
var chart=this.ChartPaint[0];
|
|
127415
|
+
if (!chart) return false;
|
|
127416
|
+
var pageSize=chart.GetPageSize();
|
|
127417
|
+
if (pageSize>this.Data.Data.length) return false;
|
|
127418
|
+
|
|
127419
|
+
var moveCount=0;
|
|
127420
|
+
if (step>0)
|
|
127421
|
+
{
|
|
127422
|
+
for(var i=0;i<step;++i)
|
|
127423
|
+
{
|
|
127424
|
+
if (this.Data.YOffset+pageSize>=this.Data.Data.length)
|
|
127425
|
+
break;
|
|
127426
|
+
|
|
127427
|
+
++this.Data.YOffset;
|
|
127428
|
+
++moveCount;
|
|
127429
|
+
}
|
|
127430
|
+
}
|
|
127431
|
+
else if (step<0)
|
|
127432
|
+
{
|
|
127433
|
+
step=Math.abs(step);
|
|
127434
|
+
for(var i=0;i<step;++i)
|
|
127435
|
+
{
|
|
127436
|
+
if (this.Data.YOffset<=0)
|
|
127437
|
+
break;
|
|
127438
|
+
|
|
127439
|
+
--this.Data.YOffset;
|
|
127440
|
+
++moveCount;
|
|
127441
|
+
}
|
|
127442
|
+
}
|
|
127443
|
+
|
|
127444
|
+
return moveCount>0
|
|
127445
|
+
}
|
|
127446
|
+
|
|
127382
127447
|
this.GotoNextPage=function(bCycle) //bCycle 是否循环
|
|
127383
127448
|
{
|
|
127384
127449
|
if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return false;
|
|
@@ -131491,6 +131556,11 @@ function ChartVScrollbar()
|
|
|
131491
131556
|
var rtBar = {Right:right-this.Mergin.Right, Top:y, Width:buttonSize, Height: this.ScrollBarHeight };
|
|
131492
131557
|
rtBar.Left=rtBar.Right-buttonSize;
|
|
131493
131558
|
rtBar.Bottom=rtBar.Top+rtBar.Height;
|
|
131559
|
+
if (rtBar.Bottom>rtBottom.Top-2)
|
|
131560
|
+
{
|
|
131561
|
+
rtBar.Bottom=rtBottom.Top-2;
|
|
131562
|
+
rtBar.Top=rtBar.Bottom-rtBar.Height;
|
|
131563
|
+
}
|
|
131494
131564
|
|
|
131495
131565
|
this.RectScroll.Top=rtTop;
|
|
131496
131566
|
this.RectScroll.Bottom=rtBottom;
|
|
@@ -134643,7 +134713,7 @@ function ScrollBarBGChart()
|
|
|
134643
134713
|
|
|
134644
134714
|
|
|
134645
134715
|
|
|
134646
|
-
var HQCHART_VERSION="1.1.
|
|
134716
|
+
var HQCHART_VERSION="1.1.13519";
|
|
134647
134717
|
|
|
134648
134718
|
function PrintHQChartVersion()
|
|
134649
134719
|
{
|
|
@@ -53533,6 +53533,7 @@ function ChartCorssCursor()
|
|
|
53533
53533
|
for(var i=0;i<=frame.OverlayIndex.length;++i)
|
|
53534
53534
|
{
|
|
53535
53535
|
var item=frame.OverlayIndex[i];
|
|
53536
|
+
if (!item || !item.Frame) continue;
|
|
53536
53537
|
if (item.Frame.IsShow===false) continue;
|
|
53537
53538
|
if (!item.Frame.GetXHorizontal) continue;
|
|
53538
53539
|
|
|
@@ -125265,6 +125266,9 @@ function JSReportChart(divElement)
|
|
|
125265
125266
|
if (IFrameSplitOperator.IsBool(option.EnableDragRow)) chart.EnableDragRow=option.EnableDragRow;
|
|
125266
125267
|
if (IFrameSplitOperator.IsNumber(option.DragRowType)) chart.DragRowType=option.DragRowType;
|
|
125267
125268
|
if (IFrameSplitOperator.IsBool(option.EnableDragHeader)) chart.EnableDragHeader=option.EnableDragHeader;
|
|
125269
|
+
if (IFrameSplitOperator.IsNumber(option.WheelPageType)) chart.WheelPageType=option.WheelPageType;
|
|
125270
|
+
if (IFrameSplitOperator.IsBool(option.PageUpDownCycle)) chart.PageUpDownCycle=option.PageUpDownCycle;
|
|
125271
|
+
|
|
125268
125272
|
if (option.VScrollbar) chart.SetVScrollbar(option.VScrollbar);
|
|
125269
125273
|
if (option.SortInfo)
|
|
125270
125274
|
{
|
|
@@ -125510,6 +125514,7 @@ function JSReportChartContainer(uielement)
|
|
|
125510
125514
|
|
|
125511
125515
|
this.PageUpDownCycle=true; //翻页循环
|
|
125512
125516
|
this.DragPageCycle=true; //手机翻页循环
|
|
125517
|
+
this.WheelPageType=0; //鼠标滚轴翻页模式 0=一页一页翻 1=一条一条翻
|
|
125513
125518
|
|
|
125514
125519
|
//拖拽滚动条
|
|
125515
125520
|
this.DragXScroll=null; //{Start:{x,y}, End:{x, y}}
|
|
@@ -126534,20 +126539,43 @@ function JSReportChartContainer(uielement)
|
|
|
126534
126539
|
if (!IFrameSplitOperator.IsObjectExist(e.wheelDelta))
|
|
126535
126540
|
wheelValue=e.deltaY* -0.01;
|
|
126536
126541
|
|
|
126537
|
-
if (
|
|
126542
|
+
if (this.WheelPageType==1)
|
|
126538
126543
|
{
|
|
126539
|
-
|
|
126544
|
+
console.log(`[OnWheel] wheelValue=${wheelValue}`);
|
|
126545
|
+
if (wheelValue<0) //下
|
|
126540
126546
|
{
|
|
126541
|
-
this.
|
|
126542
|
-
|
|
126547
|
+
if (this.GotoNextItem(1))
|
|
126548
|
+
{
|
|
126549
|
+
this.Draw();
|
|
126550
|
+
this.DelayUpdateStockData();
|
|
126551
|
+
}
|
|
126552
|
+
}
|
|
126553
|
+
else if (wheelValue>0) //上
|
|
126554
|
+
{
|
|
126555
|
+
if (this.GotoNextItem(-1))
|
|
126556
|
+
{
|
|
126557
|
+
this.Draw();
|
|
126558
|
+
this.DelayUpdateStockData();
|
|
126559
|
+
}
|
|
126543
126560
|
}
|
|
126544
126561
|
}
|
|
126545
|
-
else
|
|
126562
|
+
else
|
|
126546
126563
|
{
|
|
126547
|
-
if (
|
|
126564
|
+
if (wheelValue<0) //下一页
|
|
126548
126565
|
{
|
|
126549
|
-
this.
|
|
126550
|
-
|
|
126566
|
+
if (this.GotoNextPage(this.PageUpDownCycle))
|
|
126567
|
+
{
|
|
126568
|
+
this.Draw();
|
|
126569
|
+
this.DelayUpdateStockData();
|
|
126570
|
+
}
|
|
126571
|
+
}
|
|
126572
|
+
else if (wheelValue>0) //上一页
|
|
126573
|
+
{
|
|
126574
|
+
if (this.GotoPreviousPage(this.PageUpDownCycle))
|
|
126575
|
+
{
|
|
126576
|
+
this.Draw();
|
|
126577
|
+
this.DelayUpdateStockData();
|
|
126578
|
+
}
|
|
126551
126579
|
}
|
|
126552
126580
|
}
|
|
126553
126581
|
|
|
@@ -127423,6 +127451,43 @@ function JSReportChartContainer(uielement)
|
|
|
127423
127451
|
return chart;
|
|
127424
127452
|
}
|
|
127425
127453
|
|
|
127454
|
+
this.GotoNextItem=function(step)
|
|
127455
|
+
{
|
|
127456
|
+
if (step==0) return false;
|
|
127457
|
+
if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return false;
|
|
127458
|
+
var chart=this.ChartPaint[0];
|
|
127459
|
+
if (!chart) return false;
|
|
127460
|
+
var pageSize=chart.GetPageSize();
|
|
127461
|
+
if (pageSize>this.Data.Data.length) return false;
|
|
127462
|
+
|
|
127463
|
+
var moveCount=0;
|
|
127464
|
+
if (step>0)
|
|
127465
|
+
{
|
|
127466
|
+
for(var i=0;i<step;++i)
|
|
127467
|
+
{
|
|
127468
|
+
if (this.Data.YOffset+pageSize>=this.Data.Data.length)
|
|
127469
|
+
break;
|
|
127470
|
+
|
|
127471
|
+
++this.Data.YOffset;
|
|
127472
|
+
++moveCount;
|
|
127473
|
+
}
|
|
127474
|
+
}
|
|
127475
|
+
else if (step<0)
|
|
127476
|
+
{
|
|
127477
|
+
step=Math.abs(step);
|
|
127478
|
+
for(var i=0;i<step;++i)
|
|
127479
|
+
{
|
|
127480
|
+
if (this.Data.YOffset<=0)
|
|
127481
|
+
break;
|
|
127482
|
+
|
|
127483
|
+
--this.Data.YOffset;
|
|
127484
|
+
++moveCount;
|
|
127485
|
+
}
|
|
127486
|
+
}
|
|
127487
|
+
|
|
127488
|
+
return moveCount>0
|
|
127489
|
+
}
|
|
127490
|
+
|
|
127426
127491
|
this.GotoNextPage=function(bCycle) //bCycle 是否循环
|
|
127427
127492
|
{
|
|
127428
127493
|
if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return false;
|
|
@@ -131535,6 +131600,11 @@ function ChartVScrollbar()
|
|
|
131535
131600
|
var rtBar = {Right:right-this.Mergin.Right, Top:y, Width:buttonSize, Height: this.ScrollBarHeight };
|
|
131536
131601
|
rtBar.Left=rtBar.Right-buttonSize;
|
|
131537
131602
|
rtBar.Bottom=rtBar.Top+rtBar.Height;
|
|
131603
|
+
if (rtBar.Bottom>rtBottom.Top-2)
|
|
131604
|
+
{
|
|
131605
|
+
rtBar.Bottom=rtBottom.Top-2;
|
|
131606
|
+
rtBar.Top=rtBar.Bottom-rtBar.Height;
|
|
131607
|
+
}
|
|
131538
131608
|
|
|
131539
131609
|
this.RectScroll.Top=rtTop;
|
|
131540
131610
|
this.RectScroll.Bottom=rtBottom;
|
|
@@ -138584,7 +138654,7 @@ function HQChartScriptWorker()
|
|
|
138584
138654
|
|
|
138585
138655
|
|
|
138586
138656
|
|
|
138587
|
-
var HQCHART_VERSION="1.1.
|
|
138657
|
+
var HQCHART_VERSION="1.1.13519";
|
|
138588
138658
|
|
|
138589
138659
|
function PrintHQChartVersion()
|
|
138590
138660
|
{
|