hqchart 1.1.15173 → 1.1.15178
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 +17 -12
- package/package.json +1 -1
- package/src/jscommon/umychart.js +34 -4
- package/src/jscommon/umychart.report.js +13 -4
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +48 -9
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +48 -9
package/lib/umychart.vue.js
CHANGED
|
@@ -1529,7 +1529,7 @@ this.StartAnimation=function(option){if(this.JSChartContainer&&typeof this.JSCha
|
|
|
1529
1529
|
this.AddEventCallback=function(obj){if(this.JSChartContainer&&typeof this.JSChartContainer.AddEventCallback=='function'){JSConsole.Chart.Log('[JSChart:AddEventCallback] ',obj);this.JSChartContainer.AddEventCallback(obj);}};//设置语言 'EN', 'CN'
|
|
1530
1530
|
this.SetLanguage=function(language){if(this.JSChartContainer&&typeof this.JSChartContainer.SetLanguage=='function'){JSConsole.Chart.Log('[JSChart:SetLanguage] ',language);this.JSChartContainer.SetLanguage(language);}};//切换指标模板
|
|
1531
1531
|
this.ChangeIndexTemplate=function(option){if(this.JSChartContainer&&typeof this.JSChartContainer.ChangeIndexTemplate=='function'){JSConsole.Chart.Log('[JSChart:ChangeIndexTemplate] ',option);this.JSChartContainer.ChangeIndexTemplate(option);}};//画图工具
|
|
1532
|
-
this.SetChartDrawOption=function(option){if(this.JSChartContainer&&typeof this.JSChartContainer.SetChartDrawOption=='function'){JSConsole.Chart.Log('[JSChart:SetChartDrawOption] ',option);this.JSChartContainer.SetChartDrawOption(option);}};this.CreateChartDrawPicture=function(name,option){if(this.JSChartContainer&&typeof this.JSChartContainer.CreateChartDrawPicture=='function'){JSConsole.Chart.Log('[JSChart:CreateChartDrawPicture] ',name);this.JSChartContainer.CreateChartDrawPicture(name,option);}};this.AddChartDrawPicture=function(obj){if(this.JSChartContainer&&typeof this.JSChartContainer.AddChartDrawPicture=='function'){JSConsole.Chart.Log('[JSChart:AddChartDrawPicture] ',obj);return this.JSChartContainer.AddChartDrawPicture(obj);}};//删除画图工具
|
|
1532
|
+
this.SetChartDrawOption=function(option){if(this.JSChartContainer&&typeof this.JSChartContainer.SetChartDrawOption=='function'){JSConsole.Chart.Log('[JSChart:SetChartDrawOption] ',option);this.JSChartContainer.SetChartDrawOption(option);}};this.CreateChartDrawPicture=function(name,option){if(this.JSChartContainer&&typeof this.JSChartContainer.CreateChartDrawPicture=='function'){JSConsole.Chart.Log('[JSChart:CreateChartDrawPicture] ',name);this.JSChartContainer.CreateChartDrawPicture(name,option);}};this.AddChartDrawPicture=function(obj,option){if(this.JSChartContainer&&typeof this.JSChartContainer.AddChartDrawPicture=='function'){JSConsole.Chart.Log('[JSChart:AddChartDrawPicture] ',obj);return this.JSChartContainer.AddChartDrawPicture(obj,option);}};//删除画图工具
|
|
1533
1533
|
this.ClearChartDrawPicture=function(drawPicture,option){if(this.JSChartContainer&&typeof this.JSChartContainer.ClearChartDrawPicture=='function'){//JSConsole.Chart.Log('[JSChart:ClearChartDrawPicture] ', drawPicture);
|
|
1534
1534
|
this.JSChartContainer.ClearChartDrawPicture(drawPicture,option);}};//复制一个画图
|
|
1535
1535
|
this.PasteChartDrawPicture=function(data,frameID,option){if(this.JSChartContainer&&typeof this.JSChartContainer.PasteChartDrawPicture=='function'){JSConsole.Chart.Log('[JSChart:PasteChartDrawPicture] ',data,frameID,option);return this.JSChartContainer.PasteChartDrawPicture(data,frameID,option);}};//重新加载配置
|
|
@@ -6823,7 +6823,8 @@ IsShow:true};this.LabelTitle;this.SetOption=function(option){if(this.Super_SetOp
|
|
|
6823
6823
|
|
|
6824
6824
|
return this.PointRange(drawPoint);
|
|
6825
6825
|
}
|
|
6826
|
-
|
|
6826
|
+
*///跨周期 X轴索引调整为0
|
|
6827
|
+
this.ChangePeriod=function(period){var kData=this.GetKData();if(!kData)return;var index=0;this.Value[0].XValue=0;};this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint();if(!drawPoint||drawPoint.length!=1)return;if(!this.Frame)return;if(this.Value.length!=1)return;if(!this.IsYValueInFrame(this.Value[0].YValue))return;var isHScreen=this.Frame.IsHScreen;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();if(isHScreen){left=this.Frame.ChartBorder.GetTop();right=this.Frame.ChartBorder.GetBottom();}var eventData=this.BeforeDrawEvent(drawPoint[0]);if(eventData&&!eventData.IsShow)return;this.ClipFrame();this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(drawPoint[0].X,left);this.Canvas.lineTo(drawPoint[0].X,right);}else{var yFixed=ToFixedPoint2(this.LineWidth,drawPoint[0].Y);this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right,yFixed);}this.Canvas.stroke();this.RestoreLineWidth();var line={Start:new Point(),End:new Point()};if(isHScreen){line.Start.X=drawPoint[0].X;line.Start.Y=left;line.End.X=drawPoint[0].X;line.End.Y=right;}else{line.Start.X=left;line.Start.Y=drawPoint[0].Y;line.End.X=right;line.End.Y=drawPoint[0].Y;}this.LinePoint.push(line);//画点
|
|
6827
6828
|
this.DrawPoint(drawPoint);//显示价格
|
|
6828
6829
|
this.DrawInsideLabel(drawPoint[0]);this.Canvas.restore();this.DrawValueLabel(drawPoint[0]);};this.BeforeDrawEvent=function(point){if(!this.HQChart)return null;var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_BEFORE_DRAW_HLINE);if(!event||!event.Callback)return null;var sendData={ID:this.Guid,LabelConfig:this.LabelConfig,InsideLabelConfig:this.InsideLabelConfig,IsShow:true};event.Callback(event,sendData,this);return sendData;};this.DrawValueLabel=function(point){if(!point)return;if(this.Frame.IsHScreen)return;//不支持横屏
|
|
6829
6830
|
var y=point.Y;var yFixed=ToFixedPoint2(this.LineWidth,y);var yValue=this.Frame.GetYData(y);var text=yValue.toFixed(2);var border=this.Frame.GetBorder();var config=this.LabelConfig;this.Canvas.font=config.Font;var textHeight=this.Canvas.measureText("擎").width;if(config.Left.IsShow&&this.Frame.ChartBorder.Left>5){var leftText=text;if(config.Left.Text)leftText=config.Left.Text;var textWidth=this.Canvas.measureText(leftText).width;var left=border.Left;if(IFrameSplitOperator.IsNumber(config.Left.LineOffset)&&config.Left.LineOffset!==0){left-=config.Left.LineOffset;this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();this.Canvas.moveTo(border.Left,yFixed);this.Canvas.lineTo(left,yFixed);this.Canvas.stroke();this.RestoreLineWidth();}var margin=config.Left.Margin;var rtBG={Right:left+1,Height:textHeight+margin.Top+margin.Bottom,Width:textWidth+margin.Left+margin.Right};rtBG.Top=y-textHeight/2-margin.Top;rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Left=rtBG.Right-rtBG.Width;if(config.BGColor)this.Canvas.fillStyle=config.BGColor;else this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.textAlign="left";this.Canvas.textBaseline="top";var xText=rtBG.Left+margin.Left;var yText=rtBG.Top+margin.Top;this.Canvas.fillStyle=config.TextColor;this.Canvas.fillText(leftText,xText,yText);}if(config.Right.IsShow&&this.Frame.ChartBorder.Right>5){var rightText=text;if(config.Right.Text)rightText=config.Right.Text;var textWidth=this.Canvas.measureText(rightText).width;var left=border.Right;if(IFrameSplitOperator.IsNumber(config.Right.LineOffset)&&config.Right.LineOffset!==0){left+=config.Right.LineOffset;this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();this.Canvas.moveTo(border.Right,yFixed);this.Canvas.lineTo(left,yFixed);this.Canvas.stroke();this.RestoreLineWidth();}var margin=config.Right.Margin;var rtBG={Left:left-1,Height:textHeight+margin.Top+margin.Bottom,Width:textWidth+margin.Left+margin.Right};rtBG.Top=y-textHeight/2-margin.Top;rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;if(config.BGColor)this.Canvas.fillStyle=config.BGColor;else this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.textAlign="left";this.Canvas.textBaseline="top";var xText=rtBG.Left+margin.Left;var yText=rtBG.Top+margin.Top;this.Canvas.fillStyle=config.TextColor;this.Canvas.fillText(rightText,xText,yText);}};this.DrawInsideLabel=function(point){if(!point)return;var isHScreen=this.Frame.IsHScreen;var config=this.InsideLabelConfig;if(!config.IsShow)return;if(config.Position!=0&&config.Position!=1)return;var margin=config.Margin;this.Canvas.fillStyle=this.LineColor;this.Canvas.font=config.Font;var textHeight=this.Canvas.measureText("擎").width;var border=this.Frame.GetBorder();if(isHScreen){var yValue=this.Frame.GetYData(point.X);var text=yValue.toFixed(2);if(this.LabelTitle)text=this.LabelTitle+text;var textWidth=this.Canvas.measureText(text).width;var rtBG=null;if(config.Position==0)//左
|
|
@@ -6862,7 +6863,8 @@ this.IsPointIn=this.IsPointIn_XYValue_Line;this.SetOption=function(option){if(th
|
|
|
6862
6863
|
|
|
6863
6864
|
return this.PointRange(drawPoint);
|
|
6864
6865
|
}
|
|
6865
|
-
|
|
6866
|
+
*///跨周期 X轴索引调整为0
|
|
6867
|
+
this.ChangePeriod=function(period){var kData=this.GetKData();if(!kData)return;var index=0;this.Value[0].XValue=0;};this.IsDrawMain=function()//选中绘制在动态绘图上, 没有选中绘制在背景上
|
|
6866
6868
|
{if(!this.GetActiveDrawPicture)return true;var active=this.GetActiveDrawPicture();if(active.Select.Guid==this.Guid)return false;return true;};this.MainDraw=function(){this.Draw();};//获取需要显示的按钮 系统按钮+自定义按钮
|
|
6867
6869
|
this.GetShowButton=function(){var aryButton=[];var item=this.Button.SettingIcon;if(item&&item.Text)aryButton.push({Data:item,Width:null});item=this.Button.CloseIcon;if(item&&item.Text)aryButton.push({Data:item,Width:null});if(IFrameSplitOperator.IsNonEmptyArray(this.CustomButton)){for(var i=0;i<this.CustomButton.length;++i){item=this.CustomButton[i];if(item&&item.Text)aryButton.push({Data:item,Width:null});}}return aryButton;};this.Draw=function(moveonPoint,mouseStatus){this.AryShowButton=[];this.LinePoint=[];this.AryButton=[];this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;this.LableInfo=null;this.VerticalButtonInfo.Width=0;this.VerticalButtonInfo.Height=0;if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint();if(!drawPoint||drawPoint.length!=1)return;if(!this.Frame)return;if(this.Value.length!=1)return;var bVisibleRange=this.IsYValueInFrame(this.Value[0].YValue);//是否在可视范围
|
|
6868
6870
|
if(!this.AlwaysShowLab&&!bVisibleRange)return;var isHScreen=this.Frame.IsHScreen;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();if(isHScreen){left=this.Frame.ChartBorder.GetTop();right=this.Frame.ChartBorder.GetBottom();}this.ClipFrame();//画线段
|
|
@@ -8623,9 +8625,10 @@ this.CreateChartDrawPicture=function(name,option,callback){var drawPicture=null;
|
|
|
8623
8625
|
{if(IChartDrawPicture.MapIonFont.has(name)){var iconItem=IChartDrawPicture.MapIonFont.get(name);drawPicture=new ChartDrawPictureIconFont();drawPicture.FontOption.Family=iconItem.Family;drawPicture.Text=iconItem.Text;if(iconItem.Color)drawPicture.LineColor=iconItem.Color;}}if(!drawPicture)return false;drawPicture.Canvas=this.Canvas;drawPicture.Status=0;drawPicture.Symbol=this.Symbol;drawPicture.Period=this.Period;drawPicture.Right=this.Right;drawPicture.Option=this.ChartDrawOption;drawPicture.HQChart=this;if(callback)drawPicture.FinishedCallback=callback;//完成通知上层回调
|
|
8624
8626
|
if(option)drawPicture.SetOption(option);var self=this;drawPicture.Update=function()//更新回调函数
|
|
8625
8627
|
{self.DrawDynamicInfo();};drawPicture.GetActiveDrawPicture=function(){return self.GetActiveDrawPicture();};this.CurrentChartDrawPicture=drawPicture;//JSConsole.Chart.Log("[KLineChartContainer::CreateChartDrawPicture] ", name,this.CurrentChartDrawPicture);
|
|
8626
|
-
return true;};this.AddChartDrawPicture=function(obj){if(!obj)return null;if(obj.FrameID<0||obj.FrameID>=this.Frame.SubFrame.length)return null;var self=this;var item=IChartDrawPicture.GetDrawPictureByClassName(obj.ClassName);if(!item)return null;var drawPicture=item.Create();drawPicture.Canvas=this.Canvas;drawPicture.Status=10;drawPicture.Frame=this.Frame.SubFrame[obj.FrameID].Frame;//绑定框架坐标
|
|
8628
|
+
return true;};this.AddChartDrawPicture=function(obj,option){if(!obj)return null;if(obj.FrameID<0||obj.FrameID>=this.Frame.SubFrame.length)return null;var self=this;var item=IChartDrawPicture.GetDrawPictureByClassName(obj.ClassName);if(!item)return null;var drawPicture=item.Create();drawPicture.Canvas=this.Canvas;drawPicture.Status=10;drawPicture.Frame=this.Frame.SubFrame[obj.FrameID].Frame;//绑定框架坐标
|
|
8627
8629
|
drawPicture.Symbol=this.Symbol;drawPicture.Period=this.Period;drawPicture.Right=this.Right;drawPicture.Option=this.ChartDrawOption;drawPicture.HQChart=this;if(obj.Value)drawPicture.Value=obj.Value;if(obj.Guid)drawPicture.Guid=obj.Guid;if(obj.CacheData)drawPicture.CacheData=obj.CacheData;//缓存数据
|
|
8628
|
-
if(drawPicture.ImportStorageData)drawPicture.ImportStorageData(obj);drawPicture.SetOption(obj);if(obj.EnableUpdateXValue)drawPicture.UpdateXValue();drawPicture.ValueToPoint();drawPicture.GetActiveDrawPicture=function(){return self.GetActiveDrawPicture();};if(drawPicture.ClassName==='ChartDrawPictureText')drawPicture.IsInitialized=true;this.ChartDrawPicture.push(drawPicture);
|
|
8630
|
+
if(drawPicture.ImportStorageData)drawPicture.ImportStorageData(obj);drawPicture.SetOption(obj);if(obj.EnableUpdateXValue)drawPicture.UpdateXValue();drawPicture.ValueToPoint();drawPicture.GetActiveDrawPicture=function(){return self.GetActiveDrawPicture();};if(drawPicture.ClassName==='ChartDrawPictureText')drawPicture.IsInitialized=true;this.ChartDrawPicture.push(drawPicture);if(option&&option.Save===true)//存盘
|
|
8631
|
+
{if(this.ChartDrawStorage)this.ChartDrawStorage.SaveDrawData(drawPicture);}this.DrawDynamicInfo();return drawPicture;};this.PasteChartDrawPicture=function(data,frameID,option){if(!data||!data.ClassName)return null;if(frameID<0||frameID>=this.Frame.SubFrame.length)return null;var item=IChartDrawPicture.GetDrawPictureByClassName(data.ClassName);if(!item)return null;var drawPicture=item.Create();if(!drawPicture)return null;var self=this;drawPicture.Canvas=this.Canvas;drawPicture.Status=10;drawPicture.Frame=this.Frame.SubFrame[frameID].Frame;//绑定框架坐标
|
|
8629
8632
|
drawPicture.Symbol=this.Symbol;drawPicture.Period=this.Period;drawPicture.Right=this.Right;drawPicture.Option=this.ChartDrawOption;drawPicture.GetActiveDrawPicture=function(){return self.GetActiveDrawPicture();};if(drawPicture.SetOption)drawPicture.SetOption(data);this.RandomDrawPictureValue(drawPicture,data);drawPicture.PointToValue();if(drawPicture.ClassName==='ChartDrawPictureText')drawPicture.IsInitialized=true;this.ChartDrawPicture.push(drawPicture);//存盘
|
|
8630
8633
|
if(this.ChartDrawStorage)this.ChartDrawStorage.SaveDrawData(drawPicture);this.DrawDynamicInfo();return drawPicture;};//随机生成画图的点
|
|
8631
8634
|
this.RandomDrawPictureValue=function(chart,data){if(!IFrameSplitOperator.IsNonEmptyArray(data.Value))return;var kData=this.GetKLineChart();if(!kData||!kData.Data||!IFrameSplitOperator.IsNumber(kData.Data.DataOffset)||kData.Data.DataOffset<0)return null;if(!IFrameSplitOperator.IsNonEmptyArray(kData.Data.Data))return null;var aryKData=kData.Data.Data;var startIndex=kData.Data.DataOffset;var endIndex=kData.Data.DataOffset+kData.ChartFrame.XPointCount-1;if(endIndex>=aryKData.length)endIndex=aryKData.length-1;var frameHeight=chart.Frame.ChartBorder.GetHeight();var max=chart.Frame.HorizontalMax;var min=chart.Frame.HorizontalMin;var y=chart.Frame.ChartBorder.GetBottomEx()-frameHeight*data.YFristScale;var range={Max:5,Min:2};var xRandomOffset=Math.floor(Math.random()*(range.Max-range.Min+1))+range.Min;var xValue=data.Value[0].XIndex+xRandomOffset;var firstPoint=null;chart.Value=[];for(var i=0;i<data.Value.length;++i){var item=data.Value[i];chart.Value[i]={XValue:xValue+item.XOffset};chart.Point[i]={Y:y+item.YOffset,X:chart.Frame.GetXFromIndex(xValue+item.XOffset,false)};}};//xStep,yStep 移动的偏移量
|
|
@@ -9528,8 +9531,9 @@ this.Draw();};this.CreateChartDrawPicture=function(name,option,callback){var dra
|
|
|
9528
9531
|
{if(IChartDrawPicture.MapIonFont.has(name)){var iconItem=IChartDrawPicture.MapIonFont.get(name);drawPicture=new ChartDrawPictureIconFont();drawPicture.FontOption.Family=iconItem.Family;drawPicture.Text=iconItem.Text;if(iconItem.Color)drawPicture.LineColor=iconItem.Color;}}if(!drawPicture)return false;drawPicture.Canvas=this.Canvas;drawPicture.Status=0;drawPicture.Symbol=this.Symbol;drawPicture.Period=888888888;drawPicture.Option=this.ChartDrawOption;drawPicture.HQChart=this;if(callback)drawPicture.FinishedCallback=callback;//完成通知上层回调
|
|
9529
9532
|
if(option)drawPicture.SetOption(option);var self=this;drawPicture.Update=function()//更新回调函数
|
|
9530
9533
|
{self.DrawDynamicInfo();};drawPicture.GetActiveDrawPicture=function(){return self.GetActiveDrawPicture();};this.CurrentChartDrawPicture=drawPicture;JSConsole.Chart.Log("[MinuteChartContainer::CreateChartDrawPicture] ",name,this.CurrentChartDrawPicture);return true;};//手动添加画线
|
|
9531
|
-
this.AddChartDrawPicture=function(obj){if(!obj)return null;if(obj.FrameID<0||obj.FrameID>=this.Frame.SubFrame.length)return null;var self=this;var item=IChartDrawPicture.GetDrawPictureByClassName(obj.ClassName);if(!item)return null;var drawPicture=item.Create();drawPicture.Canvas=this.Canvas;drawPicture.Status=10;drawPicture.Frame=this.Frame.SubFrame[obj.FrameID].Frame;//绑定框架坐标
|
|
9532
|
-
drawPicture.Symbol=this.Symbol;drawPicture.Period=888888888;drawPicture.HQChart=this;if(obj.Value)drawPicture.Value=obj.Value;if(obj.Guid)drawPicture.Guid=obj.Guid;if(drawPicture.ImportStorageData)drawPicture.ImportStorageData(obj);drawPicture.SetOption(obj);if(obj.EnableUpdateXValue)drawPicture.UpdateXValue();drawPicture.ValueToPoint();drawPicture.GetActiveDrawPicture=function(){return self.GetActiveDrawPicture();};this.ChartDrawPicture.push(drawPicture);if(
|
|
9534
|
+
this.AddChartDrawPicture=function(obj,option){if(!obj)return null;if(obj.FrameID<0||obj.FrameID>=this.Frame.SubFrame.length)return null;var self=this;var item=IChartDrawPicture.GetDrawPictureByClassName(obj.ClassName);if(!item)return null;var drawPicture=item.Create();drawPicture.Canvas=this.Canvas;drawPicture.Status=10;drawPicture.Frame=this.Frame.SubFrame[obj.FrameID].Frame;//绑定框架坐标
|
|
9535
|
+
drawPicture.Symbol=this.Symbol;drawPicture.Period=888888888;drawPicture.HQChart=this;if(obj.Value)drawPicture.Value=obj.Value;if(obj.Guid)drawPicture.Guid=obj.Guid;if(drawPicture.ImportStorageData)drawPicture.ImportStorageData(obj);drawPicture.SetOption(obj);if(obj.EnableUpdateXValue)drawPicture.UpdateXValue();drawPicture.ValueToPoint();drawPicture.GetActiveDrawPicture=function(){return self.GetActiveDrawPicture();};this.ChartDrawPicture.push(drawPicture);if(option&&option.Save)//存盘
|
|
9536
|
+
{if(this.ChartDrawStorage)this.ChartDrawStorage.SaveDrawData(drawPicture);}if(obj.Draw==true)this.DrawDynamicInfo();return drawPicture;};this.ReloadChartDrawPicture=function(){this.ChartDrawPicture=[];if(this.SelectChartDrawPicture)this.SelectChartDrawPicture.IsSelected=false;this.SelectChartDrawPicture=null;this.CurrentChartDrawPicture=null;this.MoveOnChartDrawPicture=null;if(this.ChartDrawStorage){this.ChartDrawStorageCache=this.ChartDrawStorage.GetDrawData({Symbol:this.Symbol,Period:888888888});}};this.CreateChartDrawPictureByStorage=function()//把缓存(this.ChartDrawStorageCache) 画图工具创建出来
|
|
9533
9537
|
{var _this43=this;if(!this.ChartDrawStorageCache||this.ChartDrawStorageCache.length<=0)return;var kData=this.GetKData();for(var i=0;i<this.ChartDrawStorageCache.length;++i){var item=this.ChartDrawStorageCache[i];if(item.FrameID<0||!this.Frame.SubFrame||this.Frame.SubFrame.length<item.FrameID)continue;var drawPicture=IChartDrawPicture.CreateChartDrawPicture(item);if(!drawPicture)continue;drawPicture.Canvas=this.Canvas;drawPicture.Status=10;drawPicture.HQChart=this;drawPicture.Frame=this.Frame.SubFrame[item.FrameID].Frame;//绑定框架坐标
|
|
9534
9538
|
if(drawPicture.ImportStorageData)drawPicture.ImportStorageData(item);drawPicture.ResetXValue();drawPicture.UpdateXValue();drawPicture.ValueToPoint();drawPicture.GetActiveDrawPicture=function(){return _this43.GetActiveDrawPicture();};this.ChartDrawPicture.push(drawPicture);}this.ChartDrawStorageCache=null;//清空缓存
|
|
9535
9539
|
};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;//根据X坐标获取数据索引
|
|
@@ -13708,12 +13712,13 @@ this.Canvas.lineWidth=pixelTatio;//手机端需要根据分辨率比调整线段
|
|
|
13708
13712
|
this.LastMouseStatus.MouseOnStatus=null;if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash){this.Frame.Draw({IsEnableSplash:this.ChartSplashPaint.IsEnableSplash});this.ChartSplashPaint.Draw();return;}this.Frame.Draw();this.Frame.DrawLogo();//框架内图形
|
|
13709
13713
|
for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(item.IsDrawFirst)item.Draw(this.LastMouseStatus);}for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(!item.IsDrawFirst)item.Draw(this.LastMouseStatus);}if(this.GlobalOption.FlashBGCount>0){this.DelayDraw(500);}};this.DelayDraw=function(frequency){var _this64=this;if(typeof this.FlashBGTimer=='number'){clearTimeout(this.FlashBGTimer);this.FlashBGTimer=null;}this.FlashBGTimer=setTimeout(function(){_this64.Draw();},frequency);};this.ResetReportStatus=function(){this.Data.XOffset=0;this.Data.YOffset=0;};this.ResetReportSelectStatus=function(){var chart=this.GetReportChart();if(chart){chart.SelectedRow=-1;chart.SelectedFixedRow=-1;chart.MultiSelectedRow=[];}};this.ClearData=function(){this.SourceData.Data=[];this.Data.Data=[];this.Data.Virtual.Count=0;this.BlockData=new _map2.default();};this.ClearMapStockData=function(){this.MapStockData=new _map2.default();};this.ResetSortStatus=function(){this.SortInfo.Field=-1;this.SortInfo.Sort=0;};this.SetSelectedRow=function(option){var reportChart=this.GetReportChart();if(!reportChart)return false;if(!reportChart.SetSelectedRow(option))return false;this.Draw();};//设置股票列表
|
|
13710
13714
|
this.SetSymbolList=function(arySymbol,option){this.ClearData();this.ResetReportStatus();this.ResetSortStatus();if(IFrameSplitOperator.IsNonEmptyArray(arySymbol)){for(var i=0;i<arySymbol.length;++i){this.Data.Data.push(arySymbol[i]);}}var chart=this.ChartPaint[0];if(chart)chart.Data=this.Data;this.Draw();};this.ChangeSymbol=function(symbol,option){var _this65=this;this.Symbol=symbol;this.ClearData();this.ResetReportStatus();this.ResetSortStatus();this.ResetReportSelectStatus();if(option){if(IFrameSplitOperator.IsNumber(option.TabSelected)){var chartTab=this.GetTabChart();if(chartTab)chartTab.SelectedTabIndex=option.TabSelected;}if(Array.isArray(option.FixedSymbol)){var chart=this.GetReportChart();if(chart){chart.FixedRowCount=0;this.FixedRowData.Type=1;this.FixedRowData.Symbol=[];var aryData=option.FixedSymbol;for(var i=0;i<aryData.length;++i){var item=aryData[i];this.FixedRowData.Symbol.push(item.Symbol);++chart.FixedRowCount;}this.SetSizeChange(true);}}if(option.SortInfo){var item=option.SortInfo;if(item.Search)this.SortInfo.Field=this.FindFiledIndex(item.Search);if(IFrameSplitOperator.IsNumber(item.Field))this.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))this.SortInfo.Sort=item.Sort;}if(IFrameSplitOperator.IsNonEmptyArray(option.Column))//字段重新设置
|
|
13711
|
-
{this.SetColumn(option.Column,{Draw:false});}if(IFrameSplitOperator.IsBool(option.IsReloadStockList)&&option.IsReloadStockList){var requestOption={Callback:null};if(this.Symbol)requestOption.Callback=function(){_this65.RequestMemberListData();};this.MapStockData=new _map2.default();this.RequestStatus.IsFinishStockList=false;this.RequestStatus.IsFinishMemberList=false;this.RequestStockListData(requestOption);return;}}this.RequestMemberListData();};//更新数据
|
|
13712
|
-
this.UpdateFullData=function(data){var arySymbol=[];if(IFrameSplitOperator.IsNonEmptyArray(data.data)){//0=证券代码 1=股票名称
|
|
13715
|
+
{this.SetColumn(option.Column,{Draw:false});}if(IFrameSplitOperator.IsBool(option.IsReloadStockList)&&option.IsReloadStockList){var requestOption={Callback:null};if(this.Symbol)requestOption.Callback=function(){_this65.RequestMemberListData();};this.MapStockData=new _map2.default();this.RequestStatus.IsFinishStockList=false;this.RequestStatus.IsFinishMemberList=false;this.RequestStockListData(requestOption);return;}}this.RequestMemberListData();};//更新数据 option={ SortInfo:{ Search:, Field:, Sort: } }
|
|
13716
|
+
this.UpdateFullData=function(data,option){var arySymbol=[];if(IFrameSplitOperator.IsNonEmptyArray(data.data)){//0=证券代码 1=股票名称
|
|
13713
13717
|
for(var i=0;i<data.data.length;++i){var item=data.data[i];var symbol=item[0];var stock=null;if(this.MapStockData.has(symbol)){stock=this.MapStockData.get(symbol);}else{stock=new HQReportItem();stock.OriginalSymbol=symbol;this.MapStockData.set(symbol,stock);}stock.Symbol=this.GetSymbolNoSuffix(symbol);stock.Name=item[1];this.ReadStockJsonData(stock,item);arySymbol.push(symbol);}}//设置显示数据
|
|
13714
|
-
this.Data.Data=[];this.SourceData.Data=[];if(IFrameSplitOperator.IsNonEmptyArray(arySymbol)){for(var i=0;i<arySymbol.length;++i){this.Data.Data.push(arySymbol[i]);this.SourceData.Data.push(arySymbol[i]);}}
|
|
13718
|
+
this.Data.Data=[];this.SourceData.Data=[];if(IFrameSplitOperator.IsNonEmptyArray(arySymbol)){for(var i=0;i<arySymbol.length;++i){this.Data.Data.push(arySymbol[i]);this.SourceData.Data.push(arySymbol[i]);}}if(option&&option.SortInfo){//本地排序
|
|
13719
|
+
var item=option.SortInfo;if(item.Search)this.SortInfo.Field=this.FindFiledIndex(item.Search);if(IFrameSplitOperator.IsNumber(item.Field))this.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))this.SortInfo.Sort=item.Sort;}//排序
|
|
13715
13720
|
var chart=this.GetReportChart();if(chart&&(this.SortInfo.Sort==1||this.SortInfo.Sort==2)&&IFrameSplitOperator.IsNumber(this.SortInfo.Field)&&this.SortInfo.Field>=0){var column=chart.Column[this.SortInfo.Field];this.LocalDataSort(column,this.SortInfo);}this.Draw();};//设置全部的数据
|
|
13716
|
-
this.SetFullData=function(data){this.ClearMapStockData();this.ClearData();this.ResetReportStatus();this.ResetSortStatus();this.ResetReportSelectStatus();this.UpdateFullData(data);/*
|
|
13721
|
+
this.SetFullData=function(data,option){this.ClearMapStockData();this.ClearData();this.ResetReportStatus();this.ResetSortStatus();this.ResetReportSelectStatus();this.UpdateFullData(data,option);/*
|
|
13717
13722
|
//缓存所有数据
|
|
13718
13723
|
var arySymbol=[];
|
|
13719
13724
|
if (IFrameSplitOperator.IsNonEmptyArray(data.data))
|
|
@@ -15629,7 +15634,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
15629
15634
|
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);};}/********************************************************************************
|
|
15630
15635
|
* 版本信息输出
|
|
15631
15636
|
*
|
|
15632
|
-
*/var HQCHART_VERSION="1.1.
|
|
15637
|
+
*/var HQCHART_VERSION="1.1.15177";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();//把给外界调用的方法暴露出来
|
|
15633
15638
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
15634
15639
|
// BaseIndex:BaseIndex,
|
|
15635
15640
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -2328,12 +2328,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
2328
2328
|
}
|
|
2329
2329
|
}
|
|
2330
2330
|
|
|
2331
|
-
this.AddChartDrawPicture=function(obj)
|
|
2331
|
+
this.AddChartDrawPicture=function(obj, option)
|
|
2332
2332
|
{
|
|
2333
2333
|
if(this.JSChartContainer && typeof(this.JSChartContainer.AddChartDrawPicture)=='function')
|
|
2334
2334
|
{
|
|
2335
2335
|
JSConsole.Chart.Log('[JSChart:AddChartDrawPicture] ', obj);
|
|
2336
|
-
return this.JSChartContainer.AddChartDrawPicture(obj);
|
|
2336
|
+
return this.JSChartContainer.AddChartDrawPicture(obj, option);
|
|
2337
2337
|
}
|
|
2338
2338
|
}
|
|
2339
2339
|
|
|
@@ -67075,6 +67075,16 @@ function ChartDrawPictureHorizontalLine()
|
|
|
67075
67075
|
}
|
|
67076
67076
|
*/
|
|
67077
67077
|
|
|
67078
|
+
//跨周期 X轴索引调整为0
|
|
67079
|
+
this.ChangePeriod=function(period)
|
|
67080
|
+
{
|
|
67081
|
+
var kData=this.GetKData();
|
|
67082
|
+
if (!kData) return;
|
|
67083
|
+
|
|
67084
|
+
var index=0;
|
|
67085
|
+
this.Value[0].XValue=0;
|
|
67086
|
+
}
|
|
67087
|
+
|
|
67078
67088
|
this.Draw=function()
|
|
67079
67089
|
{
|
|
67080
67090
|
this.LinePoint=[];
|
|
@@ -67656,6 +67666,16 @@ function ChartDrawHLine()
|
|
|
67656
67666
|
}
|
|
67657
67667
|
*/
|
|
67658
67668
|
|
|
67669
|
+
//跨周期 X轴索引调整为0
|
|
67670
|
+
this.ChangePeriod=function(period)
|
|
67671
|
+
{
|
|
67672
|
+
var kData=this.GetKData();
|
|
67673
|
+
if (!kData) return;
|
|
67674
|
+
|
|
67675
|
+
var index=0;
|
|
67676
|
+
this.Value[0].XValue=0;
|
|
67677
|
+
}
|
|
67678
|
+
|
|
67659
67679
|
this.IsDrawMain=function() //选中绘制在动态绘图上, 没有选中绘制在背景上
|
|
67660
67680
|
{
|
|
67661
67681
|
if (!this.GetActiveDrawPicture) return true;
|
|
@@ -87606,7 +87626,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
87606
87626
|
return true;
|
|
87607
87627
|
}
|
|
87608
87628
|
|
|
87609
|
-
this.AddChartDrawPicture=function(obj)
|
|
87629
|
+
this.AddChartDrawPicture=function(obj, option)
|
|
87610
87630
|
{
|
|
87611
87631
|
if (!obj) return null;
|
|
87612
87632
|
if (obj.FrameID<0 || obj.FrameID>=this.Frame.SubFrame.length) return null;
|
|
@@ -87638,6 +87658,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
87638
87658
|
if (drawPicture.ClassName==='ChartDrawPictureText') drawPicture.IsInitialized=true;
|
|
87639
87659
|
this.ChartDrawPicture.push(drawPicture);
|
|
87640
87660
|
|
|
87661
|
+
if (option && option.Save===true) //存盘
|
|
87662
|
+
{
|
|
87663
|
+
if (this.ChartDrawStorage) this.ChartDrawStorage.SaveDrawData(drawPicture);
|
|
87664
|
+
}
|
|
87665
|
+
|
|
87641
87666
|
this.DrawDynamicInfo();
|
|
87642
87667
|
|
|
87643
87668
|
return drawPicture;
|
|
@@ -96020,7 +96045,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
96020
96045
|
}
|
|
96021
96046
|
|
|
96022
96047
|
//手动添加画线
|
|
96023
|
-
this.AddChartDrawPicture=function(obj)
|
|
96048
|
+
this.AddChartDrawPicture=function(obj, option)
|
|
96024
96049
|
{
|
|
96025
96050
|
if (!obj) return null;
|
|
96026
96051
|
if (obj.FrameID<0 || obj.FrameID>=this.Frame.SubFrame.length) return null;
|
|
@@ -96049,6 +96074,11 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
96049
96074
|
|
|
96050
96075
|
this.ChartDrawPicture.push(drawPicture);
|
|
96051
96076
|
|
|
96077
|
+
if (option && option.Save) //存盘
|
|
96078
|
+
{
|
|
96079
|
+
if (this.ChartDrawStorage) this.ChartDrawStorage.SaveDrawData(drawPicture);
|
|
96080
|
+
}
|
|
96081
|
+
|
|
96052
96082
|
if (obj.Draw==true) this.DrawDynamicInfo();
|
|
96053
96083
|
|
|
96054
96084
|
return drawPicture;
|
|
@@ -1069,8 +1069,8 @@ function JSReportChartContainer(uielement)
|
|
|
1069
1069
|
this.RequestMemberListData();
|
|
1070
1070
|
}
|
|
1071
1071
|
|
|
1072
|
-
//更新数据
|
|
1073
|
-
this.UpdateFullData=function(data)
|
|
1072
|
+
//更新数据 option={ SortInfo:{ Search:, Field:, Sort: } }
|
|
1073
|
+
this.UpdateFullData=function(data, option)
|
|
1074
1074
|
{
|
|
1075
1075
|
var arySymbol=[];
|
|
1076
1076
|
if (IFrameSplitOperator.IsNonEmptyArray(data.data))
|
|
@@ -1112,6 +1112,15 @@ function JSReportChartContainer(uielement)
|
|
|
1112
1112
|
}
|
|
1113
1113
|
}
|
|
1114
1114
|
|
|
1115
|
+
if (option && option.SortInfo)
|
|
1116
|
+
{
|
|
1117
|
+
//本地排序
|
|
1118
|
+
var item=option.SortInfo;
|
|
1119
|
+
if (item.Search) this.SortInfo.Field=this.FindFiledIndex(item.Search);
|
|
1120
|
+
if (IFrameSplitOperator.IsNumber(item.Field)) this.SortInfo.Field=item.Field;
|
|
1121
|
+
if (IFrameSplitOperator.IsNumber(item.Sort)) this.SortInfo.Sort=item.Sort;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1115
1124
|
//排序
|
|
1116
1125
|
var chart=this.GetReportChart();
|
|
1117
1126
|
if (chart && (this.SortInfo.Sort==1 || this.SortInfo.Sort==2) && IFrameSplitOperator.IsNumber(this.SortInfo.Field) && this.SortInfo.Field>=0)
|
|
@@ -1124,7 +1133,7 @@ function JSReportChartContainer(uielement)
|
|
|
1124
1133
|
}
|
|
1125
1134
|
|
|
1126
1135
|
//设置全部的数据
|
|
1127
|
-
this.SetFullData=function(data)
|
|
1136
|
+
this.SetFullData=function(data, option)
|
|
1128
1137
|
{
|
|
1129
1138
|
this.ClearMapStockData();
|
|
1130
1139
|
this.ClearData();
|
|
@@ -1132,7 +1141,7 @@ function JSReportChartContainer(uielement)
|
|
|
1132
1141
|
this.ResetSortStatus();
|
|
1133
1142
|
this.ResetReportSelectStatus();
|
|
1134
1143
|
|
|
1135
|
-
this.UpdateFullData(data);
|
|
1144
|
+
this.UpdateFullData(data, option);
|
|
1136
1145
|
|
|
1137
1146
|
/*
|
|
1138
1147
|
//缓存所有数据
|
|
@@ -6424,12 +6424,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
6424
6424
|
}
|
|
6425
6425
|
}
|
|
6426
6426
|
|
|
6427
|
-
this.AddChartDrawPicture=function(obj)
|
|
6427
|
+
this.AddChartDrawPicture=function(obj, option)
|
|
6428
6428
|
{
|
|
6429
6429
|
if(this.JSChartContainer && typeof(this.JSChartContainer.AddChartDrawPicture)=='function')
|
|
6430
6430
|
{
|
|
6431
6431
|
JSConsole.Chart.Log('[JSChart:AddChartDrawPicture] ', obj);
|
|
6432
|
-
return this.JSChartContainer.AddChartDrawPicture(obj);
|
|
6432
|
+
return this.JSChartContainer.AddChartDrawPicture(obj, option);
|
|
6433
6433
|
}
|
|
6434
6434
|
}
|
|
6435
6435
|
|
|
@@ -71171,6 +71171,16 @@ function ChartDrawPictureHorizontalLine()
|
|
|
71171
71171
|
}
|
|
71172
71172
|
*/
|
|
71173
71173
|
|
|
71174
|
+
//跨周期 X轴索引调整为0
|
|
71175
|
+
this.ChangePeriod=function(period)
|
|
71176
|
+
{
|
|
71177
|
+
var kData=this.GetKData();
|
|
71178
|
+
if (!kData) return;
|
|
71179
|
+
|
|
71180
|
+
var index=0;
|
|
71181
|
+
this.Value[0].XValue=0;
|
|
71182
|
+
}
|
|
71183
|
+
|
|
71174
71184
|
this.Draw=function()
|
|
71175
71185
|
{
|
|
71176
71186
|
this.LinePoint=[];
|
|
@@ -71752,6 +71762,16 @@ function ChartDrawHLine()
|
|
|
71752
71762
|
}
|
|
71753
71763
|
*/
|
|
71754
71764
|
|
|
71765
|
+
//跨周期 X轴索引调整为0
|
|
71766
|
+
this.ChangePeriod=function(period)
|
|
71767
|
+
{
|
|
71768
|
+
var kData=this.GetKData();
|
|
71769
|
+
if (!kData) return;
|
|
71770
|
+
|
|
71771
|
+
var index=0;
|
|
71772
|
+
this.Value[0].XValue=0;
|
|
71773
|
+
}
|
|
71774
|
+
|
|
71755
71775
|
this.IsDrawMain=function() //选中绘制在动态绘图上, 没有选中绘制在背景上
|
|
71756
71776
|
{
|
|
71757
71777
|
if (!this.GetActiveDrawPicture) return true;
|
|
@@ -91702,7 +91722,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
91702
91722
|
return true;
|
|
91703
91723
|
}
|
|
91704
91724
|
|
|
91705
|
-
this.AddChartDrawPicture=function(obj)
|
|
91725
|
+
this.AddChartDrawPicture=function(obj, option)
|
|
91706
91726
|
{
|
|
91707
91727
|
if (!obj) return null;
|
|
91708
91728
|
if (obj.FrameID<0 || obj.FrameID>=this.Frame.SubFrame.length) return null;
|
|
@@ -91734,6 +91754,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
91734
91754
|
if (drawPicture.ClassName==='ChartDrawPictureText') drawPicture.IsInitialized=true;
|
|
91735
91755
|
this.ChartDrawPicture.push(drawPicture);
|
|
91736
91756
|
|
|
91757
|
+
if (option && option.Save===true) //存盘
|
|
91758
|
+
{
|
|
91759
|
+
if (this.ChartDrawStorage) this.ChartDrawStorage.SaveDrawData(drawPicture);
|
|
91760
|
+
}
|
|
91761
|
+
|
|
91737
91762
|
this.DrawDynamicInfo();
|
|
91738
91763
|
|
|
91739
91764
|
return drawPicture;
|
|
@@ -100116,7 +100141,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
100116
100141
|
}
|
|
100117
100142
|
|
|
100118
100143
|
//手动添加画线
|
|
100119
|
-
this.AddChartDrawPicture=function(obj)
|
|
100144
|
+
this.AddChartDrawPicture=function(obj, option)
|
|
100120
100145
|
{
|
|
100121
100146
|
if (!obj) return null;
|
|
100122
100147
|
if (obj.FrameID<0 || obj.FrameID>=this.Frame.SubFrame.length) return null;
|
|
@@ -100145,6 +100170,11 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
100145
100170
|
|
|
100146
100171
|
this.ChartDrawPicture.push(drawPicture);
|
|
100147
100172
|
|
|
100173
|
+
if (option && option.Save) //存盘
|
|
100174
|
+
{
|
|
100175
|
+
if (this.ChartDrawStorage) this.ChartDrawStorage.SaveDrawData(drawPicture);
|
|
100176
|
+
}
|
|
100177
|
+
|
|
100148
100178
|
if (obj.Draw==true) this.DrawDynamicInfo();
|
|
100149
100179
|
|
|
100150
100180
|
return drawPicture;
|
|
@@ -141365,8 +141395,8 @@ function JSReportChartContainer(uielement)
|
|
|
141365
141395
|
this.RequestMemberListData();
|
|
141366
141396
|
}
|
|
141367
141397
|
|
|
141368
|
-
//更新数据
|
|
141369
|
-
this.UpdateFullData=function(data)
|
|
141398
|
+
//更新数据 option={ SortInfo:{ Search:, Field:, Sort: } }
|
|
141399
|
+
this.UpdateFullData=function(data, option)
|
|
141370
141400
|
{
|
|
141371
141401
|
var arySymbol=[];
|
|
141372
141402
|
if (IFrameSplitOperator.IsNonEmptyArray(data.data))
|
|
@@ -141408,6 +141438,15 @@ function JSReportChartContainer(uielement)
|
|
|
141408
141438
|
}
|
|
141409
141439
|
}
|
|
141410
141440
|
|
|
141441
|
+
if (option && option.SortInfo)
|
|
141442
|
+
{
|
|
141443
|
+
//本地排序
|
|
141444
|
+
var item=option.SortInfo;
|
|
141445
|
+
if (item.Search) this.SortInfo.Field=this.FindFiledIndex(item.Search);
|
|
141446
|
+
if (IFrameSplitOperator.IsNumber(item.Field)) this.SortInfo.Field=item.Field;
|
|
141447
|
+
if (IFrameSplitOperator.IsNumber(item.Sort)) this.SortInfo.Sort=item.Sort;
|
|
141448
|
+
}
|
|
141449
|
+
|
|
141411
141450
|
//排序
|
|
141412
141451
|
var chart=this.GetReportChart();
|
|
141413
141452
|
if (chart && (this.SortInfo.Sort==1 || this.SortInfo.Sort==2) && IFrameSplitOperator.IsNumber(this.SortInfo.Field) && this.SortInfo.Field>=0)
|
|
@@ -141420,7 +141459,7 @@ function JSReportChartContainer(uielement)
|
|
|
141420
141459
|
}
|
|
141421
141460
|
|
|
141422
141461
|
//设置全部的数据
|
|
141423
|
-
this.SetFullData=function(data)
|
|
141462
|
+
this.SetFullData=function(data, option)
|
|
141424
141463
|
{
|
|
141425
141464
|
this.ClearMapStockData();
|
|
141426
141465
|
this.ClearData();
|
|
@@ -141428,7 +141467,7 @@ function JSReportChartContainer(uielement)
|
|
|
141428
141467
|
this.ResetSortStatus();
|
|
141429
141468
|
this.ResetReportSelectStatus();
|
|
141430
141469
|
|
|
141431
|
-
this.UpdateFullData(data);
|
|
141470
|
+
this.UpdateFullData(data, option);
|
|
141432
141471
|
|
|
141433
141472
|
/*
|
|
141434
141473
|
//缓存所有数据
|
|
@@ -154100,7 +154139,7 @@ function ScrollBarBGChart()
|
|
|
154100
154139
|
|
|
154101
154140
|
|
|
154102
154141
|
|
|
154103
|
-
var HQCHART_VERSION="1.1.
|
|
154142
|
+
var HQCHART_VERSION="1.1.15177";
|
|
154104
154143
|
|
|
154105
154144
|
function PrintHQChartVersion()
|
|
154106
154145
|
{
|
|
@@ -6468,12 +6468,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
6468
6468
|
}
|
|
6469
6469
|
}
|
|
6470
6470
|
|
|
6471
|
-
this.AddChartDrawPicture=function(obj)
|
|
6471
|
+
this.AddChartDrawPicture=function(obj, option)
|
|
6472
6472
|
{
|
|
6473
6473
|
if(this.JSChartContainer && typeof(this.JSChartContainer.AddChartDrawPicture)=='function')
|
|
6474
6474
|
{
|
|
6475
6475
|
JSConsole.Chart.Log('[JSChart:AddChartDrawPicture] ', obj);
|
|
6476
|
-
return this.JSChartContainer.AddChartDrawPicture(obj);
|
|
6476
|
+
return this.JSChartContainer.AddChartDrawPicture(obj, option);
|
|
6477
6477
|
}
|
|
6478
6478
|
}
|
|
6479
6479
|
|
|
@@ -71215,6 +71215,16 @@ function ChartDrawPictureHorizontalLine()
|
|
|
71215
71215
|
}
|
|
71216
71216
|
*/
|
|
71217
71217
|
|
|
71218
|
+
//跨周期 X轴索引调整为0
|
|
71219
|
+
this.ChangePeriod=function(period)
|
|
71220
|
+
{
|
|
71221
|
+
var kData=this.GetKData();
|
|
71222
|
+
if (!kData) return;
|
|
71223
|
+
|
|
71224
|
+
var index=0;
|
|
71225
|
+
this.Value[0].XValue=0;
|
|
71226
|
+
}
|
|
71227
|
+
|
|
71218
71228
|
this.Draw=function()
|
|
71219
71229
|
{
|
|
71220
71230
|
this.LinePoint=[];
|
|
@@ -71796,6 +71806,16 @@ function ChartDrawHLine()
|
|
|
71796
71806
|
}
|
|
71797
71807
|
*/
|
|
71798
71808
|
|
|
71809
|
+
//跨周期 X轴索引调整为0
|
|
71810
|
+
this.ChangePeriod=function(period)
|
|
71811
|
+
{
|
|
71812
|
+
var kData=this.GetKData();
|
|
71813
|
+
if (!kData) return;
|
|
71814
|
+
|
|
71815
|
+
var index=0;
|
|
71816
|
+
this.Value[0].XValue=0;
|
|
71817
|
+
}
|
|
71818
|
+
|
|
71799
71819
|
this.IsDrawMain=function() //选中绘制在动态绘图上, 没有选中绘制在背景上
|
|
71800
71820
|
{
|
|
71801
71821
|
if (!this.GetActiveDrawPicture) return true;
|
|
@@ -91746,7 +91766,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
91746
91766
|
return true;
|
|
91747
91767
|
}
|
|
91748
91768
|
|
|
91749
|
-
this.AddChartDrawPicture=function(obj)
|
|
91769
|
+
this.AddChartDrawPicture=function(obj, option)
|
|
91750
91770
|
{
|
|
91751
91771
|
if (!obj) return null;
|
|
91752
91772
|
if (obj.FrameID<0 || obj.FrameID>=this.Frame.SubFrame.length) return null;
|
|
@@ -91778,6 +91798,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
91778
91798
|
if (drawPicture.ClassName==='ChartDrawPictureText') drawPicture.IsInitialized=true;
|
|
91779
91799
|
this.ChartDrawPicture.push(drawPicture);
|
|
91780
91800
|
|
|
91801
|
+
if (option && option.Save===true) //存盘
|
|
91802
|
+
{
|
|
91803
|
+
if (this.ChartDrawStorage) this.ChartDrawStorage.SaveDrawData(drawPicture);
|
|
91804
|
+
}
|
|
91805
|
+
|
|
91781
91806
|
this.DrawDynamicInfo();
|
|
91782
91807
|
|
|
91783
91808
|
return drawPicture;
|
|
@@ -100160,7 +100185,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
100160
100185
|
}
|
|
100161
100186
|
|
|
100162
100187
|
//手动添加画线
|
|
100163
|
-
this.AddChartDrawPicture=function(obj)
|
|
100188
|
+
this.AddChartDrawPicture=function(obj, option)
|
|
100164
100189
|
{
|
|
100165
100190
|
if (!obj) return null;
|
|
100166
100191
|
if (obj.FrameID<0 || obj.FrameID>=this.Frame.SubFrame.length) return null;
|
|
@@ -100189,6 +100214,11 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
100189
100214
|
|
|
100190
100215
|
this.ChartDrawPicture.push(drawPicture);
|
|
100191
100216
|
|
|
100217
|
+
if (option && option.Save) //存盘
|
|
100218
|
+
{
|
|
100219
|
+
if (this.ChartDrawStorage) this.ChartDrawStorage.SaveDrawData(drawPicture);
|
|
100220
|
+
}
|
|
100221
|
+
|
|
100192
100222
|
if (obj.Draw==true) this.DrawDynamicInfo();
|
|
100193
100223
|
|
|
100194
100224
|
return drawPicture;
|
|
@@ -141409,8 +141439,8 @@ function JSReportChartContainer(uielement)
|
|
|
141409
141439
|
this.RequestMemberListData();
|
|
141410
141440
|
}
|
|
141411
141441
|
|
|
141412
|
-
//更新数据
|
|
141413
|
-
this.UpdateFullData=function(data)
|
|
141442
|
+
//更新数据 option={ SortInfo:{ Search:, Field:, Sort: } }
|
|
141443
|
+
this.UpdateFullData=function(data, option)
|
|
141414
141444
|
{
|
|
141415
141445
|
var arySymbol=[];
|
|
141416
141446
|
if (IFrameSplitOperator.IsNonEmptyArray(data.data))
|
|
@@ -141452,6 +141482,15 @@ function JSReportChartContainer(uielement)
|
|
|
141452
141482
|
}
|
|
141453
141483
|
}
|
|
141454
141484
|
|
|
141485
|
+
if (option && option.SortInfo)
|
|
141486
|
+
{
|
|
141487
|
+
//本地排序
|
|
141488
|
+
var item=option.SortInfo;
|
|
141489
|
+
if (item.Search) this.SortInfo.Field=this.FindFiledIndex(item.Search);
|
|
141490
|
+
if (IFrameSplitOperator.IsNumber(item.Field)) this.SortInfo.Field=item.Field;
|
|
141491
|
+
if (IFrameSplitOperator.IsNumber(item.Sort)) this.SortInfo.Sort=item.Sort;
|
|
141492
|
+
}
|
|
141493
|
+
|
|
141455
141494
|
//排序
|
|
141456
141495
|
var chart=this.GetReportChart();
|
|
141457
141496
|
if (chart && (this.SortInfo.Sort==1 || this.SortInfo.Sort==2) && IFrameSplitOperator.IsNumber(this.SortInfo.Field) && this.SortInfo.Field>=0)
|
|
@@ -141464,7 +141503,7 @@ function JSReportChartContainer(uielement)
|
|
|
141464
141503
|
}
|
|
141465
141504
|
|
|
141466
141505
|
//设置全部的数据
|
|
141467
|
-
this.SetFullData=function(data)
|
|
141506
|
+
this.SetFullData=function(data, option)
|
|
141468
141507
|
{
|
|
141469
141508
|
this.ClearMapStockData();
|
|
141470
141509
|
this.ClearData();
|
|
@@ -141472,7 +141511,7 @@ function JSReportChartContainer(uielement)
|
|
|
141472
141511
|
this.ResetSortStatus();
|
|
141473
141512
|
this.ResetReportSelectStatus();
|
|
141474
141513
|
|
|
141475
|
-
this.UpdateFullData(data);
|
|
141514
|
+
this.UpdateFullData(data, option);
|
|
141476
141515
|
|
|
141477
141516
|
/*
|
|
141478
141517
|
//缓存所有数据
|
|
@@ -166113,7 +166152,7 @@ function HQChartScriptWorker()
|
|
|
166113
166152
|
|
|
166114
166153
|
|
|
166115
166154
|
|
|
166116
|
-
var HQCHART_VERSION="1.1.
|
|
166155
|
+
var HQCHART_VERSION="1.1.15177";
|
|
166117
166156
|
|
|
166118
166157
|
function PrintHQChartVersion()
|
|
166119
166158
|
{
|