hqchart 1.1.13983 → 1.1.13991

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.
@@ -6374,7 +6374,7 @@ JSChart.GetScrollPosition=function()
6374
6374
 
6375
6375
  var JSCHART_EVENT_ID=
6376
6376
  {
6377
- RECV_KLINE_MATCH:1, //接收到形态匹配
6377
+ //RECV_KLINE_MATCH:1, //接收到形态匹配
6378
6378
  RECV_INDEX_DATA:2, //接收指标数据
6379
6379
  RECV_HISTROY_DATA:3,//接收到历史数据
6380
6380
  RECV_TRAIN_MOVE_STEP:4, //接收K线训练,移动一次K线
@@ -73135,13 +73135,19 @@ function JSChartResource()
73135
73135
  this.DialogTooltip=
73136
73136
  {
73137
73137
  BGColor:'rgb(250,250,250)', //背景色
73138
- BorderColor:'rgb(20,20,20)', //边框颜色
73139
- TitleColor:'rgb(0,0,0)', //标题颜色
73138
+ BorderColor:'rgb(20,20,20)', //边框颜色
73139
+ TitleColor:'rgb(250,250,250)', //标题颜色
73140
+ TitleBGColor:"rgb(200, 66, 69)", //标题背景颜色
73140
73141
  VolColor:"rgb(255, 185, 15)", //标题成交量
73141
73142
  AmountColor:"rgb(79, 79, 79)", //成交金额
73142
73143
  DateTimeColor:'rgb(60,60,60)',
73143
73144
  TurnoverRateColor:'rgb(43,54,69)', //换手率
73144
- PositionColor:"rgb(255,0,255)" //持仓
73145
+ PositionColor:"rgb(255,0,255)", //持仓
73146
+
73147
+ TextColor:"rgb(0,0,0)", //数值名称
73148
+ ValueColor:"rgb(0,0,0)", //数值
73149
+
73150
+
73145
73151
  },
73146
73152
 
73147
73153
  //区间统计
@@ -74157,6 +74163,7 @@ function JSChartResource()
74157
74163
  if (item.BGColor) this.DialogTooltip.BGColor=item.BGColor;
74158
74164
  if (item.BorderColor) this.DialogTooltip.BorderColor=item.BorderColor;
74159
74165
  if (item.TitleColor) this.DialogTooltip.TitleColor=item.TitleColor;
74166
+ if (item.TitleBGColor) this.DialogTooltip.TitleBGColor=item.TitleBGColor;
74160
74167
  if (item.DateTimeColor) this.DialogTooltip.DateTimeColor=item.DateTimeColor;
74161
74168
 
74162
74169
  if (item.VolColor) this.DialogTooltip.VolColor=item.VolColor;
@@ -74164,6 +74171,8 @@ function JSChartResource()
74164
74171
  if (item.TurnoverRateColor) this.DialogTooltip.TurnoverRateColor=item.TurnoverRateColor;
74165
74172
  if (item.PositionColor) this.DialogTooltip.PositionColor=item.PositionColor;
74166
74173
 
74174
+ if (item.TextColor) this.DialogTooltip.TextColor=item.TextColor;
74175
+ if (item.ValueColor) this.DialogTooltip.ValueColor=item.ValueColor;
74167
74176
  }
74168
74177
 
74169
74178
  if (style.DialogSelectRect)
@@ -82015,101 +82024,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82015
82024
  this.ChartDrawStorageCache=null; //清空缓存
82016
82025
  }
82017
82026
 
82018
- //形态匹配
82019
- // scope.Plate 板块范围 scope.Symbol 股票范围
82020
- // sample 样本数据
82021
- this.RequestKLineMatch=function(sample,param)
82022
- {
82023
- var self =this;
82024
- var scope=param.Scope;
82025
- var waitDailog=param.WaitDialog;
82026
- JSConsole.Chart.Log('[KLineChartContainer::RequestKLineMatch',sample,scope)
82027
-
82028
- var aryDate=new Array();
82029
- var aryValue=new Array();
82030
-
82031
- for(var i=sample.Start;i<sample.End && i<sample.Data.Data.length;++i)
82032
- {
82033
- var item=sample.Data.Data[i];
82034
- aryDate.push(item.Date);
82035
- aryValue.push(item.Close);
82036
- }
82037
-
82038
- var sampleData=
82039
- {
82040
- Stock:sample.Stock,
82041
- Index:{Start:sample.Start, End:sample.End}, //数据索引
82042
- Date:{Start:aryDate[0], End:aryDate[aryDate.length-1]}, //起始 结束日期
82043
- Minsimilar:scope.Minsimilar, //相似度
82044
- Plate:scope.Plate,
82045
- DayRegion:300
82046
- };
82047
-
82048
- //请求数据
82049
- $.ajax({
82050
- url: this.KLineMatchUrl,
82051
- data:
82052
- {
82053
- "userid": "guest",
82054
- "plate": scope.Plate,
82055
- "period": this.Period,
82056
- "right": this.Right,
82057
- "dayregion": sampleData.DayRegion,
82058
- "minsimilar": scope.Minsimilar,
82059
- "sampledate":aryDate,
82060
- "samplevalue":aryValue
82061
- },
82062
- type:"post",
82063
- dataType: "json",
82064
- async:true,
82065
- success: function (data)
82066
- {
82067
- if (waitDailog) waitDailog.Close();
82068
- self.RecvKLineMatchData(data,sampleData);
82069
- },
82070
- error:function(jqXHR, textStatus, errorThrown)
82071
- {
82072
- console.warn('[KLineChartContainer::RequestKLineMatch] failed',jqXHR,textStatus, errorThrown);
82073
- if (waitDailog) waitDailog.Close();
82074
- }
82075
- });
82076
- }
82077
-
82078
- //接收形态选股结果
82079
- this.RecvKLineMatchData=function(data,sample)
82080
- {
82081
- JSConsole.Chart.Log('[KLineChartContainer::RecvKLineMatchData] recv',data,sample);
82082
- var filterData=[]; //结果数据
82083
- for(var i in data.match)
82084
- {
82085
- var item=data.match[i];
82086
- if (item.symbol==sample.Stock.Symbol) continue;
82087
-
82088
- for(var j in item.data)
82089
- {
82090
- var dataItem=item.data[j];
82091
- var newItem={Symbol:item.symbol, Name:item.name,Similar:dataItem.similar, Start:dataItem.start, End:dataItem.end};
82092
- filterData.push(newItem);
82093
- }
82094
- }
82095
- filterData.sort(function(a,b){return b.Similar-a.Similar;}); //排序
82096
- JSConsole.Chart.Log('[KLineChartContainer::RecvKLineMatchData] filterData',filterData);
82097
-
82098
- if (this.mapEvent.has(JSCHART_EVENT_ID.RECV_KLINE_MATCH))
82099
- {
82100
- var item=this.mapEvent.get(JSCHART_EVENT_ID.RECV_KLINE_MATCH);
82101
- var data={Sample:sample, Match:filterData, Source:data}
82102
- item.Callback(item,data,this);
82103
- }
82104
- else
82105
- {
82106
- var dlg=new KLineMatchDialog(this.Frame.ChartBorder.UIElement.parentNode);
82107
-
82108
- var event={ data:{ Chart:this, MatchData:filterData, Sample:sample, Source:data} };
82109
- dlg.DoModal(event);
82110
- }
82111
- }
82112
-
82113
82027
  //更新信息地雷
82114
82028
  this.UpdataChartInfo=function()
82115
82029
  {
@@ -94638,235 +94552,6 @@ function ChangeIndexDialog(divElement)
94638
94552
  }
94639
94553
  }
94640
94554
 
