hqchart 1.1.15011 → 1.1.15026
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 +272 -226
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogTooltip.js +425 -2
- package/src/jscommon/umychart.complier.js +94 -0
- package/src/jscommon/umychart.js +550 -6
- package/src/jscommon/umychart.resource/css/tools.css +95 -0
- package/src/jscommon/umychart.style.js +16 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +661 -7
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +1086 -9
package/package.json
CHANGED
|
@@ -1137,8 +1137,6 @@ function JSFloatTooltip()
|
|
|
1137
1137
|
Left:"UMyChart_Tooltip_Float_Text2_Span", //左对齐
|
|
1138
1138
|
MarginLeft:'UMyChart_Tooltip_Float_Text3_Span',
|
|
1139
1139
|
Right:"UMyChart_Tooltip_Float_Text_Span",
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
1140
|
}
|
|
1143
1141
|
|
|
1144
1142
|
this.TitleAlign=
|
|
@@ -2353,4 +2351,429 @@ function JSFloatTooltip()
|
|
|
2353
2351
|
|
|
2354
2352
|
this.UpdateStyle();
|
|
2355
2353
|
}
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
function JSSmallFloatTooltip()
|
|
2357
|
+
{
|
|
2358
|
+
this.DivDialog=null;
|
|
2359
|
+
this.DivContent=null;
|
|
2360
|
+
this.HQChart=null;
|
|
2361
|
+
this.ClassName="JSSmallFloatTooltip";
|
|
2362
|
+
|
|
2363
|
+
this.Destroy=function()
|
|
2364
|
+
{
|
|
2365
|
+
if (this.DivDialog)
|
|
2366
|
+
{
|
|
2367
|
+
document.body.removeChild(this.DivDialog);
|
|
2368
|
+
this.DivDialog=null;
|
|
2369
|
+
this.DivContent=null;
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
this.HQChart=null;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
this.Hide=function()
|
|
2376
|
+
{
|
|
2377
|
+
if (!this.DivDialog) return;
|
|
2378
|
+
if (this.DivDialog.style.visibility!='hidden') this.DivDialog.style.visibility='hidden';
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
this.Create=function()
|
|
2382
|
+
{
|
|
2383
|
+
var divDom=document.createElement("div");
|
|
2384
|
+
divDom.className='UMyChart_Small_Tooltip_Div';
|
|
2385
|
+
|
|
2386
|
+
var divContent=document.createElement("div");
|
|
2387
|
+
divContent.className='UMyChart_Small_Tooltip_Content_Div';
|
|
2388
|
+
divDom.appendChild(divContent);
|
|
2389
|
+
|
|
2390
|
+
document.body.appendChild(divDom);
|
|
2391
|
+
|
|
2392
|
+
this.DivContent=divContent;
|
|
2393
|
+
this.DivDialog=divDom;
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
this.IsShow=function()
|
|
2397
|
+
{
|
|
2398
|
+
if (!this.DivDialog) return false;
|
|
2399
|
+
|
|
2400
|
+
return this.DivDialog.style.visibility==='visible';
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
this.ShowTooltip=function(data)
|
|
2404
|
+
{
|
|
2405
|
+
if (!data.Point) return;
|
|
2406
|
+
|
|
2407
|
+
var x=data.Point.X;
|
|
2408
|
+
var y=data.Point.Y;
|
|
2409
|
+
this.Show(x, y, { YMove:data.Point.YMove });
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
this.Show=function(x, y, option)
|
|
2413
|
+
{
|
|
2414
|
+
if (!this.DivDialog) return;
|
|
2415
|
+
if (!this.HQChart) return;
|
|
2416
|
+
|
|
2417
|
+
var rtClient=this.HQChart.UIElement.getBoundingClientRect();
|
|
2418
|
+
var yMove=0;
|
|
2419
|
+
if (option && IFrameSplitOperator.IsNumber(option.YMove)) yMove=option.YMove;
|
|
2420
|
+
|
|
2421
|
+
var left=x+rtClient.left,top=y+rtClient.top+yMove;
|
|
2422
|
+
var right=left+this.DivDialog.offsetWidth;
|
|
2423
|
+
var bottom=top+this.DivDialog.offsetHeight;
|
|
2424
|
+
|
|
2425
|
+
if ((right+5)>=window.innerWidth) left=left-this.DivDialog.offsetWidth;
|
|
2426
|
+
if ((bottom+5)>=window.innerHeight)
|
|
2427
|
+
{
|
|
2428
|
+
top=(y+rtClient.top)-this.DivDialog.offsetHeight;
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
this.DivDialog.style.top = top + "px";
|
|
2432
|
+
this.DivDialog.style.left = left + "px";
|
|
2433
|
+
|
|
2434
|
+
if (this.DivDialog.style.visibility!='visible')
|
|
2435
|
+
this.DivDialog.style.visibility='visible';
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
this.Update=function(data)
|
|
2439
|
+
{
|
|
2440
|
+
var text=data.Data.Data.Text;
|
|
2441
|
+
if (!this.DivContent) return false;
|
|
2442
|
+
|
|
2443
|
+
this.DivContent.innerText=text;
|
|
2444
|
+
|
|
2445
|
+
this.ShowTooltip(data);
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
|
|
2450
|
+
function JSSmallFloatTooltipV2()
|
|
2451
|
+
{
|
|
2452
|
+
this.newMethod=JSSmallFloatTooltip; //派生
|
|
2453
|
+
this.newMethod();
|
|
2454
|
+
delete this.newMethod;
|
|
2455
|
+
|
|
2456
|
+
this.ClassName="JSSmallFloatTooltipV2";
|
|
2457
|
+
|
|
2458
|
+
this.AryData=[]; //输出文字信息
|
|
2459
|
+
this.AryText=[]; //表格tr
|
|
2460
|
+
this.MaxRowCount=25;
|
|
2461
|
+
|
|
2462
|
+
this.BGColor=g_JSChartResource.SmallFloatTooltipV2.BGColor;
|
|
2463
|
+
this.BorderColor=g_JSChartResource.SmallFloatTooltipV2.BorderColor;
|
|
2464
|
+
|
|
2465
|
+
this.TextColor=g_JSChartResource.SmallFloatTooltipV2.TextColor;
|
|
2466
|
+
this.ValueColor=g_JSChartResource.SmallFloatTooltipV2.ValueColor;
|
|
2467
|
+
|
|
2468
|
+
this.ValueAlign=
|
|
2469
|
+
{
|
|
2470
|
+
Left:"UMyChart_Small_Tooltip_V2_Text2_Span", //左对齐
|
|
2471
|
+
MarginLeft:'UMyChart_Small_Tooltip_V2_Text3_Span',
|
|
2472
|
+
Right:"UMyChart_Small_Tooltip_V2_Text_Span",
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
this.TitleAlign=
|
|
2476
|
+
{
|
|
2477
|
+
Default:"UMyChart_Small_Tooltip_V2_Title_Span", //标题默认
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
this.Destroy=function()
|
|
2481
|
+
{
|
|
2482
|
+
this.AryData=[];
|
|
2483
|
+
this.AryText=[];
|
|
2484
|
+
this.HQChart=null;
|
|
2485
|
+
|
|
2486
|
+
if (this.DivDialog)
|
|
2487
|
+
{
|
|
2488
|
+
document.body.removeChild(this.DivDialog);
|
|
2489
|
+
this.DivDialog=null;
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2493
|
+
this.Create=function()
|
|
2494
|
+
{
|
|
2495
|
+
var divDom=document.createElement("div");
|
|
2496
|
+
divDom.className='UMyChart_Small_Tooltip_V2_Div';
|
|
2497
|
+
|
|
2498
|
+
var table=document.createElement("table");
|
|
2499
|
+
table.className="UMyChart_Small_Tooltip_V2_Table";
|
|
2500
|
+
divDom.appendChild(table);
|
|
2501
|
+
|
|
2502
|
+
var tbody=document.createElement("tbody");
|
|
2503
|
+
tbody.className="UMyChart_Small_Tooltip_V2_Tbody";
|
|
2504
|
+
table.appendChild(tbody);
|
|
2505
|
+
|
|
2506
|
+
this.AryData=[];
|
|
2507
|
+
|
|
2508
|
+
for(var i=0;i<this.MaxRowCount;++i)
|
|
2509
|
+
{
|
|
2510
|
+
var rowItem={ Tr:null, TitleSpan:null, TextSpan:null, TitleTd:null, TextTd:null };
|
|
2511
|
+
|
|
2512
|
+
var trDom=document.createElement("tr");
|
|
2513
|
+
trDom.className='UMyChart_Small_Tooltip_V2_Group_Tr';
|
|
2514
|
+
tbody.appendChild(trDom);
|
|
2515
|
+
rowItem.Tr=trDom;
|
|
2516
|
+
|
|
2517
|
+
var tdDom=document.createElement("td");
|
|
2518
|
+
tdDom.className="UMyChart_Small_Tooltip_V2_Title_Td"; //标题
|
|
2519
|
+
trDom.appendChild(tdDom);
|
|
2520
|
+
rowItem.TitleTd=tdDom;
|
|
2521
|
+
|
|
2522
|
+
var spanDom=document.createElement("span");
|
|
2523
|
+
spanDom.className=this.TitleAlign.Default;
|
|
2524
|
+
spanDom.innerText='标题';
|
|
2525
|
+
tdDom.appendChild(spanDom);
|
|
2526
|
+
rowItem.TitleSpan=spanDom;
|
|
2527
|
+
|
|
2528
|
+
var tdDom=document.createElement("td");
|
|
2529
|
+
tdDom.className="UMyChart_Small_Tooltip_V2_Text_Td"; //数值
|
|
2530
|
+
trDom.appendChild(tdDom);
|
|
2531
|
+
rowItem.TextTd=tdDom;
|
|
2532
|
+
|
|
2533
|
+
var spanDom=document.createElement("span");
|
|
2534
|
+
spanDom.className='UMyChart_Small_Tooltip_V2_Text_Span';
|
|
2535
|
+
spanDom.innerText='数值';
|
|
2536
|
+
tdDom.appendChild(spanDom);
|
|
2537
|
+
rowItem.TextSpan=spanDom;
|
|
2538
|
+
|
|
2539
|
+
this.AryData.push(rowItem);
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
document.body.appendChild(divDom);
|
|
2543
|
+
|
|
2544
|
+
this.DivDialog=divDom;
|
|
2545
|
+
|
|
2546
|
+
this.UpdateStyle();
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
this.UpdateStyle=function()
|
|
2550
|
+
{
|
|
2551
|
+
if (!this.DivDialog) return;
|
|
2552
|
+
|
|
2553
|
+
if (this.BGColor) this.DivDialog.style['background-color']=this.BGColor;
|
|
2554
|
+
if (this.BorderColor) this.DivDialog.style['border-color']=this.BorderColor;
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
this.Update=function(data)
|
|
2558
|
+
{
|
|
2559
|
+
if (!this.DivDialog) return;
|
|
2560
|
+
|
|
2561
|
+
this.AryText=[];
|
|
2562
|
+
for(var i=0;i<data.AryData.length;++i)
|
|
2563
|
+
{
|
|
2564
|
+
var item=data.AryData[i];
|
|
2565
|
+
if (item.Type==1) this.UpdateDefaultTooltip(item);
|
|
2566
|
+
//else if (item.Type==2) this.Updateddd();
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
this.UpdateTableDOM();
|
|
2570
|
+
this.ShowTooltip(data);
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
this.UpdateDefaultTooltip=function(data)
|
|
2574
|
+
{
|
|
2575
|
+
var text=data.Data.Text;
|
|
2576
|
+
var rowItem={ Text:"", HTMLTitle:text, Color:this.ValueColor, IsMergeCell:true };
|
|
2577
|
+
this.AryText.push(rowItem);
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
this.UpdateTableDOM=function()
|
|
2581
|
+
{
|
|
2582
|
+
var index=0;
|
|
2583
|
+
for(index=0;index<this.AryText.length && index<this.MaxRowCount;++index)
|
|
2584
|
+
{
|
|
2585
|
+
var outItem=this.AryText[index];
|
|
2586
|
+
var item=this.AryData[index];
|
|
2587
|
+
|
|
2588
|
+
if (outItem.HTMLTitle) item.TitleSpan.innerHTML=outItem.HTMLTitle
|
|
2589
|
+
else item.TitleSpan.innerText=outItem.Title;
|
|
2590
|
+
|
|
2591
|
+
if (outItem.TitleColor) item.TitleSpan.style.color=outItem.TitleColor;
|
|
2592
|
+
else item.TitleSpan.style.color=this.TextColor;
|
|
2593
|
+
|
|
2594
|
+
if (outItem.HTMLText) item.TextSpan.innerHTML=outItem.HTMLText
|
|
2595
|
+
else item.TextSpan.innerText=outItem.Text;
|
|
2596
|
+
|
|
2597
|
+
item.TextSpan.style.color=outItem.Color;
|
|
2598
|
+
item.TextTd.style.color=outItem.Color;
|
|
2599
|
+
|
|
2600
|
+
if (outItem.ClassName)
|
|
2601
|
+
{
|
|
2602
|
+
item.TextSpan.className=outItem.ClassName;
|
|
2603
|
+
}
|
|
2604
|
+
else
|
|
2605
|
+
{
|
|
2606
|
+
if (item.TextSpan.className!=this.ValueAlign.Right) item.TextSpan.className=this.ValueAlign.Right;
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
if (outItem.TitleClassName)
|
|
2610
|
+
{
|
|
2611
|
+
item.TitleSpan.className=outItem.TitleClassName;
|
|
2612
|
+
}
|
|
2613
|
+
else
|
|
2614
|
+
{
|
|
2615
|
+
if (item.TitleSpan.className!=this.TitleAlign.Default) item.TitleSpan.className=this.TitleAlign.Default;
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
if (outItem.IsMergeCell) //合并单元格
|
|
2619
|
+
{
|
|
2620
|
+
item.TitleTd.colspan=2;
|
|
2621
|
+
item.TextTd.style.display="none";
|
|
2622
|
+
}
|
|
2623
|
+
else
|
|
2624
|
+
{
|
|
2625
|
+
if (item.TitleTd.colspan!=1) item.TitleTd.colspan=1;
|
|
2626
|
+
item.TextTd.style.display="";
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
item.Tr.style.display="";
|
|
2630
|
+
if (item.Tr2) item.Tr2.style.display="none";
|
|
2631
|
+
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
for( ; index<this.MaxRowCount; ++index)
|
|
2635
|
+
{
|
|
2636
|
+
var item=this.AryData[index];
|
|
2637
|
+
item.Tr.style.display="none";
|
|
2638
|
+
if (item.Tr2) item.Tr2.style.display="none";
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
function JSSmallFloatTooltipGroup()
|
|
2644
|
+
{
|
|
2645
|
+
this.AryTooltip=[];
|
|
2646
|
+
this.HQChart=null;
|
|
2647
|
+
this.MaxCount=5;
|
|
2648
|
+
this.MaxRowCount=15;
|
|
2649
|
+
this.Style=0;
|
|
2650
|
+
|
|
2651
|
+
this.Inital=function(hqchart, option)
|
|
2652
|
+
{
|
|
2653
|
+
this.HQChart=hqchart;
|
|
2654
|
+
if (option)
|
|
2655
|
+
{
|
|
2656
|
+
if (IFrameSplitOperator.IsNumber(option.Style)) this.Style=option.Style;
|
|
2657
|
+
if (IFrameSplitOperator.IsNumber(option.MaxRowCount)) this.Style=option.MaxRowCount;
|
|
2658
|
+
if (IFrameSplitOperator.IsNumber(option.MaxCount)) this.Style=option.MaxCount;
|
|
2659
|
+
}
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
this.CreateTooltipDom=function()
|
|
2663
|
+
{
|
|
2664
|
+
var item=null;
|
|
2665
|
+
if (this.Style==1)
|
|
2666
|
+
{
|
|
2667
|
+
item=new JSSmallFloatTooltipV2();
|
|
2668
|
+
item.MaxRowCount=this.MaxRowCount;
|
|
2669
|
+
}
|
|
2670
|
+
else
|
|
2671
|
+
{
|
|
2672
|
+
item=new JSSmallFloatTooltip();
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2675
|
+
item.HQChart=this.HQChart;
|
|
2676
|
+
return item;
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
this.Create=function()
|
|
2680
|
+
{
|
|
2681
|
+
for(var i=0;i<this.MaxCount;++i)
|
|
2682
|
+
{
|
|
2683
|
+
var item=this.CreateTooltipDom();
|
|
2684
|
+
|
|
2685
|
+
item.Create();
|
|
2686
|
+
this.AryTooltip.push(item);
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
this.Destroy=function()
|
|
2691
|
+
{
|
|
2692
|
+
for(var i=0;i<this.AryTooltip.length;++i)
|
|
2693
|
+
{
|
|
2694
|
+
var item=this.AryTooltip[i];
|
|
2695
|
+
item.Destroy();
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
this.AryTooltip=[];
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
this.Update=function(data)
|
|
2702
|
+
{
|
|
2703
|
+
if (this.Style==1)
|
|
2704
|
+
{
|
|
2705
|
+
this.UpdateV2(data);
|
|
2706
|
+
return;
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2709
|
+
var tooltipData=data.Tooltip;
|
|
2710
|
+
var pixelTatio = GetDevicePixelRatio();
|
|
2711
|
+
if (pixelTatio===0) pixelTatio=1;
|
|
2712
|
+
for(var i=0; i<tooltipData.AryData.length && i<this.AryTooltip.length; ++i)
|
|
2713
|
+
{
|
|
2714
|
+
var item=tooltipData.AryData[i];
|
|
2715
|
+
var tooltipItem=this.AryTooltip[i];
|
|
2716
|
+
|
|
2717
|
+
//去掉分辨率倍数
|
|
2718
|
+
var x=tooltipData.X/pixelTatio;
|
|
2719
|
+
var y=item.Y/pixelTatio;
|
|
2720
|
+
tooltipItem.Update({ Data:item, Point:{ X:x, Y:y} });
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
for(var i=tooltipData.AryData.length; i<this.AryTooltip.length; ++i)
|
|
2724
|
+
{
|
|
2725
|
+
var item=this.AryTooltip[i];
|
|
2726
|
+
item.Hide();
|
|
2727
|
+
}
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
//Style==1 同价格合并输出
|
|
2731
|
+
this.UpdateV2=function(data)
|
|
2732
|
+
{
|
|
2733
|
+
var tooltipData=data.Tooltip;
|
|
2734
|
+
var pixelTatio = GetDevicePixelRatio();
|
|
2735
|
+
if (pixelTatio===0) pixelTatio=1;
|
|
2736
|
+
|
|
2737
|
+
var x=tooltipData.X/pixelTatio;
|
|
2738
|
+
var mapTooltip=new Map(); //根据Y轴 归类
|
|
2739
|
+
for(var i=0; i<tooltipData.AryData.length;++i)
|
|
2740
|
+
{
|
|
2741
|
+
var item=tooltipData.AryData[i];
|
|
2742
|
+
var key=parseInt(item.Y);
|
|
2743
|
+
if (mapTooltip.has(key))
|
|
2744
|
+
{
|
|
2745
|
+
var mapItem=mapTooltip.get(key);
|
|
2746
|
+
mapItem.AryData.push(item);
|
|
2747
|
+
}
|
|
2748
|
+
else
|
|
2749
|
+
{
|
|
2750
|
+
mapTooltip.set(key, { Key:key, Point:{ X:x, Y:item.Y/pixelTatio }, AryData:[ item ] });
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
var aryData=[];
|
|
2755
|
+
for(var mapItem of mapTooltip) aryData.push(mapItem[1]);
|
|
2756
|
+
|
|
2757
|
+
for(var i=0; i<aryData.length && i<this.AryTooltip.length; ++i)
|
|
2758
|
+
{
|
|
2759
|
+
var item=aryData[i];
|
|
2760
|
+
var tooltipItem=this.AryTooltip[i];
|
|
2761
|
+
tooltipItem.Update(item);
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
for(var i=tooltipData.AryData.length; i<this.AryTooltip.length; ++i)
|
|
2765
|
+
{
|
|
2766
|
+
var item=this.AryTooltip[i];
|
|
2767
|
+
item.Hide();
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
this.Hide=function()
|
|
2772
|
+
{
|
|
2773
|
+
for(var i=0;i<this.AryTooltip.length;++i)
|
|
2774
|
+
{
|
|
2775
|
+
var item=this.AryTooltip[i];
|
|
2776
|
+
item.Hide();
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2356
2779
|
}
|
|
@@ -9309,6 +9309,55 @@ function JSDraw(errorHandler,symbolData)
|
|
|
9309
9309
|
this.ErrorHandler=errorHandler;
|
|
9310
9310
|
this.SymbolData=symbolData;
|
|
9311
9311
|
|
|
9312
|
+
//绘制随光标移动的浮动文字。
|
|
9313
|
+
//用法: DRAWFLAGTEXT(COND,PRICE,TEXT),光标处当COND条件满足时,在PRICE位置用半透明窗口显示文字TEXT,随光标移动而移动。将\\n插入TEXT内容中可实现文字换行。
|
|
9314
|
+
//例如:DRAWFLAGTEXT(CLOSE/OPEN>1.08,LOW,'大阳线')表示当光标移动到涨幅大于8%的地方,在最低价位置显示'大阳线'字样的浮动窗口。
|
|
9315
|
+
this.DRAWFLAGTEXT=function(condition,price,text)
|
|
9316
|
+
{
|
|
9317
|
+
var drawData=[];
|
|
9318
|
+
var result={ DrawData:drawData, DrawType:'DRAWFLAGTEXT' };
|
|
9319
|
+
if (!text) return result;
|
|
9320
|
+
|
|
9321
|
+
if (Array.isArray(condition))
|
|
9322
|
+
{
|
|
9323
|
+
if (condition.length<=0) return result;
|
|
9324
|
+
|
|
9325
|
+
var bSinglePrice=IFrameSplitOperator.IsNumber(price);
|
|
9326
|
+
for(var i=0; i<condition.length; ++i)
|
|
9327
|
+
{
|
|
9328
|
+
drawData[i]=null;
|
|
9329
|
+
|
|
9330
|
+
if (isNaN(condition[i]) || !condition[i]) continue;
|
|
9331
|
+
|
|
9332
|
+
if (bSinglePrice)
|
|
9333
|
+
{
|
|
9334
|
+
drawData[i]={ YValue:price, Text:text };
|
|
9335
|
+
}
|
|
9336
|
+
else
|
|
9337
|
+
{
|
|
9338
|
+
if (IFrameSplitOperator.IsNumber(price[i])) drawData[i]={ YValue:price[i], Text:text };
|
|
9339
|
+
}
|
|
9340
|
+
}
|
|
9341
|
+
}
|
|
9342
|
+
else if (IFrameSplitOperator.IsPlusNumber(condition))
|
|
9343
|
+
{
|
|
9344
|
+
var bSinglePrice=IFrameSplitOperator.IsNumber(price);
|
|
9345
|
+
for(var i=0;i<this.SymbolData.Data.Data.length;++i)
|
|
9346
|
+
{
|
|
9347
|
+
if (bSinglePrice)
|
|
9348
|
+
{
|
|
9349
|
+
drawData[i]={ YValue:price, Text:text };
|
|
9350
|
+
}
|
|
9351
|
+
else
|
|
9352
|
+
{
|
|
9353
|
+
if (IFrameSplitOperator.IsNumber(price[i])) drawData[i]={ YValue:price[i], Text:text };
|
|
9354
|
+
}
|
|
9355
|
+
}
|
|
9356
|
+
}
|
|
9357
|
+
|
|
9358
|
+
return result;
|
|
9359
|
+
}
|
|
9360
|
+
|
|
9312
9361
|
this.DRAWTEXT=function(condition,price,text)
|
|
9313
9362
|
{
|
|
9314
9363
|
let drawData=[];
|
|
@@ -11689,6 +11738,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
|
|
|
11689
11738
|
"VERTLINE","HORLINE","TIPICON",
|
|
11690
11739
|
"BUY","SELL","SELLSHORT","BUYSHORT",
|
|
11691
11740
|
"DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE","DRAWPIE","DRAWRADAR","DRAWDOUGHNUT",
|
|
11741
|
+
"DRAWFLAGTEXT"
|
|
11692
11742
|
]);
|
|
11693
11743
|
if (setFunctionName.has(name)) return true;
|
|
11694
11744
|
|
|
@@ -18254,6 +18304,10 @@ function JSExecute(ast,option)
|
|
|
18254
18304
|
node.Draw=this.Draw.DRAWTEXT_FIX(args[0],args[1],args[2],args[3],args[4]);
|
|
18255
18305
|
node.Out=[];
|
|
18256
18306
|
break;
|
|
18307
|
+
case "DRAWFLAGTEXT":
|
|
18308
|
+
node.Draw=this.Draw.DRAWFLAGTEXT(args[0],args[1],args[2]);
|
|
18309
|
+
node.Out=[];
|
|
18310
|
+
break;
|
|
18257
18311
|
case 'SUPERDRAWTEXT':
|
|
18258
18312
|
node.Draw=this.Draw.SUPERDRAWTEXT(args[0],args[1],args[2],args[3],args[4]);
|
|
18259
18313
|
node.Out=[];
|
|
@@ -21079,6 +21133,22 @@ function ScriptIndex(name,script,args,option)
|
|
|
21079
21133
|
hqChart.ChartPaint.push(chartText);
|
|
21080
21134
|
}
|
|
21081
21135
|
|
|
21136
|
+
this.CreateDrawFlagText=function(hqChart,windowIndex,varItem,id)
|
|
21137
|
+
{
|
|
21138
|
+
var chart=new ChartDrawFlagText();
|
|
21139
|
+
chart.Canvas=hqChart.Canvas;
|
|
21140
|
+
chart.Name=varItem.Name;
|
|
21141
|
+
chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
21142
|
+
chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
21143
|
+
if (chart.ReloadResource) chart.ReloadResource();
|
|
21144
|
+
|
|
21145
|
+
chart.Data=hqChart.GetKData();
|
|
21146
|
+
if (varItem.Draw.DrawData) chart.AryData=varItem.Draw.DrawData;
|
|
21147
|
+
chart.BuildCacheData();
|
|
21148
|
+
|
|
21149
|
+
hqChart.ChartPaint.push(chart);
|
|
21150
|
+
}
|
|
21151
|
+
|
|
21082
21152
|
//COLORSTICK
|
|
21083
21153
|
this.CreateMACD=function(hqChart,windowIndex,varItem,id)
|
|
21084
21154
|
{
|
|
@@ -22545,6 +22615,9 @@ function ScriptIndex(name,script,args,option)
|
|
|
22545
22615
|
case 'DRAWTEXT':
|
|
22546
22616
|
this.CreateDrawTextV2(hqChart,windowIndex,item,i);
|
|
22547
22617
|
break;
|
|
22618
|
+
case "DRAWFLAGTEXT":
|
|
22619
|
+
this.CreateDrawFlagText(hqChart,windowIndex,item,i);
|
|
22620
|
+
break;
|
|
22548
22621
|
case 'SUPERDRAWTEXT':
|
|
22549
22622
|
this.CreateText(hqChart,windowIndex,item,i);
|
|
22550
22623
|
break;
|
|
@@ -22966,6 +23039,8 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
22966
23039
|
case 'DRAWTEXT':
|
|
22967
23040
|
this.CreateDrawTextV2(hqChart,windowIndex,item,i);
|
|
22968
23041
|
break;
|
|
23042
|
+
case "DRAWFLAGTEXT":
|
|
23043
|
+
this.CreateDrawFlagText(hqChart,windowIndex,item,i);
|
|
22969
23044
|
case 'SUPERDRAWTEXT':
|
|
22970
23045
|
this.CreateText(hqChart,windowIndex,item,i);
|
|
22971
23046
|
break;
|
|
@@ -23330,6 +23405,25 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
23330
23405
|
frame.ChartPaint.push(chartText);
|
|
23331
23406
|
}
|
|
23332
23407
|
|
|
23408
|
+
this.CreateDrawFlagText=function(hqChart,windowIndex,varItem,id)
|
|
23409
|
+
{
|
|
23410
|
+
var overlayIndex=this.OverlayIndex;
|
|
23411
|
+
var frame=overlayIndex.Frame;
|
|
23412
|
+
var chart=new ChartDrawFlagText();
|
|
23413
|
+
chart.Canvas=hqChart.Canvas;
|
|
23414
|
+
chart.Name=varItem.Name;
|
|
23415
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
23416
|
+
chart.ChartFrame=frame.Frame;
|
|
23417
|
+
chart.Identify=overlayIndex.Identify;
|
|
23418
|
+
if (chart.ReloadResource) chart.ReloadResource();
|
|
23419
|
+
|
|
23420
|
+
chart.Data=hqChart.GetKData();
|
|
23421
|
+
if (varItem.Draw.DrawData) chart.AryData=varItem.Draw.DrawData;
|
|
23422
|
+
chart.BuildCacheData();
|
|
23423
|
+
|
|
23424
|
+
frame.ChartPaint.push(chart);
|
|
23425
|
+
}
|
|
23426
|
+
|
|
23333
23427
|
//创建文本
|
|
23334
23428
|
this.CreateText=function(hqChart,windowIndex,varItem,id, drawName)
|
|
23335
23429
|
{
|