hqchart 1.1.14604 → 1.1.14611

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.
@@ -416,14 +416,6 @@ function JSReportChartContainer(uielement)
416
416
 
417
417
  this.Canvas=uielement.getContext("2d"); //画布
418
418
 
419
- this.Tooltip=document.createElement("div");
420
- this.Tooltip.className='jsreport-tooltip';
421
- this.Tooltip.style.background=g_JSChartResource.TooltipBGColor;
422
- this.Tooltip.style.opacity=g_JSChartResource.TooltipAlpha;
423
- this.Tooltip.style["pointer-events"]="none";
424
- this.Tooltip.id=Guid();
425
- uielement.parentNode.appendChild(this.Tooltip);
426
-
427
419
  this.Symbol; //板块代码
428
420
  this.Name; //板块名称
429
421
  this.NetworkFilter; //数据回调接口
@@ -2464,7 +2456,7 @@ function JSReportChartContainer(uielement)
2464
2456
 
2465
2457
  if (reportChart)
2466
2458
  {
2467
- var moveRow=reportChart.OnDrawgRow(x,y,e);
2459
+ var moveRow=reportChart.OnDragRow(x,y,e);
2468
2460
  if (moveRow )
2469
2461
  {
2470
2462
  if (moveRow.Type==2)
@@ -2537,6 +2529,8 @@ function JSReportChartContainer(uielement)
2537
2529
  var yMove=e.clientY-this.DragHeader.Click.Y;
2538
2530
  if ( Math.abs(yMove)<=1 && Math.abs(xMove)<=1) return;
2539
2531
 
2532
+ var reportChart=this.GetReportChart();
2533
+ var clickData=this.DragHeader.ClickData;
2540
2534
  this.DragHeader.LastMove.X=e.clientX;
2541
2535
  this.DragHeader.LastMove.Y=e.clientY;
2542
2536
  if (!this.DragHeader.MovePoint)
@@ -2549,8 +2543,17 @@ function JSReportChartContainer(uielement)
2549
2543
  this.DragHeader.MovePoint.Y=y;
2550
2544
  }
2551
2545
 
2552
- this.OnMoveDragHeader(x,y,e);
2553
- this.ShowDragHeaderTooltip(x,y,e);
2546
+ var moveData=reportChart.OnDragHeader(x,y,e);
2547
+ if (!moveData) return;
2548
+ if (moveData.Type!=1) return;
2549
+
2550
+ if (moveData.Header.Index!=clickData.Header.Index)
2551
+ {
2552
+ this.DragHeader.MoveToData=moveData;
2553
+ }
2554
+
2555
+ reportChart.DragHeader=this.DragHeader;
2556
+ this.Draw();
2554
2557
  }
2555
2558
  else if (this.DragColumnWidth && this.DragColumnWidth.ClickData) //列宽度拖拽
2556
2559
  {
@@ -2592,57 +2595,6 @@ function JSReportChartContainer(uielement)
2592
2595
  this.Draw();
2593
2596
  }
2594
2597
 
2595
- this.OnMoveDragHeader=function(x, y,e)
2596
- {
2597
- var chart=this.ChartPaint[0];
2598
- if (!chart) return;
2599
-
2600
- var clickData=this.DragHeader.ClickData;
2601
- this.DragHeader.MoveToData=null;
2602
-
2603
- if (!clickData.Header.IsFixed) //固定列不能拖
2604
- {
2605
- var yHeader=this.DragHeader.ClickPoint.Y;
2606
- var moveData=chart.OnMouseDown(x,yHeader,e);
2607
- if (!moveData || !moveData.Header) return;
2608
- if (moveData.Header.IsFixed) return;
2609
- if (moveData.Header.Index== clickData.Header.Index) return;
2610
-
2611
- this.DragHeader.MoveToData=moveData;
2612
- console.log(`[JSReportChartContainer::OnMoveDragHeader] Click[Index=${clickData.Header.Index}, Title=${clickData.Header.Column.Title}] => Move[Index=${moveData.Header.Index}, Title=${moveData.Header.Column.Title}]`);
2613
- }
2614
- }
2615
-
2616
- this.ShowDragHeaderTooltip=function(x,y,e)
2617
- {
2618
- if (!this.DragHeader) return;
2619
- var drag=this.DragHeader;
2620
- if (!drag.ClickData || !drag.MovePoint) return;
2621
-
2622
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_DRAG_HEADER_TOOLTIP);
2623
- if (event)
2624
- {
2625
- var sendData={ PreventDefault:false, e, X:x, Y:y, DragHeader:this.DragHeader, Tooltip:this.Tooltip };
2626
- event.Callback(event,sendData,this);
2627
- if (sendData.PreventDefault) return;
2628
- }
2629
-
2630
- var title=drag.ClickData.Header.Column.Title;
2631
- this.Tooltip.className='jchart-chartdrawsvg-tooltip'; //ChartDrawSVG指标数据
2632
- this.Tooltip.style.position = "absolute";
2633
- this.Tooltip.style.left = e.clientX + "px";
2634
- this.Tooltip.style.top = e.clientY+ "px";
2635
- this.Tooltip.style.width = 100+"px";
2636
- this.Tooltip.style.height =null;
2637
- this.Tooltip.innerHTML=title;
2638
- this.Tooltip.style.display = "block";
2639
- }
2640
-
2641
- this.HideTooltip=function()
2642
- {
2643
- if (this.Tooltip.style.display!="none") this.Tooltip.style.display = "none";
2644
- }
2645
-
2646
2598
  this.DocOnMouseUp=function(e)
2647
2599
  {
2648
2600
  //清空事件
@@ -2679,6 +2631,12 @@ function JSReportChartContainer(uielement)
2679
2631
  this.DragMove=null;
2680
2632
  this.DragColumnWidth=null;
2681
2633
 
2634
+ if (reportChart.DragHeader)
2635
+ {
2636
+ bRedraw=true;
2637
+ reportChart.DragHeader=null;
2638
+ }
2639
+
2682
2640
  if (bRedraw) this.Draw();
2683
2641
 
2684
2642
  if (dragHeader)
@@ -4763,6 +4721,7 @@ function ChartReport()
4763
4721
 
4764
4722
  this.ShowSymbol=[]; //显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
4765
4723
  this.DragRow; //拖拽行
4724
+ this.DragHeader; //拖拽表头
4766
4725
 
4767
4726
  this.Tab;
4768
4727
  this.VScrollbar;
@@ -4970,6 +4929,11 @@ function ChartReport()
4970
4929
  Bottom:g_JSChartResource.Report.LimitBorder.Mergin.Bottom
4971
4930
  }
4972
4931
 
4932
+ this.DragRowColor=g_JSChartResource.Report.DragRow.Color;
4933
+ this.DragRowTextColor=g_JSChartResource.Report.DragRow.TextColor;
4934
+ this.DragMoveRowColor=g_JSChartResource.Report.DragRow.MoveRowColor;
4935
+ this.DragSrcRowColor=g_JSChartResource.Report.DragRow.SrcRowColor;
4936
+
4973
4937
  //排序图标
4974
4938
  this.SortConfig=
4975
4939
  {
@@ -5389,6 +5353,7 @@ function ChartReport()
5389
5353
 
5390
5354
  this.ClipClient();
5391
5355
 
5356
+ this.DrawDragHeaderBG();
5392
5357
  this.DrawHeader();
5393
5358
  this.DrawBody();
5394
5359
  this.Canvas.restore();
@@ -5406,6 +5371,8 @@ function ChartReport()
5406
5371
 
5407
5372
  this.DrawDragRow();
5408
5373
 
5374
+ this.DrawDragHeader();
5375
+
5409
5376
  if (this.VScrollbar)
5410
5377
  {
5411
5378
  var bottom=this.ChartBorder.GetBottom();
@@ -5416,6 +5383,60 @@ function ChartReport()
5416
5383
  this.SizeChange=false;
5417
5384
  }
5418
5385
 
5386
+ this.DrawDragHeaderBG=function()
5387
+ {
5388
+ if (!this.DragHeader) return;
5389
+
5390
+ var left=this.RectClient.Left;
5391
+ var right=this.RectClient.Right;
5392
+ var top=this.RectClient.Top;
5393
+ var bottom=top+this.HeaderHeight+this.RowHeight*this.RowCount+this.FixedRowHeight*this.FixedRowCount;
5394
+
5395
+ //竖线
5396
+ var columnLeft=left;
5397
+ for(var i=0;i<this.FixedColumn && i<this.Column.length; ++i)
5398
+ {
5399
+ var item=this.Column[i];
5400
+ columnLeft+=item.Width;
5401
+ }
5402
+
5403
+ for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i)
5404
+ {
5405
+ var item=this.Column[i];
5406
+
5407
+ if (this.DragHeader)
5408
+ {
5409
+ if (this.DragHeader.ClickData)
5410
+ {
5411
+ var clickData=this.DragHeader.ClickData;
5412
+ if (clickData.Header.Index==i)
5413
+ {
5414
+ var rtBG={ Left:columnLeft,Top:top, Bottom:bottom, Right:columnLeft+item.Width };
5415
+ rtBG.Width=rtBG.Right-rtBG.Left;
5416
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
5417
+ this.Canvas.fillStyle=this.DragSrcRowColor;
5418
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
5419
+ }
5420
+ }
5421
+
5422
+ if (this.DragHeader.MoveToData)
5423
+ {
5424
+ var moveToData=this.DragHeader.MoveToData;
5425
+ if (moveToData.Header.Index==i)
5426
+ {
5427
+ var rtBG={ Left:columnLeft,Top:top, Bottom:bottom, Right:columnLeft+item.Width };
5428
+ rtBG.Width=rtBG.Right-rtBG.Left;
5429
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
5430
+ this.Canvas.fillStyle=this.DragMoveRowColor;
5431
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
5432
+ }
5433
+ }
5434
+ }
5435
+
5436
+ columnLeft+=item.Width;
5437
+ }
5438
+ }
5439
+
5419
5440
  //更新缓存变量
5420
5441
  this.UpdateCacheData=function()
5421
5442
  {
@@ -5577,7 +5598,8 @@ function ChartReport()
5577
5598
  if (!item.Title || item.Title.length<=0) continue;
5578
5599
  var text=item.Title;
5579
5600
  itemWidth=this.Canvas.measureText(text).width;
5580
- if (item.Sort>0) itemWidth+this.SortConfig.Size*pixelRatio;
5601
+ if (item.Sort>0) itemWidth+=this.SortConfig.Size*pixelRatio;
5602
+
5581
5603
  itemWidth+=(4+this.HeaderMergin.Left+this.HeaderMergin.Right);
5582
5604
  if (item.Width<itemWidth) item.Width=itemWidth;
5583
5605
  }
@@ -5609,7 +5631,7 @@ function ChartReport()
5609
5631
  this.IsShowAllColumn=(subWidth<reportWidth);
5610
5632
  }
5611
5633
 
5612
- this.DrawHeaderItem=function(column, rtCell, index)
5634
+ this.DrawHeaderItem=function(column, rtCell, index, option)
5613
5635
  {
5614
5636
  if (column.HeaderBGColor) //背景色
5615
5637
  {
@@ -5653,12 +5675,18 @@ function ChartReport()
5653
5675
  //图标
5654
5676
  if (column.Icon) lastItem.Icon=column.Icon;
5655
5677
 
5678
+ if (option)
5679
+ {
5680
+ if (option.HeaderColor) drawInfo.HeaderColor=option.HeaderColor;
5681
+ }
5682
+
5656
5683
  this.DrawHeaderText(column, drawInfo);
5657
5684
  }
5658
5685
 
5659
5686
  this.DrawHeaderText=function(column, drawInfo)
5660
5687
  {
5661
- if (column.HeaderColor) this.Canvas.fillStyle=column.HeaderColor;
5688
+ if (drawInfo.HeaderColor) this.Canvas.fillStyle=drawInfo.HeaderColor;
5689
+ else if (column.HeaderColor) this.Canvas.fillStyle=column.HeaderColor;
5662
5690
  else this.Canvas.fillStyle=this.HeaderColor;
5663
5691
 
5664
5692
  var pixelRatio=GetDevicePixelRatio();
@@ -8365,7 +8393,7 @@ function ChartReport()
8365
8393
 
8366
8394
  }
8367
8395
 
8368
- this.OnDrawgRow=function(x, y, e) //Type: 5=顶部 6=空白行 2=行 7=底部
8396
+ this.OnDragRow=function(x, y, e) //Type: 5=顶部 6=空白行 2=行 7=底部
8369
8397
  {
8370
8398
  if (!this.Data) return null;
8371
8399
  if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return null;
@@ -8401,6 +8429,26 @@ function ChartReport()
8401
8429
  return { Type:7 };
8402
8430
  }
8403
8431
 
8432
+ this.OnDragHeader=function(x,y,e) //Type:1=行 2=左边 3=右边 4=空白 5=固定行
8433
+ {
8434
+ if (!this.IsShowHeader) return null;
8435
+
8436
+ var left=this.RectClient.Left;
8437
+ var right=this.RectClient.Right;
8438
+ var top=this.RectClient.Top;
8439
+ var bottom=top+this.HeaderHeight;
8440
+
8441
+ if (x<left) return { Type:2 };
8442
+ else if (x>right) return { Type:3 };
8443
+
8444
+ var cell=this.PtInItem(x,top+2,top,bottom);
8445
+ if (!cell) return { Type:4 };
8446
+
8447
+ if (cell.IsFixed) return { Type:5 }
8448
+
8449
+ return { Type:1, Header:cell };
8450
+ }
8451
+
8404
8452
  this.OnClickButton=function(x, y, e, status)
8405
8453
  {
8406
8454
  if (e.button!=0) return false;
@@ -8669,6 +8717,47 @@ function ChartReport()
8669
8717
 
8670
8718
  }
8671
8719
 
8720
+ this.DrawDragHeader=function()
8721
+ {
8722
+ if (!this.DragHeader) return;
8723
+ var drag=this.DragHeader;
8724
+ var clickData=drag.ClickData;
8725
+ var rtHeader=clickData.Header.Rect;
8726
+ var headerWidth=rtHeader.Right-rtHeader.Left;
8727
+ var rtRow={ Left:drag.LastMove.X-headerWidth/2, Top:this.RectClient.Top, Width:headerWidth };
8728
+ rtRow.Bottom=rtRow.Top+this.HeaderHeight+this.RowHeight*this.RowCount+this.FixedRowHeight*this.FixedRowCount;
8729
+ rtRow.Right=rtRow.Left+rtRow.Width;
8730
+ rtRow.Height=rtRow.Bottom-rtRow.Top;
8731
+
8732
+ //背景
8733
+ this.Canvas.fillStyle=this.DragRowColor;
8734
+ this.Canvas.fillRect(rtRow.Left, rtRow.Top, rtRow.Width, rtRow.Height);
8735
+
8736
+ //文字
8737
+ var cellHeader={ Left:rtRow.Left, Top:rtRow.Top, Right:rtRow.Right, Width:rtRow.Width, Height:this.HeaderHeight };
8738
+ cellHeader.Bottom=cellHeader.Top+cellHeader.Height;
8739
+ this.DrawHeaderItem(clickData.Header.Column, cellHeader, clickData.Header.Index, { HeaderColor:this.DragRowTextColor });
8740
+
8741
+ var textTop=cellHeader.Bottom+this.FixedRowHeight*this.FixedRowCount;
8742
+ this.Canvas.font=this.ItemFont;
8743
+ var dataCount=this.GetAllRowCount();
8744
+ for(var i=this.Data.YOffset, j=0; i<dataCount && j<this.RowCount ;++i, ++j)
8745
+ {
8746
+ var symbol=this.Data.Data[i];
8747
+
8748
+ var data= { Symbol:symbol , Stock:null, Block:null };
8749
+ if (this.GetStockDataCallback) data.Stock=this.GetStockDataCallback(symbol);
8750
+ if (this.GetBlockDataCallback) data.Block=this.GetBlockDataCallback(symbol);
8751
+ if (this.GetFlashBGDataCallback) data.FlashBG=this.GetFlashBGDataCallback(symbol, Date.now());
8752
+ data.Decimal=GetfloatPrecision(symbol); //小数位数
8753
+
8754
+ var item=this.Column[clickData.Header.Index];
8755
+ this.DrawItem(i, data, item, cellHeader.Left, textTop, 3);
8756
+
8757
+ textTop+=this.RowHeight;
8758
+ }
8759
+ }
8760
+
8672
8761
  this.GetTooltipData=function(x,y)
8673
8762
  {
8674
8763
  if (!IFrameSplitOperator.IsNonEmptyArray(this.TooltipRect)) return null;
@@ -133430,14 +133430,6 @@ function JSReportChartContainer(uielement)
133430
133430
 
133431
133431
  this.Canvas=uielement.getContext("2d"); //画布
133432
133432
 
133433
- this.Tooltip=document.createElement("div");
133434
- this.Tooltip.className='jsreport-tooltip';
133435
- this.Tooltip.style.background=g_JSChartResource.TooltipBGColor;
133436
- this.Tooltip.style.opacity=g_JSChartResource.TooltipAlpha;
133437
- this.Tooltip.style["pointer-events"]="none";
133438
- this.Tooltip.id=Guid();
133439
- uielement.parentNode.appendChild(this.Tooltip);
133440
-
133441
133433
  this.Symbol; //板块代码
133442
133434
  this.Name; //板块名称
133443
133435
  this.NetworkFilter; //数据回调接口
@@ -135478,7 +135470,7 @@ function JSReportChartContainer(uielement)
135478
135470
 
135479
135471
  if (reportChart)
135480
135472
  {
135481
- var moveRow=reportChart.OnDrawgRow(x,y,e);
135473
+ var moveRow=reportChart.OnDragRow(x,y,e);
135482
135474
  if (moveRow )
135483
135475
  {
135484
135476
  if (moveRow.Type==2)
@@ -135551,6 +135543,8 @@ function JSReportChartContainer(uielement)
135551
135543
  var yMove=e.clientY-this.DragHeader.Click.Y;
135552
135544
  if ( Math.abs(yMove)<=1 && Math.abs(xMove)<=1) return;
135553
135545
 
135546
+ var reportChart=this.GetReportChart();
135547
+ var clickData=this.DragHeader.ClickData;
135554
135548
  this.DragHeader.LastMove.X=e.clientX;
135555
135549
  this.DragHeader.LastMove.Y=e.clientY;
135556
135550
  if (!this.DragHeader.MovePoint)
@@ -135563,8 +135557,17 @@ function JSReportChartContainer(uielement)
135563
135557
  this.DragHeader.MovePoint.Y=y;
135564
135558
  }
135565
135559
 
135566
- this.OnMoveDragHeader(x,y,e);
135567
- this.ShowDragHeaderTooltip(x,y,e);
135560
+ var moveData=reportChart.OnDragHeader(x,y,e);
135561
+ if (!moveData) return;
135562
+ if (moveData.Type!=1) return;
135563
+
135564
+ if (moveData.Header.Index!=clickData.Header.Index)
135565
+ {
135566
+ this.DragHeader.MoveToData=moveData;
135567
+ }
135568
+
135569
+ reportChart.DragHeader=this.DragHeader;
135570
+ this.Draw();
135568
135571
  }
135569
135572
  else if (this.DragColumnWidth && this.DragColumnWidth.ClickData) //列宽度拖拽
135570
135573
  {
@@ -135606,57 +135609,6 @@ function JSReportChartContainer(uielement)
135606
135609
  this.Draw();
135607
135610
  }
135608
135611
 
135609
- this.OnMoveDragHeader=function(x, y,e)
135610
- {
135611
- var chart=this.ChartPaint[0];
135612
- if (!chart) return;
135613
-
135614
- var clickData=this.DragHeader.ClickData;
135615
- this.DragHeader.MoveToData=null;
135616
-
135617
- if (!clickData.Header.IsFixed) //固定列不能拖
135618
- {
135619
- var yHeader=this.DragHeader.ClickPoint.Y;
135620
- var moveData=chart.OnMouseDown(x,yHeader,e);
135621
- if (!moveData || !moveData.Header) return;
135622
- if (moveData.Header.IsFixed) return;
135623
- if (moveData.Header.Index== clickData.Header.Index) return;
135624
-
135625
- this.DragHeader.MoveToData=moveData;
135626
- console.log(`[JSReportChartContainer::OnMoveDragHeader] Click[Index=${clickData.Header.Index}, Title=${clickData.Header.Column.Title}] => Move[Index=${moveData.Header.Index}, Title=${moveData.Header.Column.Title}]`);
135627
- }
135628
- }
135629
-
135630
- this.ShowDragHeaderTooltip=function(x,y,e)
135631
- {
135632
- if (!this.DragHeader) return;
135633
- var drag=this.DragHeader;
135634
- if (!drag.ClickData || !drag.MovePoint) return;
135635
-
135636
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_DRAG_HEADER_TOOLTIP);
135637
- if (event)
135638
- {
135639
- var sendData={ PreventDefault:false, e, X:x, Y:y, DragHeader:this.DragHeader, Tooltip:this.Tooltip };
135640
- event.Callback(event,sendData,this);
135641
- if (sendData.PreventDefault) return;
135642
- }
135643
-
135644
- var title=drag.ClickData.Header.Column.Title;
135645
- this.Tooltip.className='jchart-chartdrawsvg-tooltip'; //ChartDrawSVG指标数据
135646
- this.Tooltip.style.position = "absolute";
135647
- this.Tooltip.style.left = e.clientX + "px";
135648
- this.Tooltip.style.top = e.clientY+ "px";
135649
- this.Tooltip.style.width = 100+"px";
135650
- this.Tooltip.style.height =null;
135651
- this.Tooltip.innerHTML=title;
135652
- this.Tooltip.style.display = "block";
135653
- }
135654
-
135655
- this.HideTooltip=function()
135656
- {
135657
- if (this.Tooltip.style.display!="none") this.Tooltip.style.display = "none";
135658
- }
135659
-
135660
135612
  this.DocOnMouseUp=function(e)
135661
135613
  {
135662
135614
  //清空事件
@@ -135693,6 +135645,12 @@ function JSReportChartContainer(uielement)
135693
135645
  this.DragMove=null;
135694
135646
  this.DragColumnWidth=null;
135695
135647
 
135648
+ if (reportChart.DragHeader)
135649
+ {
135650
+ bRedraw=true;
135651
+ reportChart.DragHeader=null;
135652
+ }
135653
+
135696
135654
  if (bRedraw) this.Draw();
135697
135655
 
135698
135656
  if (dragHeader)
@@ -137777,6 +137735,7 @@ function ChartReport()
137777
137735
 
137778
137736
  this.ShowSymbol=[]; //显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
137779
137737
  this.DragRow; //拖拽行
137738
+ this.DragHeader; //拖拽表头
137780
137739
 
137781
137740
  this.Tab;
137782
137741
  this.VScrollbar;
@@ -137984,6 +137943,11 @@ function ChartReport()
137984
137943
  Bottom:g_JSChartResource.Report.LimitBorder.Mergin.Bottom
137985
137944
  }
137986
137945
 
137946
+ this.DragRowColor=g_JSChartResource.Report.DragRow.Color;
137947
+ this.DragRowTextColor=g_JSChartResource.Report.DragRow.TextColor;
137948
+ this.DragMoveRowColor=g_JSChartResource.Report.DragRow.MoveRowColor;
137949
+ this.DragSrcRowColor=g_JSChartResource.Report.DragRow.SrcRowColor;
137950
+
137987
137951
  //排序图标
137988
137952
  this.SortConfig=
137989
137953
  {
@@ -138403,6 +138367,7 @@ function ChartReport()
138403
138367
 
138404
138368
  this.ClipClient();
138405
138369
 
138370
+ this.DrawDragHeaderBG();
138406
138371
  this.DrawHeader();
138407
138372
  this.DrawBody();
138408
138373
  this.Canvas.restore();
@@ -138420,6 +138385,8 @@ function ChartReport()
138420
138385
 
138421
138386
  this.DrawDragRow();
138422
138387
 
138388
+ this.DrawDragHeader();
138389
+
138423
138390
  if (this.VScrollbar)
138424
138391
  {
138425
138392
  var bottom=this.ChartBorder.GetBottom();
@@ -138430,6 +138397,60 @@ function ChartReport()
138430
138397
  this.SizeChange=false;
138431
138398
  }
138432
138399
 
138400
+ this.DrawDragHeaderBG=function()
138401
+ {
138402
+ if (!this.DragHeader) return;
138403
+
138404
+ var left=this.RectClient.Left;
138405
+ var right=this.RectClient.Right;
138406
+ var top=this.RectClient.Top;
138407
+ var bottom=top+this.HeaderHeight+this.RowHeight*this.RowCount+this.FixedRowHeight*this.FixedRowCount;
138408
+
138409
+ //竖线
138410
+ var columnLeft=left;
138411
+ for(var i=0;i<this.FixedColumn && i<this.Column.length; ++i)
138412
+ {
138413
+ var item=this.Column[i];
138414
+ columnLeft+=item.Width;
138415
+ }
138416
+
138417
+ for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i)
138418
+ {
138419
+ var item=this.Column[i];
138420
+
138421
+ if (this.DragHeader)
138422
+ {
138423
+ if (this.DragHeader.ClickData)
138424
+ {
138425
+ var clickData=this.DragHeader.ClickData;
138426
+ if (clickData.Header.Index==i)
138427
+ {
138428
+ var rtBG={ Left:columnLeft,Top:top, Bottom:bottom, Right:columnLeft+item.Width };
138429
+ rtBG.Width=rtBG.Right-rtBG.Left;
138430
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
138431
+ this.Canvas.fillStyle=this.DragSrcRowColor;
138432
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
138433
+ }
138434
+ }
138435
+
138436
+ if (this.DragHeader.MoveToData)
138437
+ {
138438
+ var moveToData=this.DragHeader.MoveToData;
138439
+ if (moveToData.Header.Index==i)
138440
+ {
138441
+ var rtBG={ Left:columnLeft,Top:top, Bottom:bottom, Right:columnLeft+item.Width };
138442
+ rtBG.Width=rtBG.Right-rtBG.Left;
138443
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
138444
+ this.Canvas.fillStyle=this.DragMoveRowColor;
138445
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
138446
+ }
138447
+ }
138448
+ }
138449
+
138450
+ columnLeft+=item.Width;
138451
+ }
138452
+ }
138453
+
138433
138454
  //更新缓存变量
138434
138455
  this.UpdateCacheData=function()
138435
138456
  {
@@ -138591,7 +138612,8 @@ function ChartReport()
138591
138612
  if (!item.Title || item.Title.length<=0) continue;
138592
138613
  var text=item.Title;
138593
138614
  itemWidth=this.Canvas.measureText(text).width;
138594
- if (item.Sort>0) itemWidth+this.SortConfig.Size*pixelRatio;
138615
+ if (item.Sort>0) itemWidth+=this.SortConfig.Size*pixelRatio;
138616
+
138595
138617
  itemWidth+=(4+this.HeaderMergin.Left+this.HeaderMergin.Right);
138596
138618
  if (item.Width<itemWidth) item.Width=itemWidth;
138597
138619
  }
@@ -138623,7 +138645,7 @@ function ChartReport()
138623
138645
  this.IsShowAllColumn=(subWidth<reportWidth);
138624
138646
  }