94641
- //形态选股
94642
- function KLineMatchDialog(divElement)
94643
- {
94644
- this.newMethod=IDivDialog; //派生
94645
- this.newMethod(divElement);
94646
- delete this.newMethod;
94647
-
94648
- this.MatchData; //匹配的股票数据
94649
- this.Sample; //样本数据
94650
- this.Dialog;
94651
- this.HQChart;
94652
-
94653
- this.PageData; //分页数据
94654
-
94655
- //隐藏窗口
94656
- this.Close=function()
94657
- {
94658
- this.DivElement.removeChild(this.Dialog);
94659
- }
94660
-
94661
- //创建
94662
- this.Create=function()
94663
- {
94664
- this.ID=Guid();
94665
- var div=document.createElement('div');
94666
- div.className='jchart-kline-match-box';
94667
- div.id=this.ID;
94668
- div.innerHTML=
94669
- `<div class='parameter jchart-kline-match-box'>
94670
- <div class='parameter-header'>
94671
- <span>形态匹配</span>
94672
- <strong id='close' class='icon iconfont icon-close'></strong>
94673
- </div>
94674
- <div class='parameter-content'>
94675
- <p class='dataCount'></p>
94676
- <table class='matchTable'>
94677
- <thead>
94678
- <tr>
94679
- <td>股票名称</td>
94680
- <td>匹配度</td>
94681
- <td>时间段</td>
94682
- </tr>
94683
- </thead>
94684
- <tbody>
94685
- </tbody>
94686
- </table>
94687
- <div class='pagination' data-current='1'></div>
94688
- </div>
94689
- <div class='parameter-footer'>
94690
- <button id='close' class='submit' >确定</button>
94691
- </div>
94692
- </div>`.trim();
94693
-
94694
- this.DivElement.appendChild(div);
94695
- this.Dialog=div;
94696
-
94697
- //关闭按钮
94698
- $("#"+this.ID+" #close").click(
94699
- {
94700
- divBox:this,
94701
- },
94702
- function(event)
94703
- {
94704
- event.data.divBox.Close();
94705
- });
94706
- }
94707
-
94708
- this.BindData=function()
94709
- {
94710
- JSConsole.Chart.Log(`[KLineMatchDialog::BindData] 形态源: ${this.Sample.Stock.Name} 区间:${this.Sample.Date.Start} - ${this.Sample.Date.End}`);
94711
- var count = this.MatchData.length + 1;
94712
- var pageData = {NewData:{},MetaData:[],PageCount:0,Count:count};
94713
- var pageCount = 0;
94714
- var paginationHtml = '';
94715
-
94716
- $('#'+this.ID+' .dataCount').html('个数:'+count);
94717
-
94718
- for(let i = 0; i < count ; i++){
94719
- var dataObj = {};
94720
- if(i == 0){
94721
- dataObj = {
94722
- Symbol:this.Sample.Stock.Symbol,
94723
- Name:this.Sample.Stock.Name,
94724
- Rate:'形态源',
94725
- Color:'red',
94726
- Date:`${this.Sample.Date.Start}-${this.Sample.Date.End}`
94727
- };
94728
- }else{
94729
- let dataItem = this.MatchData[i - 1];
94730
- dataObj = {
94731
- Symbol:dataItem.Symbol,
94732
- Name:dataItem.Name,
94733
- Rate:Number(dataItem.Similar * 100).toFixed(2),
94734
- Color:'',
94735
- Date:`${dataItem.Start}-${dataItem.End}`
94736
- };
94737
- }
94738
- pageData.MetaData.push(dataObj);
94739
- }
94740
-
94741
- if(pageData.Count % 10 == 0){
94742
- pageCount = pageData.Count / 10;
94743
- }else{
94744
- pageCount = Math.floor(pageData.Count / 10) + 1;
94745
- }
94746
- pageData.PageCount = pageCount;
94747
-
94748
- this.PaginationMetaData(pageData);
94749
- this.PageData = pageData;
94750
- JSConsole.Chart.Log('[KLineMatchDialog::DoModal pageData]',pageData);
94751
-
94752
- this.RenderDom(1);
94753
-
94754
- this.PaginationInit('#'+this.ID,pageData.PageCount,this.paginationCallback);
94755
- // $('#' + this.ID + ' .pagination').html(paginationHtml);
94756
-
94757
-
94758
- }
94759
- this.RenderDom = function(page){
94760
- let currentPageData = this.PageData.NewData[page];
94761
- JSConsole.Chart.Log('[KLineMatchDialog::RenderDom currentPageData]',currentPageData);
94762
- let bodyHtml = '';
94763
- for(let i = 0; i < currentPageData.length; i++){
94764
- bodyHtml += `<tr>
94765
- <td class=${currentPageData[i].Color}>${currentPageData[i].Name}</td>
94766
- <td class=${currentPageData[i].Color}>${currentPageData[i].Rate}</td>
94767
- <td class=${currentPageData[i].Color}>${currentPageData[i].Date}</td>
94768
- </tr>`.trim();
94769
- }
94770
-
94771
- $('#'+this.ID + ' .matchTable tbody').html(bodyHtml)
94772
- }
94773
- var _this = this;
94774
- this.paginationCallback = function(page) {
94775
- _this.RenderDom(page);
94776
- _this.PaginationInit('#'+_this.ID,_this.PageData.PageCount,_this.paginationCallback); //更新UI
94777
- }
94778
- this.PaginationInit = function(id, maxPageNum, callback) { //初始化分页
94779
- var spanStr = "";
94780
- var currentPageNum = $(id + " .pagination").data("current");
94781
- var lastPageNum = 0;
94782
- var showCountPage = 5; //只显示5个数字项
94783
-
94784
- if (currentPageNum < showCountPage) { //当前页小于预显示页数
94785
- if (maxPageNum >= showCountPage) {
94786
- for (var j = 0; j < showCountPage; j++) { //上 1 2 3 4 5 下
94787
- spanStr += (j + 1) != currentPageNum ? "<span>" + (j + 1) + "</span>" : "<span class='active'>" + (j + 1) + "</span>";
94788
- }
94789
- } else {
94790
- for (var j = 0; j < maxPageNum; j++) { //上 1 2 3 4 5 下
94791
- spanStr += (j + 1) != currentPageNum ? "<span>" + (j + 1) + "</span>" : "<span class='active'>" + (j + 1) + "</span>";
94792
- }
94793
- }
94794
- } else { //大于5时,最终页数是当前页数加1
94795
- lastPageNum = (currentPageNum + 1) > maxPageNum ? currentPageNum : (currentPageNum + 1);
94796
-
94797
- for (var i = currentPageNum - 3; i <= lastPageNum; i++) { //含最终项之前的五项
94798
- spanStr += i != currentPageNum ? "<span>" + i + "</span>" : "<span class='active'>" + i + "</span>";
94799
- }
94800
- }
94801
-
94802
- spanStr = "<span class='beforePage'>上一页</span>" + spanStr + "<span class='nextPage'>下一页</span>";
94803
- $(id + " .pagination").html(spanStr);
94804
- $(id + " .pagination span").bind('click', { "maxpage": maxPageNum, "Callback": callback }, this.PaginationCurrentIndex);
94805
- // return spanStr;
94806
- }
94807
-
94808
- this.PaginationCurrentIndex = function(event) { //分页切换
94809
- var text = $(this).text();
94810
- JSConsole.Chart.Log('[::PaginationCurrentIndex text]',text);
94811
- var currentPageNum = Number($(this).parent().data("current"));
94812
- var maxPageNum = event.data.maxpage;
94813
- var callback = event.data.Callback;
94814
- var flag = 1;
94815
- if (text === "上一页") {
94816
- flag = currentPageNum === 1 ? currentPageNum : currentPageNum - 1;
94817
- } else if (text === "下一页") {
94818
- flag = currentPageNum === maxPageNum ? currentPageNum : currentPageNum + 1;
94819
- } else {
94820
- flag = Number(text);
94821
- }
94822
- $(this).parent().data("current", flag); //将当前页存到dom上
94823
- callback(flag);
94824
- }
94825
-
94826
- this.PaginationMetaData = function(data){ //假分页数据,每页10条数据
94827
- // data = {NewData:{},MetaData:[],PageCount:0,Callback:null};
94828
- var newData = {};
94829
- var metaData = data.MetaData;
94830
- var pageCount = data.PageCount;
94831
-
94832
- for(let i = 0; i < pageCount; i++){
94833
- var itemArr = [];
94834
- for(let j = 0; j < 10; j++){
94835
- var itemIndex = 10*i + j;
94836
- if(itemIndex <= metaData.length - 1){
94837
- var item = metaData[itemIndex];
94838
- itemArr.push(item);
94839
- }else {
94840
- break;
94841
- }
94842
- }
94843
- newData[i+1] = itemArr;
94844
- }
94845
- data.NewData = newData;
94846
- }
94847
-
94848
- //显示
94849
- this.DoModal=function(event)
94850
- {
94851
- var chart=event.data.Chart;
94852
- if (this.ID==null) this.Create(); //第1次 需要创建div
94853
- this.MatchData=event.data.MatchData;
94854
- this.Sample=event.data.Sample;
94855
- this.HQChart=chart;
94856
-
94857
- this.BindData();
94858
-
94859
-
94860
- //居中显示
94861
- var border=chart.Frame.ChartBorder;
94862
- var scrollPos=GetScrollPosition();
94863
- var left=border.GetWidth()/2;
94864
- var top=border.GetHeight()/2;
94865
-
94866
- this.Show(left,top,200,200); //显示
94867
- }
94868
- }
94869
-
94870
94555
  //等待动画窗口
94871
94556
  function WaitDialog(divElement)
94872
94557
  {
@@ -125363,12 +125048,17 @@ function GetBlackStyle()
125363
125048
  {
125364
125049
  BGColor:'rgb(20,20,20)', //背景色
125365
125050
  BorderColor:'rgb(170,170,170)', //边框颜色
125366
- TitleColor:'rgb(210,210,210)', //标题颜色
125051
+ TitleColor:'rgb(250,250,250)', //标题颜色
125367
125052
  VolColor:"rgb(255, 185, 15)", //标题成交量
125368
125053
  AmountColor:"rgb(210,210,210)", //成交金额
125369
125054
  DateTimeColor:'rgb(210,210,210)',
125370
125055
  TurnoverRateColor:'rgb(43,54,69)', //换手率
125371
- PositionColor:"rgb(255,0,255)" //持仓
125056
+ PositionColor:"rgb(255,0,255)", //持仓
125057
+
125058
+ TextColor:"rgb(210,210,210)", //数值名称
125059
+ ValueColor:"rgb(210,210,210)", //数值
125060
+
125061
+ TitleBGColor:"rgb(200, 66, 69)",
125372
125062
  },
125373
125063
 
125374
125064
  DialogSelectRect:
@@ -128553,7 +128243,7 @@ function JSReportChartContainer(uielement)
128553
128243
  {
128554
128244
  Name:'JSDealChartContainer::RequestStockData', //类名::函数名
128555
128245
  Explain:'报价列表股票数据',
128556
- Request:{ Data: { stocks: arySymbol } },
128246
+ Request:{ Data: { stocks: arySymbol } , symbol:this.Symbol, name:this.Name },
128557
128247
  Self:this,
128558
128248
  PreventDefault:false
128559
128249
  };
@@ -139071,7 +138761,7 @@ function ScrollBarBGChart()
139071
138761
 
139072
138762
 
139073
138763
 
139074
- var HQCHART_VERSION="1.1.13982";
138764
+ var HQCHART_VERSION="1.1.13990";
139075
138765
 
139076
138766
  function PrintHQChartVersion()
139077
138767
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13982";
8
+ var HQCHART_VERSION="1.1.13990";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {