hqchart 1.1.13672 → 1.1.13682

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.
@@ -72171,6 +72171,16 @@ function JSChartResource()
72171
72171
  NameFont:{ Size:14, Name:"微软雅黑" },
72172
72172
  SymbolFont:{ Size:12, Name:"微软雅黑" }
72173
72173
  },
72174
+
72175
+ VScrollbar:
72176
+ {
72177
+ ScrollBarHeight:50,
72178
+ ButtonColor:"rgba(252,252,252,0.8)",
72179
+ BarColor:"rgba(168,168,168,0.9)",
72180
+ BorderColor:'rgba(180,180,180,0.9)',
72181
+ BGColor:"rgba(234,239,248,0.9)",
72182
+ BarWidth:{ Size:8 }
72183
+ },
72174
72184
  },
72175
72185
 
72176
72186
  //滚动条
@@ -133993,7 +134003,7 @@ function ChartVScrollbar()
133993
134003
  this.ChartBorder; //边框信息
133994
134004
  this.ChartFrame; //框架画法
133995
134005
  this.Name; //名称
133996
- this.ClassName='ChartReportTab'; //类名
134006
+ this.ClassName='ChartVScrollbar'; //类名
133997
134007
  this.IsDrawFirst=false;
133998
134008
  this.GetEventCallback; //获取事件
133999
134009
  this.Report;
@@ -134570,6 +134580,7 @@ function JSKeyboardChartContainer(uielement)
134570
134580
 
134571
134581
  //拖拽滚动条
134572
134582
  this.DragYScroll=null; //{Start:{x,y}, End:{x, y}}
134583
+
134573
134584
  this.IsDestroy=false; //是否已经销毁了
134574
134585
 
134575
134586
  this.ChartDestory=function() //销毁
@@ -134610,6 +134621,7 @@ function JSKeyboardChartContainer(uielement)
134610
134621
  this.Data.Data=aryExactQuery.concat(aryFuzzyQuery);
134611
134622
 
134612
134623
  this.ChartPaint[0].SelectedRow=0;
134624
+ this.ChartPaint[0].SizeChange=true;
134613
134625
 
134614
134626
  JSConsole.Chart.Log(`[JSKeyboardChart:Search] search=${strSearch}, source=${this.SourceData.Data.length} match=${this.Data.Data.length}`);
134615
134627
 
@@ -134686,6 +134698,12 @@ function JSKeyboardChartContainer(uielement)
134686
134698
  chart.Data=this.Data;
134687
134699
  this.ChartPaint[0]=chart;
134688
134700
 
134701
+ chart.VScrollbar=new ChartKeyboardVScrollbar();
134702
+ chart.VScrollbar.Frame=this.Frame;
134703
+ chart.VScrollbar.Canvas=this.Canvas;
134704
+ chart.VScrollbar.ChartBorder=this.Frame.ChartBorder;
134705
+ chart.VScrollbar.Report=chart;
134706
+
134689
134707
  if (option)
134690
134708
  {
134691
134709
 
@@ -134937,7 +134955,7 @@ function JSKeyboardChartContainer(uielement)
134937
134955
 
134938
134956
  this.UIOnMouseDown=function(e)
134939
134957
  {
134940
- this.DragXScroll=null;
134958
+ this.DragYScroll=null;
134941
134959
  this.DragMove={ Click:{ X:e.clientX, Y:e.clientY }, Move:{X:e.clientX, Y:e.clientY}, PreMove:{X:e.clientX, Y:e.clientY } };
134942
134960
 
134943
134961
  var pixelTatio = GetDevicePixelRatio();
@@ -134956,6 +134974,29 @@ function JSKeyboardChartContainer(uielement)
134956
134974
  if (clickData.Redraw==true)
134957
134975
  this.Draw();
134958
134976
  }
134977
+ else if (clickData.Type==5 && e.button==0) //右侧滚动条
134978
+ {
134979
+ var scroll=clickData.VScrollbar;
134980
+ if (scroll.Type==1) //顶部按钮
134981
+ {
134982
+ if (this.MoveYOffset(-1))
134983
+ this.Draw();
134984
+ }
134985
+ else if (scroll.Type==2) //底部按钮
134986
+ {
134987
+ if (this.MoveYOffset(1))
134988
+ this.Draw();
134989
+ }
134990
+ else if (scroll.Type==3) //滚动条
134991
+ {
134992
+ this.DragYScroll={ Click:{X:x, Y:y}, LastMove:{X:x, Y:y} };
134993
+ }
134994
+ else if (scroll.Type==4) //滚动条内部
134995
+ {
134996
+ if (this.SetYOffset(scroll.Pos))
134997
+ this.Draw();
134998
+ }
134999
+ }
134959
135000
  }
134960
135001
 
134961
135002
  document.onmousemove=(e)=>{ this.DocOnMouseMove(e); }
@@ -135001,68 +135042,17 @@ function JSKeyboardChartContainer(uielement)
135001
135042
  var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
135002
135043
  var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
135003
135044
 
135004
- //JSConsole.Chart.Log(`[JSReportChartContainer::DocOnMouseMove] x=${x}, y=${y}`);
135005
-
135006
- if (this.DragRow)
135007
- {
135008
- var drag=this.DragRow;
135009
- var moveSetpY=drag.LastMove.Y-e.clientY;
135010
- if (Math.abs(moveSetpY)<2) return;
135011
- var reportChart=this.GetReportChart();
135012
- drag.LastMove.X=e.clientX;
135013
- drag.LastMove.Y=e.clientY;
135014
- drag.Inside={X:x, Y:y};
135015
-
135016
- if (reportChart)
135017
- {
135018
- var moveRow=reportChart.OnDrawgRow(x,y,e);
135019
- if (moveRow )
135020
- {
135021
- if (moveRow.Type==2)
135022
- {
135023
- if (moveRow.Data.DataIndex!=drag.Data.Row.DataIndex)
135024
- {
135025
- drag.MoveRow=moveRow;
135026
- }
135027
- }
135028
- else if (moveRow.Type==7)
135029
- {
135030
- var pageStatus=reportChart.GetCurrentPageStatus();
135031
- if (!pageStatus.IsEnd)
135032
- {
135033
- this.MoveYOffset(1, false);
135034
- drag.MoveRow=null;
135035
-
135036
- this.EnablePageScroll=true;
135037
- this.AutoScrollPage(2);
135038
- }
135039
- }
135040
- else if (moveRow.Type==5)
135041
- {
135042
- if (this.Data.YOffset>0)
135043
- {
135044
- this.MoveYOffset(-1, false);
135045
- drag.MoveRow=null;
135046
-
135047
- this.EnablePageScroll=true;
135048
- this.AutoScrollPage(-2);
135049
- }
135050
- }
135051
- }
135052
- reportChart.DragRow=drag;
135053
- }
135054
-
135055
- this.Draw();
135056
- }
135057
- else if (this.DragXScroll)
135045
+ if (this.DragYScroll)
135058
135046
  {
135059
135047
  var chart=this.ChartPaint[0];
135060
- if (!chart || !chart.Tab) return;
135048
+ if (!chart || !chart.VScrollbar) return;
135061
135049
 
135062
- this.DragXScroll.LastMove.X=x;
135063
- this.DragXScroll.LastMove.Y=y;
135064
- var pos=chart.Tab.GetScrollPostionByPoint(x,y);
135065
- if (this.SetXOffset(pos)) this.Draw();
135050
+ this.DragYScroll.LastMove.X=x;
135051
+ this.DragYScroll.LastMove.Y=y;
135052
+
135053
+ var pos=chart.VScrollbar.GetScrollPostionByPoint(x,y);
135054
+ if (this.SetYOffset(pos))
135055
+ this.Draw();
135066
135056
  }
135067
135057
  }
135068
135058
 
@@ -135072,6 +135062,8 @@ function JSKeyboardChartContainer(uielement)
135072
135062
  document.onmousemove=null;
135073
135063
  document.onmouseup=null;
135074
135064
 
135065
+ this.DragYScroll=null;
135066
+
135075
135067
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_KEYBOARD_MOUSEUP)
135076
135068
  if (event && event.Callback)
135077
135069
  {
@@ -135378,6 +135370,21 @@ function JSKeyboardChartContainer(uielement)
135378
135370
  return result;
135379
135371
  }
135380
135372
  }
135373
+
135374
+ this.SetYOffset=function(pos)
135375
+ {
135376
+ if (!IFrameSplitOperator.IsNumber(pos)) return false;
135377
+ var chart=this.ChartPaint[0];
135378
+ if (!chart) return false;
135379
+
135380
+ var maxOffset=chart.GetYScrollRange();
135381
+ if (pos<0) pos=0;
135382
+ if (pos>maxOffset) pos=maxOffset;
135383
+
135384
+ this.Data.YOffset=pos;
135385
+
135386
+ return true;
135387
+ }
135381
135388
  }
135382
135389
 
135383
135390
  function JSKeyboardFrame()
@@ -135387,14 +135394,14 @@ function JSKeyboardFrame()
135387
135394
 
135388
135395
  this.BorderLine=null; //1=上 2=下 4=左 8=右
135389
135396
 
135390
- this.BorderColor=g_JSChartResource.Report.BorderColor; //边框线
135397
+ this.BorderColor=g_JSChartResource.Keyboard.BorderColor; //边框线
135391
135398
 
135392
135399
  this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;
135393
135400
  this.LogoTextFont=g_JSChartResource.FrameLogo.Font;
135394
135401
 
135395
- this.ReloadResource=function(resource)
135402
+ this.ReloadResource=function(option)
135396
135403
  {
135397
- this.BorderColor=g_JSChartResource.Report.BorderColor; //边框线
135404
+ this.BorderColor=g_JSChartResource.Keyboard.BorderColor; //边框线
135398
135405
  this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;
135399
135406
  this.LogoTextFont=g_JSChartResource.FrameLogo.Font;
135400
135407
  }
@@ -135469,7 +135476,8 @@ var KEYBOARD_COLUMN_ID=
135469
135476
  SHORT_SYMBOL_ID:0, //不带后缀代码
135470
135477
  SYMBOL_ID:1,
135471
135478
  NAME_ID:2, //简称
135472
- TYPE_ID:3 //类型
135479
+ TYPE_ID:3, //类型
135480
+ TYPE_NAME_ID:4, //类型中文名字
135473
135481
  }
135474
135482
 
135475
135483
 
@@ -135490,10 +135498,12 @@ function ChartSymbolList()
135490
135498
  this.IsDrawBorder=false; //是否绘制单元格边框
135491
135499
 
135492
135500
  this.ShowSymbol=[]; //显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
135501
+
135502
+ this.VScrollbar; //竖向滚动条
135493
135503
 
135494
135504
  this.BorderColor=g_JSChartResource.Keyboard.BorderColor; //边框线
135495
135505
  this.SelectedColor=g_JSChartResource.Keyboard.SelectedColor; //选中行
135496
- this.TextColor=g_JSChartResource.Keyboard.TextColor; //文字颜色
135506
+ this.TextColor=g_JSChartResource.Keyboard.TextColor; //文字颜色
135497
135507
 
135498
135508
  //表格内容配置
135499
135509
  this.ItemFontConfig={ Size:g_JSChartResource.Keyboard.Item.Font.Size, Name:g_JSChartResource.Keyboard.Item.Font.Name };
@@ -135517,14 +135527,20 @@ function ChartSymbolList()
135517
135527
  [
135518
135528
  { Type:KEYBOARD_COLUMN_ID.SHORT_SYMBOL_ID, Title:"代码", TextAlign:"left", Width:null, MaxText:"888888" },
135519
135529
  { Type:KEYBOARD_COLUMN_ID.NAME_ID, Title:"名称", TextAlign:"left", Width:null, MaxText:"擎擎擎擎擎擎" },
135520
- { Type:KEYBOARD_COLUMN_ID.TYPE_ID, Title:"类型", TextAlign:"right", Width:null, MaxText:"擎擎擎擎" },
135530
+ //{ Type:KEYBOARD_COLUMN_ID.TYPE_ID, Title:"类型", TextAlign:"right", Width:null, MaxText:"擎擎擎擎" },
135531
+ { Type:KEYBOARD_COLUMN_ID.TYPE_NAME_ID, Title:"类型", TextAlign:"right", Width:null, MaxText:"擎擎擎擎" },
135532
+
135521
135533
  ];
135522
135534
 
135523
135535
  this.RectClient={ };
135524
135536
 
135525
135537
  this.ReloadResource=function(resource)
135526
135538
  {
135527
-
135539
+ this.BorderColor=g_JSChartResource.Keyboard.BorderColor; //边框线
135540
+ this.SelectedColor=g_JSChartResource.Keyboard.SelectedColor; //选中行
135541
+ this.TextColor=g_JSChartResource.Keyboard.TextColor; //文字颜色
135542
+
135543
+ if (this.VScrollbar) this.VScrollbar.ReloadResource(resource);
135528
135544
  }
135529
135545
 
135530
135546
  this.SetColumn=function(aryColumn)
@@ -135539,10 +135555,11 @@ function ChartSymbolList()
135539
135555
  if (this.SizeChange) this.CalculateSize();
135540
135556
  else this.UpdateCacheData();
135541
135557
 
135558
+ var bShowVScrollbar=this.IsShowVScrollbar();
135542
135559
  this.Canvas.save();
135543
135560
 
135544
135561
  this.Canvas.beginPath();
135545
- this.Canvas.rect(this.RectClient.Left,this.RectClient.Top,(this.RectClient.Right-this.RectClient.Left),(this.RectClient.Bottom-this.RectClient.Top));
135562
+ this.Canvas.rect(this.RectClient.Left,this.RectClient.Top+1,(this.RectClient.Right-this.RectClient.Left),(this.RectClient.Bottom-(this.RectClient.Top+1)));
135546
135563
  //this.Canvas.stroke(); //调试用
135547
135564
  this.Canvas.clip();
135548
135565
 
@@ -135551,6 +135568,12 @@ function ChartSymbolList()
135551
135568
 
135552
135569
  this.DrawBorder();
135553
135570
 
135571
+ if (this.VScrollbar && bShowVScrollbar)
135572
+ {
135573
+ var bottom=this.ChartBorder.GetBottom();
135574
+ this.VScrollbar.DrawScrollbar(this.RectClient.Left,this.RectClient.Top+2, this.RectClient.Right+this.VScrollbar.ButtonSize+2, bottom-2);
135575
+ }
135576
+
135554
135577
  this.SizeChange=false;
135555
135578
  }
135556
135579
 
@@ -135561,6 +135584,12 @@ function ChartSymbolList()
135561
135584
  this.RectClient.Right=this.ChartBorder.GetRight();
135562
135585
  this.RectClient.Top=this.ChartBorder.GetTop();
135563
135586
  this.RectClient.Bottom=this.ChartBorder.GetBottom();
135587
+
135588
+ var bShowVScrollbar=this.IsShowVScrollbar();
135589
+ if (bShowVScrollbar && this.VScrollbar && this.VScrollbar.Enable)
135590
+ {
135591
+ this.RectClient.Right-=(this.VScrollbar.ButtonSize+2);
135592
+ }
135564
135593
  }
135565
135594
 
135566
135595
  this.GetPageSize=function(recalculate) //recalculate 是否重新计算
@@ -135594,6 +135623,8 @@ function ChartSymbolList()
135594
135623
 
135595
135624
  this.CalculateSize=function() //计算大小
135596
135625
  {
135626
+ if (this.VScrollbar && this.VScrollbar.Enable) this.VScrollbar.CalculateSize();
135627
+
135597
135628
  this.UpdateCacheData();
135598
135629
 
135599
135630
  var pixelRatio=GetDevicePixelRatio();
@@ -135763,11 +135794,11 @@ function ChartSymbolList()
135763
135794
  if (stock.Color) drawInfo.TextColor=stock.Color;
135764
135795
  }
135765
135796
  }
135766
- else if (column.Type==KEYBOARD_COLUMN_ID.TYPE_ID)
135797
+ else if (column.Type==KEYBOARD_COLUMN_ID.TYPE_NAME_ID)
135767
135798
  {
135768
- if (stock && stock.Type)
135799
+ if (stock && stock.TypeName)
135769
135800
  {
135770
- drawInfo.Text=this.TextEllipsis(stock.Type, textWidth, column.MaxText);
135801
+ drawInfo.Text=this.TextEllipsis(stock.TypeName, textWidth, column.MaxText);
135771
135802
  if (stock.Color) drawInfo.TextColor=stock.Color;
135772
135803
  }
135773
135804
  }
@@ -135788,6 +135819,7 @@ function ChartSymbolList()
135788
135819
  else if (textAlign=='right')
135789
135820
  {
135790
135821
  x=left+width-2;
135822
+ if (left+width-2>this.RectClient.Right) x=this.RectClient.Right-2;
135791
135823
  this.Canvas.textAlign="right";
135792
135824
  }
135793
135825
  else
@@ -135842,6 +135874,12 @@ function ChartSymbolList()
135842
135874
  else
135843
135875
  var uiElement={Left:null, Top:null};
135844
135876
 
135877
+ if (this.VScrollbar)
135878
+ {
135879
+ var item=this.VScrollbar.OnMouseDown(x,y,e);
135880
+ if (item) return { Type:5, VScrollbar:item }; //右侧滚动条
135881
+ }
135882
+
135845
135883
  var row=this.PtInBody(x,y);
135846
135884
  if (row)
135847
135885
  {
@@ -136002,6 +136040,57 @@ function ChartSymbolList()
136002
136040
  event.Callback(event,data,this);
136003
136041
  }
136004
136042
  }
136043
+
136044
+ this.GetYScrollRange=function()
136045
+ {
136046
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return 0;
136047
+
136048
+ var maxOffset=this.Data.Data.length-this.RowCount;
136049
+
136050
+ return maxOffset;
136051
+ }
136052
+
136053
+ //大于1屏数据 显示滚动条
136054
+ this.IsShowVScrollbar=function()
136055
+ {
136056
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return false;
136057
+
136058
+ return this.Data.Data.length>this.RowCount;
136059
+ }
136060
+ }
136061
+
136062
+ //纵向滚动条
136063
+ function ChartKeyboardVScrollbar()
136064
+ {
136065
+ this.newMethod=ChartVScrollbar; //派生
136066
+ this.newMethod();
136067
+ delete this.newMethod;
136068
+
136069
+ this.ClassName='ChartKeyboardVScrollbar';
136070
+ this.Enable=true;
136071
+
136072
+ this.ScrollBarHeight=g_JSChartResource.Keyboard.VScrollbar.ScrollBarHeight;
136073
+ this.ButtonColor=g_JSChartResource.Keyboard.VScrollbar.ButtonColor;
136074
+ this.BarColor=g_JSChartResource.Keyboard.VScrollbar.BarColor;
136075
+ this.BorderColor=g_JSChartResource.Keyboard.VScrollbar.BorderColor;
136076
+ this.BGColor=g_JSChartResource.Keyboard.VScrollbar.BGColor;
136077
+ this.Mergin={ Left:2, Right:2, Top:2, Bottom:2 };
136078
+ this.BarWithConfig={ Size:g_JSChartResource.Keyboard.VScrollbar.BarWidth.Size };
136079
+
136080
+ this.ReloadResource=function(resource)
136081
+ {
136082
+ this.ScrollBarHeight=g_JSChartResource.Keyboard.VScrollbar.ScrollBarHeight;
136083
+ this.ButtonColor=g_JSChartResource.Keyboard.VScrollbar.ButtonColor;
136084
+ this.BarColor=g_JSChartResource.Keyboard.VScrollbar.BarColor;
136085
+ this.BorderColor=g_JSChartResource.Keyboard.VScrollbar.BorderColor;
136086
+ this.BGColor=g_JSChartResource.Keyboard.VScrollbar.BGColor;
136087
+ this.BarWithConfig={ Size:g_JSChartResource.Keyboard.VScrollbar.BarWidth.Size };
136088
+ }
136089
+
136090
+ this.IsShowCallback=function()
136091
+ {
136092
+ return true;
136093
+ }
136005
136094
  }
136006
136095
 
136007
136096
  /*
@@ -137482,7 +137571,7 @@ function ScrollBarBGChart()
137482
137571
 
137483
137572
 
137484
137573
 
137485
- var HQCHART_VERSION="1.1.13671";
137574
+ var HQCHART_VERSION="1.1.13681";
137486
137575
 
137487
137576
  function PrintHQChartVersion()
137488
137577
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13671";
8
+ var HQCHART_VERSION="1.1.13681";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -49559,7 +49559,16 @@ HQData.Keyboard_RequestSymbolList=function(data, callback)
49559
49559
  shortSymbol=shortSymbol.replace(".sh", "");
49560
49560
  shortSymbol=shortSymbol.replace(".sz", "");
49561
49561
  var symbolItem={ Symbol:item[0], Name:item[1], ShortSymbol:shortSymbol, Spell:item[3], Type:item[2] };
49562
- if (i%5==0) symbolItem.Color="rgb(255,0,0)";
49562
+ if (symbolItem.Type=="EQA")
49563
+ {
49564
+ symbolItem.TypeName="股票";
49565
+ }
49566
+ else if (symbolItem.Type=="IDX")
49567
+ {
49568
+ symbolItem.TypeName="指数";
49569
+ symbolItem.Color="rgb(30,144,255)";
49570
+ }
49571
+
49563
49572
  arySymbol.push(symbolItem);
49564
49573
  }
49565
49574