138625
138647
 
138626
- this.DrawHeaderItem=function(column, rtCell, index)
138648
+ this.DrawHeaderItem=function(column, rtCell, index, option)
138627
138649
  {
138628
138650
  if (column.HeaderBGColor) //背景色
138629
138651
  {
@@ -138667,12 +138689,18 @@ function ChartReport()
138667
138689
  //图标
138668
138690
  if (column.Icon) lastItem.Icon=column.Icon;
138669
138691
 
138692
+ if (option)
138693
+ {
138694
+ if (option.HeaderColor) drawInfo.HeaderColor=option.HeaderColor;
138695
+ }
138696
+
138670
138697
  this.DrawHeaderText(column, drawInfo);
138671
138698
  }
138672
138699
 
138673
138700
  this.DrawHeaderText=function(column, drawInfo)
138674
138701
  {
138675
- if (column.HeaderColor) this.Canvas.fillStyle=column.HeaderColor;
138702
+ if (drawInfo.HeaderColor) this.Canvas.fillStyle=drawInfo.HeaderColor;
138703
+ else if (column.HeaderColor) this.Canvas.fillStyle=column.HeaderColor;
138676
138704
  else this.Canvas.fillStyle=this.HeaderColor;
138677
138705
 
138678
138706
  var pixelRatio=GetDevicePixelRatio();
@@ -141379,7 +141407,7 @@ function ChartReport()
141379
141407
 
141380
141408
  }
141381
141409
 
141382
- this.OnDrawgRow=function(x, y, e) //Type: 5=顶部 6=空白行 2=行 7=底部
141410
+ this.OnDragRow=function(x, y, e) //Type: 5=顶部 6=空白行 2=行 7=底部
141383
141411
  {
141384
141412
  if (!this.Data) return null;
141385
141413
  if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return null;
@@ -141415,6 +141443,26 @@ function ChartReport()
141415
141443
  return { Type:7 };
141416
141444
  }
141417
141445
 
141446
+ this.OnDragHeader=function(x,y,e) //Type:1=行 2=左边 3=右边 4=空白 5=固定行
141447
+ {
141448
+ if (!this.IsShowHeader) return null;
141449
+
141450
+ var left=this.RectClient.Left;
141451
+ var right=this.RectClient.Right;
141452
+ var top=this.RectClient.Top;
141453
+ var bottom=top+this.HeaderHeight;
141454
+
141455
+ if (x<left) return { Type:2 };
141456
+ else if (x>right) return { Type:3 };
141457
+
141458
+ var cell=this.PtInItem(x,top+2,top,bottom);
141459
+ if (!cell) return { Type:4 };
141460
+
141461
+ if (cell.IsFixed) return { Type:5 }
141462
+
141463
+ return { Type:1, Header:cell };
141464
+ }
141465
+
141418
141466
  this.OnClickButton=function(x, y, e, status)
141419
141467
  {
141420
141468
  if (e.button!=0) return false;
@@ -141683,6 +141731,47 @@ function ChartReport()
141683
141731
 
141684
141732
  }
141685
141733
 
141734
+ this.DrawDragHeader=function()
141735
+ {
141736
+ if (!this.DragHeader) return;
141737
+ var drag=this.DragHeader;
141738
+ var clickData=drag.ClickData;
141739
+ var rtHeader=clickData.Header.Rect;
141740
+ var headerWidth=rtHeader.Right-rtHeader.Left;
141741
+ var rtRow={ Left:drag.LastMove.X-headerWidth/2, Top:this.RectClient.Top, Width:headerWidth };
141742
+ rtRow.Bottom=rtRow.Top+this.HeaderHeight+this.RowHeight*this.RowCount+this.FixedRowHeight*this.FixedRowCount;
141743
+ rtRow.Right=rtRow.Left+rtRow.Width;
141744
+ rtRow.Height=rtRow.Bottom-rtRow.Top;
141745
+
141746
+ //背景
141747
+ this.Canvas.fillStyle=this.DragRowColor;
141748
+ this.Canvas.fillRect(rtRow.Left, rtRow.Top, rtRow.Width, rtRow.Height);
141749
+
141750
+ //文字
141751
+ var cellHeader={ Left:rtRow.Left, Top:rtRow.Top, Right:rtRow.Right, Width:rtRow.Width, Height:this.HeaderHeight };
141752
+ cellHeader.Bottom=cellHeader.Top+cellHeader.Height;
141753
+ this.DrawHeaderItem(clickData.Header.Column, cellHeader, clickData.Header.Index, { HeaderColor:this.DragRowTextColor });
141754
+
141755
+ var textTop=cellHeader.Bottom+this.FixedRowHeight*this.FixedRowCount;
141756
+ this.Canvas.font=this.ItemFont;
141757
+ var dataCount=this.GetAllRowCount();
141758
+ for(var i=this.Data.YOffset, j=0; i<dataCount && j<this.RowCount ;++i, ++j)
141759
+ {
141760
+ var symbol=this.Data.Data[i];
141761
+
141762
+ var data= { Symbol:symbol , Stock:null, Block:null };
141763
+ if (this.GetStockDataCallback) data.Stock=this.GetStockDataCallback(symbol);
141764
+ if (this.GetBlockDataCallback) data.Block=this.GetBlockDataCallback(symbol);
141765
+ if (this.GetFlashBGDataCallback) data.FlashBG=this.GetFlashBGDataCallback(symbol, Date.now());
141766
+ data.Decimal=GetfloatPrecision(symbol); //小数位数
141767
+
141768
+ var item=this.Column[clickData.Header.Index];
141769
+ this.DrawItem(i, data, item, cellHeader.Left, textTop, 3);
141770
+
141771
+ textTop+=this.RowHeight;
141772
+ }
141773
+ }
141774
+
141686
141775
  this.GetTooltipData=function(x,y)
141687
141776
  {
141688
141777
  if (!IFrameSplitOperator.IsNonEmptyArray(this.TooltipRect)) return null;
@@ -145943,7 +146032,7 @@ function ScrollBarBGChart()
145943
146032
 
145944
146033
 
145945
146034
 
145946
- var HQCHART_VERSION="1.1.14603";
146035
+ var HQCHART_VERSION="1.1.14610";
145947
146036
 
145948
146037
  function PrintHQChartVersion()
145949
146038
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14603";
8
+ var HQCHART_VERSION="1.1.14610";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {