hqchart 1.1.13238 → 1.1.13245
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 +177 -184
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +427 -0
- package/src/jscommon/umychart.complier.js +2 -2
- package/src/jscommon/umychart.js +51 -286
- package/src/jscommon/umychart.resource/css/tools.css +102 -0
- package/src/jscommon/umychart.resource/css/umychart.drawtool.dailog.css +98 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +54 -289
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +482 -289
|
@@ -5581,6 +5581,9 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5581
5581
|
//内置菜单
|
|
5582
5582
|
if (option.EnablePopMenuV2===true) chart.InitalPopMenu();
|
|
5583
5583
|
|
|
5584
|
+
//画图工具
|
|
5585
|
+
if (option.EnableDrawToolDialogV2===true) chart.InitalDrawToolDialog();
|
|
5586
|
+
|
|
5584
5587
|
//注册事件
|
|
5585
5588
|
if (option.EventCallback)
|
|
5586
5589
|
{
|
|
@@ -6831,6 +6834,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6831
6834
|
this.JSPopMenu; //内置菜单
|
|
6832
6835
|
this.IsShowRightMenu=true; //显示右键菜单
|
|
6833
6836
|
|
|
6837
|
+
this.DialogDrawTool; //画图工具
|
|
6838
|
+
|
|
6834
6839
|
|
|
6835
6840
|
this.ClearStockCache=function()
|
|
6836
6841
|
{
|
|
@@ -6845,6 +6850,37 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6845
6850
|
this.JSPopMenu.Inital();
|
|
6846
6851
|
}
|
|
6847
6852
|
|
|
6853
|
+
this.InitalDrawToolDialog=function()
|
|
6854
|
+
{
|
|
6855
|
+
if (this.DialogDrawTool) return;
|
|
6856
|
+
|
|
6857
|
+
this.DialogDrawTool=new JSDialogDrawTool();
|
|
6858
|
+
this.DialogDrawTool.Inital(this);
|
|
6859
|
+
this.DialogDrawTool.Create();
|
|
6860
|
+
}
|
|
6861
|
+
|
|
6862
|
+
this.ShowDrawToolDialog=function(x,y)
|
|
6863
|
+
{
|
|
6864
|
+
if (!this.DialogDrawTool) return;
|
|
6865
|
+
|
|
6866
|
+
var rtClient=this.UIElement.getBoundingClientRect();
|
|
6867
|
+
var rtScroll=GetScrollPosition();
|
|
6868
|
+
|
|
6869
|
+
var top=this.UIElement.offsetTop+15;
|
|
6870
|
+
var left=this.UIElement.offsetWidth-this.DialogDrawTool.DivDialog.offsetWidth-15;
|
|
6871
|
+
left+=rtClient.left+rtScroll.Left;
|
|
6872
|
+
top+=rtClient.top+rtScroll.Top;
|
|
6873
|
+
|
|
6874
|
+
this.DialogDrawTool.Show(left,top);
|
|
6875
|
+
}
|
|
6876
|
+
|
|
6877
|
+
this.IsShowDrawToolDialog=function()
|
|
6878
|
+
{
|
|
6879
|
+
if (!this.DialogDrawTool) return false;
|
|
6880
|
+
|
|
6881
|
+
return this.DialogDrawTool.IsShow();
|
|
6882
|
+
}
|
|
6883
|
+
|
|
6848
6884
|
//obj={ Element:, Canvas: }
|
|
6849
6885
|
this.SetCorssCursorElement=function(obj)
|
|
6850
6886
|
{
|
|
@@ -11871,6 +11907,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11871
11907
|
if (drawPicture.PointCount!=drawPicture.Point.length) return false;
|
|
11872
11908
|
if (drawPicture.ClassName=="ChartDrawRuler") //尺子不用保存的
|
|
11873
11909
|
{
|
|
11910
|
+
if (drawPicture.FinishedCallback) drawPicture.FinishedCallback(drawPicture);
|
|
11874
11911
|
this.CurrentChartDrawPicture=null;
|
|
11875
11912
|
return true;
|
|
11876
11913
|
}
|
|
@@ -12056,7 +12093,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12056
12093
|
{
|
|
12057
12094
|
var item=this.ExtendChartPaint[i];
|
|
12058
12095
|
if (!item) continue;
|
|
12059
|
-
if (item.ClassName=="StockChip"
|
|
12096
|
+
if (item.ClassName=="StockChip")
|
|
12060
12097
|
{
|
|
12061
12098
|
if (IFrameSplitOperator.IsNumber(item.Width))
|
|
12062
12099
|
width+=item.Width;
|
|
@@ -13146,30 +13183,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13146
13183
|
}
|
|
13147
13184
|
break;
|
|
13148
13185
|
case JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID:
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
this.SetSizeChange(true);
|
|
13152
|
-
this.Draw();
|
|
13153
|
-
break;
|
|
13154
|
-
case JSCHART_MENU_ID.CMD_HIDE_DRAWTOOL_ID:
|
|
13155
|
-
var drawTools=this.GetExtendChartByClassName('DrawToolsButton');
|
|
13156
|
-
if (drawTools)
|
|
13157
|
-
{
|
|
13158
|
-
var toolsWidth=drawTools.Chart.Width;
|
|
13159
|
-
var toolsIndex=parseInt(drawTools.Index);
|
|
13160
|
-
for(var i=toolsIndex+1; i<this.ExtendChartPaint.length; ++i) //在画图工具后面创建的需要减去工具的宽度
|
|
13161
|
-
{
|
|
13162
|
-
var item=this.ExtendChartPaint[i];
|
|
13163
|
-
if (item.ClassName=='StockChip')
|
|
13164
|
-
{
|
|
13165
|
-
item.Left-=toolsWidth;
|
|
13166
|
-
}
|
|
13167
|
-
}
|
|
13168
|
-
this.DeleteExtendChart(drawTools);
|
|
13169
|
-
this.Frame.ChartBorder.Right-=toolsWidth;
|
|
13170
|
-
this.SetSizeChange(true);
|
|
13171
|
-
this.Draw();
|
|
13172
|
-
}
|
|
13186
|
+
if (!this.IsShowDrawToolDialog())
|
|
13187
|
+
this.ShowDrawToolDialog();
|
|
13173
13188
|
break;
|
|
13174
13189
|
case JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID:
|
|
13175
13190
|
var option={Name:'筹码分布', ShowType:1, Width:230 };
|
|
@@ -45901,235 +45916,6 @@ function StockChip()
|
|
|
45901
45916
|
}
|
|
45902
45917
|
}
|
|
45903
45918
|
|
|
45904
|
-
//画图工具条
|
|
45905
|
-
function DrawToolsButton()
|
|
45906
|
-
{
|
|
45907
|
-
this.newMethod=IExtendChartPainting; //派生
|
|
45908
|
-
this.newMethod();
|
|
45909
|
-
delete this.newMethod;
|
|
45910
|
-
|
|
45911
|
-
this.ClassName='DrawToolsButton';
|
|
45912
|
-
this.HQChart;
|
|
45913
|
-
this.ID=Guid();
|
|
45914
|
-
this.ToolsDiv;
|
|
45915
|
-
// this.Color='rgb(105,105,105)'; //颜色
|
|
45916
|
-
this.Color = "#696969"; //input type="color"不支持rgb的颜色格式
|
|
45917
|
-
|
|
45918
|
-
//this.Left=5;
|
|
45919
|
-
this.Top=5*GetDevicePixelRatio();
|
|
45920
|
-
this.Width=45*GetDevicePixelRatio(); //宽度
|
|
45921
|
-
|
|
45922
|
-
this.SetOption=function(option)
|
|
45923
|
-
{
|
|
45924
|
-
var pixelRatio=GetDevicePixelRatio();
|
|
45925
|
-
if (!option) return;
|
|
45926
|
-
if (option.Width>10) this.Width=option.Width*pixelRatio;
|
|
45927
|
-
}
|
|
45928
|
-
|
|
45929
|
-
this.Clear=function()
|
|
45930
|
-
{
|
|
45931
|
-
if (this.ToolsDiv) this.ChartBorder.UIElement.parentNode.removeChild(this.ToolsDiv);
|
|
45932
|
-
}
|
|
45933
|
-
|
|
45934
|
-
this.Draw = function () {
|
|
45935
|
-
if (this.SizeChange == false) return;
|
|
45936
|
-
|
|
45937
|
-
//工具列表
|
|
45938
|
-
const TOOL_LIST =
|
|
45939
|
-
[
|
|
45940
|
-
[
|
|
45941
|
-
{ HTML: { Title: '线段', IClass: 'iconfont icon-draw_line', ID: 'icon-segment' }, Name: '线段' },
|
|
45942
|
-
{ HTML: { Title: '尺子', IClass: 'iconfont icon-ruler', ID: 'icon_ruler' }, Name: '尺子' },
|
|
45943
|
-
{ HTML: { Title: '射线', IClass: 'iconfont icon-draw_rays', ID: 'icon-beam' }, Name: '射线' },
|
|
45944
|
-
{ HTML: { Title: '标价线', IClass: 'iconfont icon-price_line', ID: 'icon-price-line' }, Name: '标价线' },
|
|
45945
|
-
{ HTML: { Title: '垂直线', IClass: 'iconfont icon-vertical_line', ID: 'icon-vertical-line' }, Name: '垂直线' },
|
|
45946
|
-
{ HTML: { Title: '箭头', IClass: 'iconfont icon-draw_rays', ID: 'icon-beam2' }, Name: '箭头' },
|
|
45947
|
-
{ HTML: { Title: '趋势线', IClass: 'iconfont icon-draw_trendline', ID: 'icon-trendline' }, Name: '趋势线' },
|
|
45948
|
-
{ HTML: { Title: '水平线', IClass: 'iconfont icon-draw_hline', ID: 'icon-hline' }, Name: '水平线' },
|
|
45949
|
-
{ HTML: { Title: '水平线段', IClass: 'iconfont icon-draw_hlinesegment', ID: 'icon-hlineseg' }, Name: '水平线段' },
|
|
45950
|
-
{ HTML: { Title: '平行射线', IClass: 'iconfont icon-draw_p_rays_lines', ID: 'icon-rayslineseg' }, Name: '平行射线' },
|
|
45951
|
-
{ HTML: { Title: '平行线', IClass: 'iconfont icon-draw_parallel_lines', ID: 'icon-parallellines' }, Name: '平行线' },
|
|
45952
|
-
{ HTML: { Title: '平行通道', IClass: 'iconfont icon-draw_parallelchannel', ID: 'icon-parallelchannel' }, Name: '平行通道' },
|
|
45953
|
-
{ HTML: { Title: '价格通道线', IClass: 'iconfont icon-draw_pricechannel', ID: 'icon-pricechannel' }, Name: '价格通道线' },
|
|
45954
|
-
{ HTML: { Title: 'M头W底', IClass: 'iconfont icon-draw_wavemw', ID: 'icon-wavemw' }, Name: 'M头W底' },
|
|
45955
|
-
{ HTML: { Title: '头肩型', IClass: 'iconfont icon-draw_head_shoulders_bt', ID: 'icon-Head-Shoulders' }, Name: '头肩型' },
|
|
45956
|
-
{ HTML: { Title: '波浪尺', IClass: 'iconfont icon-waveruler', ID: 'icon-wave-ruler' }, Name: '波浪尺' },
|
|
45957
|
-
{ HTML: { Title: 'AB波浪尺', IClass: 'iconfont icon-waveruler', ID: 'icon-wave-ruler2' }, Name: 'AB波浪尺' },
|
|
45958
|
-
{ HTML: { Title: '箱型线', IClass: 'iconfont icon-draw_box', ID: 'icon-drawbox' }, Name: '箱型线' },
|
|
45959
|
-
{ HTML: { Title: '涂鸦线段', IClass: 'iconfont icon-draw_line', ID: 'icon-segment2' }, Name: '涂鸦线段' },
|
|
45960
|
-
|
|
45961
|
-
],
|
|
45962
|
-
[
|
|
45963
|
-
{ HTML: { Title: '圆弧', IClass: 'iconfont icon-draw_arc', ID: 'icon-arc' }, Name: '圆弧线' },
|
|
45964
|
-
{ HTML: { Title: '矩形', IClass: 'iconfont icon-rectangle', ID: 'icon-rect' }, Name: '矩形' },
|
|
45965
|
-
{ HTML: { Title: '平行四边形', IClass: 'iconfont icon-draw_quadrangle', ID: 'icon-quad' }, Name: '平行四边形' },
|
|
45966
|
-
{ HTML: { Title: '三角形', IClass: 'iconfont icon-draw_triangle', ID: 'icon-triangle' }, Name: '三角形' },
|
|
45967
|
-
{ HTML: { Title: '圆', IClass: 'iconfont icon-draw_circle', ID: 'icon-circle' }, Name: '圆' },
|
|
45968
|
-
{ HTML: { Title: '对称角度', IClass: 'iconfont icon-draw_symangle', ID: 'icon-symangle' }, Name: '对称角度' },
|
|
45969
|
-
],
|
|
45970
|
-
[
|
|
45971
|
-
{ HTML: { Title: '文本', IClass: 'iconfont icon-draw_text', ID: 'icon-text' }, Name: '文本' },
|
|
45972
|
-
{ HTML: { Title: '向上箭头', IClass: 'iconfont icon-arrow_up', ID: 'icon-arrowup' }, Name: 'icon-arrow_up' },
|
|
45973
|
-
{ HTML: { Title: '向下箭头', IClass: 'iconfont icon-arrow_down', ID: 'icon-arrowdown' }, Name: 'icon-arrow_down' },
|
|
45974
|
-
{ HTML: { Title: '向左箭头', IClass: 'iconfont icon-arrow_left', ID: 'icon-arrowleft' }, Name: 'icon-arrow_left' },
|
|
45975
|
-
{ HTML: { Title: '向右箭头', IClass: 'iconfont icon-arrow_right', ID: 'icon-arrowright' }, Name: 'icon-arrow_right' },
|
|
45976
|
-
],
|
|
45977
|
-
[
|
|
45978
|
-
{ HTML: { Title: '江恩角度线', IClass: 'iconfont icon-draw_gannfan', ID: 'icon-gannfan' }, Name: '江恩角度线' },
|
|
45979
|
-
{ HTML: { Title: '斐波那契周期线', IClass: 'iconfont icon-draw_fibonacci', ID: 'icon-fibonacci' }, Name: '斐波那契周期线' },
|
|
45980
|
-
{ HTML: { Title: '阻速线', IClass: 'iconfont icon-draw_resline', ID: 'icon-resline' }, Name: '阻速线' },
|
|
45981
|
-
{ HTML: { Title: '黄金分割', IClass: 'iconfont icon-draw_goldensection', ID: 'icon-goldensection' }, Name: '黄金分割' },
|
|
45982
|
-
{ HTML: { Title: '百分比线', IClass: 'iconfont icon-draw_percentage', ID: 'icon-percentage' }, Name: '百分比线' },
|
|
45983
|
-
{ HTML: { Title: '波段线', IClass: 'iconfont icon-draw_waveband', ID: 'icon-waveband' }, Name: '波段线' },
|
|
45984
|
-
{ HTML: { Title: '线形回归线', IClass: 'iconfont icon-linear_3', ID: 'icon-waveband2' }, Name: '线形回归线' },
|
|
45985
|
-
{ HTML: { Title: '线形回归带', IClass: 'iconfont icon-linear_1', ID: 'icon-waveband3' }, Name: '线形回归带' },
|
|
45986
|
-
{ HTML: { Title: '延长线形回归带', IClass: 'iconfont icon-linear_2', ID: 'icon-waveband5' }, Name: '延长线形回归带' },
|
|
45987
|
-
],
|
|
45988
|
-
[{ HTML: { Title: '全部删除', IClass: 'iconfont icon-recycle_bin', ID: 'icon-delete' }, Name: '全部删除' }]
|
|
45989
|
-
];
|
|
45990
|
-
|
|
45991
|
-
var hqChart = this.HQChart;
|
|
45992
|
-
|
|
45993
|
-
if (!this.ToolsDiv) {
|
|
45994
|
-
var div = document.createElement("div");
|
|
45995
|
-
div.className = 'drawtools';
|
|
45996
|
-
div.id = this.ID;
|
|
45997
|
-
|
|
45998
|
-
var spanList = ""; //一层菜单
|
|
45999
|
-
var menuTwoList = ""; //二层菜单
|
|
46000
|
-
var menuOne = new Array();
|
|
46001
|
-
TOOL_LIST.forEach(function(item,index){
|
|
46002
|
-
menuOne.push(item[0]);
|
|
46003
|
-
});
|
|
46004
|
-
for (var i = 0; i < TOOL_LIST.length; i++) {
|
|
46005
|
-
var itemOut = menuOne[i];
|
|
46006
|
-
var itemIn = TOOL_LIST[i];
|
|
46007
|
-
var menuTwoStr = "";
|
|
46008
|
-
var contentArrow = "";
|
|
46009
|
-
for (var j = 0; j < itemIn.length; j++) {
|
|
46010
|
-
var currentItem = itemIn[j];
|
|
46011
|
-
var menuTwoName = currentItem.Name;
|
|
46012
|
-
if(menuTwoName.indexOf('up') > -1){
|
|
46013
|
-
menuTwoName = "向上箭头";
|
|
46014
|
-
}else if(menuTwoName.indexOf('down') > -1){
|
|
46015
|
-
menuTwoName = "向下箭头";
|
|
46016
|
-
}else if(menuTwoName.indexOf('left') > -1){
|
|
46017
|
-
menuTwoName = "向左箭头";
|
|
46018
|
-
}else if(menuTwoName.indexOf('right') > -1){
|
|
46019
|
-
menuTwoName = "向右箭头";
|
|
46020
|
-
}
|
|
46021
|
-
menuTwoStr += '<p class="menuTwoItem ' + currentItem.HTML.ID + '">' + menuTwoName + '<i class="' + currentItem.HTML.IClass + '" title="' + currentItem.HTML.Title + '"></i></p>';
|
|
46022
|
-
}
|
|
46023
|
-
if (i !== TOOL_LIST.length - 1) { //不是“全部删除”项
|
|
46024
|
-
menuTwoList = '<div class="menuTwo">' + menuTwoStr + '</div>';
|
|
46025
|
-
contentArrow = '<i class="contentArrow iconfont icon-menu_arraw_left"></i>';
|
|
46026
|
-
} else {
|
|
46027
|
-
menuTwoList = "";
|
|
46028
|
-
contentArrow = "";
|
|
46029
|
-
}
|
|
46030
|
-
|
|
46031
|
-
var spanNode = '<div class="icon-image ' + 'first-' + itemOut.HTML.ID + '"><i class="' + itemOut.HTML.IClass + '" title="' + itemOut.HTML.Title + '"></i>' + menuTwoList + contentArrow +'</div>';
|
|
46032
|
-
spanList += spanNode;
|
|
46033
|
-
}
|
|
46034
|
-
this.ChartBorder.UIElement.parentNode.appendChild(div);
|
|
46035
|
-
|
|
46036
|
-
div.innerHTML = spanList;
|
|
46037
|
-
this.ToolsDiv = div;
|
|
46038
|
-
|
|
46039
|
-
for (var i in TOOL_LIST) {
|
|
46040
|
-
var item = TOOL_LIST[i][0];
|
|
46041
|
-
$('#' + this.ID + " .first-" + item.HTML.ID).hover(function(){ //箭头的旋转过渡
|
|
46042
|
-
$(".drawtools").find(".contentArrow").hide();
|
|
46043
|
-
$(this).find(".contentArrow").removeClass("trans").show();
|
|
46044
|
-
});
|
|
46045
|
-
$('#' + this.ID + " .first-" + item.HTML.ID+" .contentArrow").click(function(event){ //点击三角展示二级菜单
|
|
46046
|
-
event.stopPropagation();
|
|
46047
|
-
$(".drawtools").find(".menuTwo").hide();
|
|
46048
|
-
$(this).siblings('.menuTwo').show();
|
|
46049
|
-
});
|
|
46050
|
-
$('#' + this.ID + " .first-" + item.HTML.ID+" .trans").click(function(){ //点击三角隐藏二级菜单
|
|
46051
|
-
event.stopPropagation();
|
|
46052
|
-
$(this).siblings('.menuTwo').hide();
|
|
46053
|
-
});
|
|
46054
|
-
|
|
46055
|
-
|
|
46056
|
-
if (item.Name == '全部删除') {
|
|
46057
|
-
$('#' + this.ID + " .first-icon-delete").click(function () {
|
|
46058
|
-
$(".drawtools").find(".menuTwo").hide();
|
|
46059
|
-
$(this).siblings().removeClass('active');
|
|
46060
|
-
$(this).addClass('active');
|
|
46061
|
-
hqChart.ClearChartDrawPicture();
|
|
46062
|
-
$(".subTolls").css("display", "none");
|
|
46063
|
-
});
|
|
46064
|
-
}
|
|
46065
|
-
else {
|
|
46066
|
-
$('#' + this.ID + " .first-" + menuOne[i].HTML.ID).click( //一层菜单类名是:“first-”+item.HTML.ID
|
|
46067
|
-
{
|
|
46068
|
-
// DrawName: menuOne[i].Name, //把画法名字传进去
|
|
46069
|
-
CurrentIndex:i
|
|
46070
|
-
},
|
|
46071
|
-
function (event) {
|
|
46072
|
-
$(".drawtools").find(".menuTwo").hide();
|
|
46073
|
-
$(this).siblings().removeClass('active');
|
|
46074
|
-
$(this).addClass('active');
|
|
46075
|
-
hqChart.CreateChartDrawPicture(menuOne[event.data.CurrentIndex].Name);
|
|
46076
|
-
}
|
|
46077
|
-
);
|
|
46078
|
-
for (var j in TOOL_LIST[i]) {
|
|
46079
|
-
var itemTwo = TOOL_LIST[i][j];
|
|
46080
|
-
let classname = itemTwo.HTML.IClass; //闭包问题
|
|
46081
|
-
$('#' + this.ID + ' .' + itemTwo.HTML.ID).hover(function(event){
|
|
46082
|
-
event.stopPropagation();
|
|
46083
|
-
$(this).closest('.icon-image').find(".contentArrow").addClass("trans");
|
|
46084
|
-
});
|
|
46085
|
-
$('#' + this.ID + ' .' + itemTwo.HTML.ID).click(//二层菜单
|
|
46086
|
-
{
|
|
46087
|
-
DrawName: itemTwo.Name, //把画法名字传进去
|
|
46088
|
-
CurrentIndex:i,
|
|
46089
|
-
CurrentData:itemTwo
|
|
46090
|
-
},
|
|
46091
|
-
function (event) {
|
|
46092
|
-
event.stopPropagation();
|
|
46093
|
-
$(this).closest('.icon-image').find(".contentArrow").hide();
|
|
46094
|
-
$(this).siblings().removeClass("current");
|
|
46095
|
-
$(this).addClass("current");
|
|
46096
|
-
$(this).closest('.icon-image').children('i').eq(0).removeClass().addClass(classname,"active").attr('title',event.data.CurrentData.HTML.Title);
|
|
46097
|
-
menuOne.splice(event.data.CurrentIndex,1,event.data.CurrentData);
|
|
46098
|
-
$(this).parent().hide();
|
|
46099
|
-
hqChart.CreateChartDrawPicture(event.data.DrawName);
|
|
46100
|
-
}
|
|
46101
|
-
);
|
|
46102
|
-
}
|
|
46103
|
-
}
|
|
46104
|
-
}
|
|
46105
|
-
|
|
46106
|
-
}
|
|
46107
|
-
var curID = this.ID;
|
|
46108
|
-
$(document).click(function(event){
|
|
46109
|
-
if(!($("#"+curID).is(event.target)) && ($("#"+curID).has(event.target).length === 0)){
|
|
46110
|
-
$("#"+curID+" .menuTwo").hide();
|
|
46111
|
-
$("#"+curID+" .contentArrow").hide();
|
|
46112
|
-
}
|
|
46113
|
-
});
|
|
46114
|
-
var scrollPos = GetScrollPosition();
|
|
46115
|
-
var pixelRatio=GetDevicePixelRatio();
|
|
46116
|
-
// var left=this.ChartBorder.GetChartWidth()-this.Right-this.ToolsWidth;
|
|
46117
|
-
var left=ToFixedPoint(this.ChartBorder.GetRight()+this.Left);
|
|
46118
|
-
// var top = this.Top+this.ChartBorder.UIElement.getBoundingClientRect().top+scrollPos.Top;
|
|
46119
|
-
var top = this.ChartBorder.GetTop();
|
|
46120
|
-
this.ToolsDiv.style.left = left/pixelRatio + "px";
|
|
46121
|
-
this.ToolsDiv.style.top = top/pixelRatio + "px";
|
|
46122
|
-
this.ToolsDiv.style.width = (this.Width-5)/pixelRatio + "px";
|
|
46123
|
-
this.ToolsDiv.style.height = 'auto';
|
|
46124
|
-
this.ToolsDiv.style.position = "absolute";
|
|
46125
|
-
this.ToolsDiv.style.display = "block";
|
|
46126
|
-
// this.ToolsDiv.style.paddingLeft = "10px";
|
|
46127
|
-
|
|
46128
|
-
this.SizeChange == true;
|
|
46129
|
-
}
|
|
46130
|
-
}
|
|
46131
|
-
|
|
46132
|
-
|
|
46133
45919
|
//窗口分割
|
|
46134
45920
|
function FrameSplitPaint()
|
|
46135
45921
|
{
|
|
@@ -59354,7 +59140,7 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
59354
59140
|
{ Name:"固定范围成交量分布图", ClassName:"ChartDrawVolProfile", Create:function() { return new ChartDrawVolProfile(); }},
|
|
59355
59141
|
|
|
59356
59142
|
{ Name:"DisjointChannel", ClassName:"ChartDrawDisjontChannel", Create:function() { return new ChartDrawDisjontChannel();}},
|
|
59357
|
-
{ Name:"FlatTop", ClassName:"
|
|
59143
|
+
{ Name:"FlatTop", ClassName:"ChartDrawFlatTop", Create:function() { return new ChartDrawFlatTop();}},
|
|
59358
59144
|
|
|
59359
59145
|
{ Name:"水平线2", ClassName:"ChartDrawHLine", Create:function() { return new ChartDrawHLine(); }},
|
|
59360
59146
|
|
|
@@ -61525,7 +61311,7 @@ function ChartDrawPictureParallelLines()
|
|
|
61525
61311
|
}
|
|
61526
61312
|
|
|
61527
61313
|
|
|
61528
|
-
//FlatTop/Bottom
|
|
61314
|
+
//FlatTop/Bottom 平滑顶/底
|
|
61529
61315
|
function ChartDrawFlatTop()
|
|
61530
61316
|
{
|
|
61531
61317
|
this.newMethod=IChartDrawPicture; //派生
|
|
@@ -61612,7 +61398,7 @@ function ChartDrawFlatTop()
|
|
|
61612
61398
|
}
|
|
61613
61399
|
}
|
|
61614
61400
|
|
|
61615
|
-
//Disjont Channel
|
|
61401
|
+
//Disjont Channel 不相交通道 (未完成)
|
|
61616
61402
|
function ChartDrawDisjontChannel()
|
|
61617
61403
|
{
|
|
61618
61404
|
this.newMethod=ChartDrawFlatTop; //派生
|
|
@@ -75600,17 +75386,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
75600
75386
|
this.ExtendChartPaint.push(chart);
|
|
75601
75387
|
this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
|
|
75602
75388
|
return chart;
|
|
75603
|
-
case '画图工具':
|
|
75604
|
-
chart=new DrawToolsButton();
|
|
75605
|
-
chart.Canvas=this.Canvas;
|
|
75606
|
-
chart.ChartBorder=this.Frame.ChartBorder;
|
|
75607
|
-
chart.ChartFrame=this.Frame;
|
|
75608
|
-
chart.HQChart=this;
|
|
75609
|
-
chart.Left=this.Frame.ChartBorder.Right; //左边间距使用当前框架间距
|
|
75610
|
-
chart.SetOption(option);
|
|
75611
|
-
this.ExtendChartPaint.push(chart);
|
|
75612
|
-
this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
|
|
75613
|
-
return chart;
|
|
75614
75389
|
case 'KLineTooltip':
|
|
75615
75390
|
if (option.Create && typeof(option.Create)=='function') chart=option.Create();
|
|
75616
75391
|
else chart=new KLineTooltipPaint();
|
|
@@ -76624,6 +76399,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76624
76399
|
return true;
|
|
76625
76400
|
}
|
|
76626
76401
|
|
|
76402
|
+
this.ClearCurrnetDrawPicture=function()
|
|
76403
|
+
{
|
|
76404
|
+
this.CurrentChartDrawPicture=null;
|
|
76405
|
+
}
|
|
76406
|
+
|
|
76627
76407
|
this.AddChartDrawPicture=function(obj)
|
|
76628
76408
|
{
|
|
76629
76409
|
if (!obj) return null;
|
|
@@ -76811,9 +76591,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76811
76591
|
if (item && item.Symbol) aryOverlaySymbol.push(item.Symbol)
|
|
76812
76592
|
}
|
|
76813
76593
|
|
|
76814
|
-
var bBGSpit=false,
|
|
76594
|
+
var bBGSpit=false, bShowStockChip=false;
|
|
76815
76595
|
if (this.GetExtendChartByClassName("SessionBreaksPaint")) bBGSpit=true;
|
|
76816
|
-
if (this.GetExtendChartByClassName('DrawToolsButton')) bShowDrawTool=true; //画图工具
|
|
76817
76596
|
if (this.GetExtendChartByClassName('StockChip')) bShowStockChip=true; //筹码
|
|
76818
76597
|
|
|
76819
76598
|
var aryMenu=
|
|
@@ -76971,7 +76750,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76971
76750
|
|
|
76972
76751
|
{ Name:"背景分割", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_BG_SPLIT_ID, Args:[!bBGSpit]}, Checked:bBGSpit},
|
|
76973
76752
|
|
|
76974
|
-
{ Name:"画图工具", Data:{ ID:
|
|
76753
|
+
{ Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog()},
|
|
76975
76754
|
|
|
76976
76755
|
{ Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[]}, Checked:bShowStockChip},
|
|
76977
76756
|
]
|
|
@@ -80449,9 +80228,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
80449
80228
|
if (item && item.Symbol) aryOverlaySymbol.push(item.Symbol)
|
|
80450
80229
|
}
|
|
80451
80230
|
|
|
80452
|
-
var bShowDrawTool=false;
|
|
80453
|
-
if (this.GetExtendChartByClassName('DrawToolsButton')) bShowDrawTool=true; //画图工具
|
|
80454
|
-
|
|
80455
80231
|
var aryMenu=
|
|
80456
80232
|
[
|
|
80457
80233
|
{
|
|
@@ -80509,7 +80285,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
80509
80285
|
Name:"其他设置",
|
|
80510
80286
|
SubMenu:
|
|
80511
80287
|
[
|
|
80512
|
-
{ Name:"画图工具", Data:{ ID:
|
|
80288
|
+
{ Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog()},
|
|
80513
80289
|
]
|
|
80514
80290
|
}
|
|
80515
80291
|
|
|
@@ -83674,17 +83450,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
83674
83450
|
chart.SetOption(option);
|
|
83675
83451
|
this.ExtendChartPaint.push(chart);
|
|
83676
83452
|
return chart;
|
|
83677
|
-
case '画图工具':
|
|
83678
|
-
chart=new DrawToolsButton();
|
|
83679
|
-
chart.Canvas=this.Canvas;
|
|
83680
|
-
chart.ChartBorder=this.Frame.ChartBorder;
|
|
83681
|
-
chart.ChartFrame=this.Frame;
|
|
83682
|
-
chart.HQChart=this;
|
|
83683
|
-
chart.Left=this.Frame.ChartBorder.Right; //左边间距使用当前框架间距
|
|
83684
|
-
chart.SetOption(option);
|
|
83685
|
-
this.ExtendChartPaint.push(chart);
|
|
83686
|
-
this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
|
|
83687
|
-
return chart;
|
|
83688
83453
|
case "MinuteBackgroundPaint":
|
|
83689
83454
|
chart=new MinuteBackgroundPaint();
|
|
83690
83455
|
chart.Canvas=this.Canvas;
|
|
@@ -105850,7 +105615,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
105850
105615
|
{
|
|
105851
105616
|
for(var i in condition)
|
|
105852
105617
|
{
|
|
105853
|
-
drawData[i]=null;
|
|
105618
|
+
drawData.Data[i]=null;
|
|
105854
105619
|
if (!condition[i]) continue;
|
|
105855
105620
|
|
|
105856
105621
|
if (isNumber)
|
|
@@ -105875,7 +105640,7 @@ function JSDraw(errorHandler,symbolData)
|
|
|
105875
105640
|
var count=this.SymbolData.Data.Data.length;
|
|
105876
105641
|
for(var i=0; i<count; ++i)
|
|
105877
105642
|
{
|
|
105878
|
-
drawData[i]=null;
|
|
105643
|
+
drawData.Data[i]=null;
|
|
105879
105644
|
if (isNumber)
|
|
105880
105645
|
{
|
|
105881
105646
|
drawData.Data[i]=data;
|
|
@@ -134910,6 +134675,433 @@ JSPopMenu.POSITION_ID.TAB_MENU_ID=1;
|
|
|
134910
134675
|
JSPopMenu.POSITION_ID.DROPDOWN_MENU_ID=2; //左对齐下拉
|
|
134911
134676
|
JSPopMenu.POSITION_ID.DROPDOWN_RIGHT_MENU_ID=3; //右对齐下拉
|
|
134912
134677
|
JSPopMenu.SEPARATOR_LINE_NAME="MENU_SEPARATOR"; //分割线
|
|
134678
|
+
/*
|
|
134679
|
+
Copyright (c) 2018 jones
|
|
134680
|
+
|
|
134681
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
134682
|
+
|
|
134683
|
+
开源项目 https://github.com/jones2000/HQChart
|
|
134684
|
+
|
|
134685
|
+
jones_2000@163.com
|
|
134686
|
+
|
|
134687
|
+
内置画图工具 设置框
|
|
134688
|
+
*/
|
|
134689
|
+
|
|
134690
|
+
JS_DRAWTOOL_MENU_ID=
|
|
134691
|
+
{
|
|
134692
|
+
CMD_SELECTED_ID:1,
|
|
134693
|
+
CMD_CHANGE_LINE_COLOR_ID:2,
|
|
134694
|
+
CMD_DELETE_ALL_RAW_CHART_ID:3
|
|
134695
|
+
};
|
|
134696
|
+
|
|
134697
|
+
function JSDialogDrawTool()
|
|
134698
|
+
{
|
|
134699
|
+
this.AryChartGroup=
|
|
134700
|
+
[
|
|
134701
|
+
{
|
|
134702
|
+
Title:"线段",
|
|
134703
|
+
AryChart:
|
|
134704
|
+
[
|
|
134705
|
+
{ Title: '线段', ClassName: 'hqchart_drawtool icon-draw_line', Type:0, Data:{ ID:"线段" } },
|
|
134706
|
+
{ Title: '射线', ClassName: 'hqchart_drawtool icon-draw_rays', Type:0, Data:{ ID:"射线" } },
|
|
134707
|
+
{ Title: '标价线', ClassName: 'hqchart_drawtool icon-price_line', Type:0, Data:{ ID:"标价线" } },
|
|
134708
|
+
{ Title: '垂直线', ClassName: 'hqchart_drawtool icon-vertical_line', Type:0, Data:{ ID:"垂直线" } },
|
|
134709
|
+
{ Title: '箭头', ClassName: 'hqchart_drawtool icon-draw_rays', Type:0, Data:{ ID:"箭头" } },
|
|
134710
|
+
{ Title: '趋势线', ClassName: 'hqchart_drawtool icon-draw_trendline', Type:0, Data:{ ID:"趋势线" } },
|
|
134711
|
+
{ Title: '水平线', ClassName: 'hqchart_drawtool icon-draw_hline', Type:0, Data:{ ID:"水平线" } },
|
|
134712
|
+
{ Title: '涂鸦线段', ClassName: 'hqchart_drawtool icon-draw_line', Type:0, Data:{ ID:"涂鸦线段" } },
|
|
134713
|
+
]
|
|
134714
|
+
},
|
|
134715
|
+
{
|
|
134716
|
+
Title:"通道",
|
|
134717
|
+
AryChart:
|
|
134718
|
+
[
|
|
134719
|
+
{ Title: '平行线', ClassName: 'hqchart_drawtool icon-draw_parallel_lines', Type:0, Data:{ ID:"平行线" } },
|
|
134720
|
+
{ Title: '水平线段', ClassName: 'hqchart_drawtool icon-draw_hlinesegment', Type:0, Data:{ ID:"水平线段" } },
|
|
134721
|
+
{ Title: '平行射线', ClassName: 'hqchart_drawtool icon-draw_p_rays_lines', Type:0, Data:{ ID:"平行射线" } },
|
|
134722
|
+
{ Title: '平行通道', ClassName: 'hqchart_drawtool icon-draw_parallelchannel',Type:0, Data:{ ID:"平行通道" } },
|
|
134723
|
+
{ Title: '价格通道线', ClassName: 'hqchart_drawtool icon-draw_pricechannel', Type:0, Data:{ ID:"价格通道线" } },
|
|
134724
|
+
{ Title: '箱型线', ClassName: 'iconfont icon-draw_box', Type:0, Data:{ ID:"箱型线" } },
|
|
134725
|
+
{ Title:"不相交通道", ClassName:"hqchart_drawtool icon-buxiangjiaojiao", Type:0, Data:{ ID:"DisjointChannel"} },
|
|
134726
|
+
{ Title:"平滑顶/底", ClassName:"hqchart_drawtool icon-tubiao_buxiangjiaotongdao", Type:0, Data:{ ID:"FlatTop"}}
|
|
134727
|
+
]
|
|
134728
|
+
},
|
|
134729
|
+
{
|
|
134730
|
+
Title:"多边形",
|
|
134731
|
+
AryChart:
|
|
134732
|
+
[
|
|
134733
|
+
{ Title: '圆弧线', ClassName: 'hqchart_drawtool icon-draw_arc', Type:0, Data:{ ID:"圆弧线" } },
|
|
134734
|
+
{ Title: '矩形', ClassName: 'hqchart_drawtool icon-rectangle', Type:0, Data:{ ID:"矩形" } },
|
|
134735
|
+
{ Title: '平行四边形', ClassName: 'hqchart_drawtool icon-draw_quadrangle', Type:0, Data:{ ID:"平行四边形" } },
|
|
134736
|
+
{ Title: '三角形', ClassName: 'hqchart_drawtool icon-draw_triangle', Type:0, Data:{ ID:"三角形" } },
|
|
134737
|
+
{ Title: '圆', ClassName: 'hqchart_drawtool icon-draw_circle', Type:0, Data:{ ID:"圆" } },
|
|
134738
|
+
{ Title: '对称角度', ClassName: 'hqchart_drawtool icon-draw_symangle', Type:0, Data:{ ID:"对称角度" } },
|
|
134739
|
+
]
|
|
134740
|
+
},
|
|
134741
|
+
{
|
|
134742
|
+
Title:"波浪线",
|
|
134743
|
+
AryChart:
|
|
134744
|
+
[
|
|
134745
|
+
{ Title: 'M头W底', ClassName: 'hqchart_drawtool icon-draw_wavemw', Type:0, Data:{ ID:"M头W底" } },
|
|
134746
|
+
{ Title: '头肩型', ClassName: 'hqchart_drawtool icon-draw_head_shoulders_bt', Type:0, Data:{ ID:"头肩型" } },
|
|
134747
|
+
{ Title: '波浪尺', ClassName: 'hqchart_drawtool icon-waveruler', Type:0, Data:{ ID:"波浪尺" } },
|
|
134748
|
+
{ Title: 'AB波浪尺', ClassName: 'hqchart_drawtool icon-waveruler', Type:0, Data:{ ID:"AB波浪尺" } },
|
|
134749
|
+
]
|
|
134750
|
+
},
|
|
134751
|
+
{
|
|
134752
|
+
Title:"测量工具",
|
|
134753
|
+
AryChart:
|
|
134754
|
+
[
|
|
134755
|
+
{ Title: '价格范围', ClassName: 'hqchart_drawtool icon-shijianfanwei', Type:0, Data:{ ID:"PriceRange" } },
|
|
134756
|
+
{ Title: '时间范围', ClassName: 'hqchart_drawtool icon-jiagefanwei', Type:0, Data:{ ID:"DateRange" } },
|
|
134757
|
+
]
|
|
134758
|
+
},
|
|
134759
|
+
{
|
|
134760
|
+
Title:"文字",
|
|
134761
|
+
AryChart:
|
|
134762
|
+
[
|
|
134763
|
+
{ Title: '价格标签', ClassName: 'hqchart_drawtool icon-Tooltip', Type:0, Data:{ ID:"PriceLabel" } },
|
|
134764
|
+
{ Title: '价格注释', ClassName: 'hqchart_drawtool icon-tooltiptext', Type:0, Data:{ ID:"PriceNote" } },
|
|
134765
|
+
{ Title: '向上箭头', ClassName: 'iconfont icon-arrow_up', Type:0, Data:{ ID:"icon-arrow_up" } },
|
|
134766
|
+
{ Title: '向下箭头', ClassName: 'iconfont icon-arrow_down', Type:0, Data:{ ID:"icon-arrow_down" } },
|
|
134767
|
+
{ Title: '向左箭头', ClassName: 'iconfont icon-arrow_left', Type:0, Data:{ ID:"icon-arrow_left" }},
|
|
134768
|
+
{ Title: '向右箭头', ClassName: 'iconfont icon-arrow_right', Type:0, Data:{ ID:"icon-arrow_right" }},
|
|
134769
|
+
]
|
|
134770
|
+
}
|
|
134771
|
+
|
|
134772
|
+
];
|
|
134773
|
+
|
|
134774
|
+
this.ToolConfig=
|
|
134775
|
+
{
|
|
134776
|
+
Title:"工具",
|
|
134777
|
+
AryTool:
|
|
134778
|
+
[
|
|
134779
|
+
{ Title:"选中", ClassName:'hqchart_drawtool icon-arrow', Type:1, Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_SELECTED_ID} },
|
|
134780
|
+
{ Title:'尺子', ClassName: 'hqchart_drawtool icon-ruler', Type:0, Data:{ ID:"尺子" } },
|
|
134781
|
+
{ Title:"点击切换颜色", ClassName: 'hqchart_drawtool icon-fangkuai', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID }},
|
|
134782
|
+
{ Title:"删除所有画线", ClassName: 'hqchart_drawtool icon-recycle_bin', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_ALL_RAW_CHART_ID }}
|
|
134783
|
+
]
|
|
134784
|
+
};
|
|
134785
|
+
|
|
134786
|
+
|
|
134787
|
+
this.DivDialog=null;
|
|
134788
|
+
this.AryDivChart=[];
|
|
134789
|
+
this.HQChart=null;
|
|
134790
|
+
this.LineColor='rgb(255,140,0)';
|
|
134791
|
+
this.LineColorIndex=0;
|
|
134792
|
+
this.RandomLineColor=["rgb(255,69,0)", "rgb(0,191,255)", "rgb(255,0,255)", "rgb(255,105,180)"];
|
|
134793
|
+
this.LineWidth=1*GetDevicePixelRatio();
|
|
134794
|
+
this.ColumnCount=4;
|
|
134795
|
+
|
|
134796
|
+
this.DragTitle=null;
|
|
134797
|
+
|
|
134798
|
+
this.Inital=function(hqchart)
|
|
134799
|
+
{
|
|
134800
|
+
this.LineColor=g_JSChartResource.DrawPicture.LineColor[0];
|
|
134801
|
+
this.RandomLineColor.splice(0,0,this.LineColor);
|
|
134802
|
+
this.HQChart=hqchart;
|
|
134803
|
+
}
|
|
134804
|
+
|
|
134805
|
+
this.Create=function()
|
|
134806
|
+
{
|
|
134807
|
+
var divDom=document.createElement("div");
|
|
134808
|
+
divDom.className='UMyChart_DrawTool_Dialog_Div';
|
|
134809
|
+
|
|
134810
|
+
var divTitle=document.createElement("div");
|
|
134811
|
+
divTitle.className='UMyChart_DrawTool_Title_Div';
|
|
134812
|
+
divTitle.innerText="画图工具";
|
|
134813
|
+
divTitle.onmousedown=(e)=>{ this.OnMouseDownTitle(e); }
|
|
134814
|
+
|
|
134815
|
+
var divClose=document.createElement("div");
|
|
134816
|
+
divClose.className='UMyChart_DrawTool_Close_Div';
|
|
134817
|
+
divClose.innerText="x";
|
|
134818
|
+
divClose.onmousedown=(e)=>{ this.Close(e); }
|
|
134819
|
+
divTitle.appendChild(divClose);
|
|
134820
|
+
|
|
134821
|
+
divDom.appendChild(divTitle);
|
|
134822
|
+
|
|
134823
|
+
var table=document.createElement("table");
|
|
134824
|
+
table.className="UMyChart_DrawTool_Table";
|
|
134825
|
+
divDom.appendChild(table);
|
|
134826
|
+
|
|
134827
|
+
var tbody=document.createElement("tbody");
|
|
134828
|
+
tbody.className="UMyChart_DrawTool_Tbody";
|
|
134829
|
+
table.appendChild(tbody);
|
|
134830
|
+
|
|
134831
|
+
for(var i=0;i<this.AryChartGroup.length;++i)
|
|
134832
|
+
{
|
|
134833
|
+
var item=this.AryChartGroup[i];
|
|
134834
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(item.AryChart)) continue;
|
|
134835
|
+
|
|
134836
|
+
this.CreateChartGroupItem(item, tbody);
|
|
134837
|
+
|
|
134838
|
+
var trDom=document.createElement("tr");
|
|
134839
|
+
trDom.className='UMyChart_DrawTool_Group_End_Tr';
|
|
134840
|
+
tbody.appendChild(trDom);
|
|
134841
|
+
}
|
|
134842
|
+
|
|
134843
|
+
//工具栏
|
|
134844
|
+
this.CreateToolGroup(tbody);
|
|
134845
|
+
|
|
134846
|
+
this.DivDialog=divDom;
|
|
134847
|
+
|
|
134848
|
+
document.body.appendChild(divDom);
|
|
134849
|
+
}
|
|
134850
|
+
|
|
134851
|
+
this.Destroy=function()
|
|
134852
|
+
{
|
|
134853
|
+
this.AryDivChart=[];
|
|
134854
|
+
document.body.remove(this.DivDialog);
|
|
134855
|
+
this.DivDialog=null;
|
|
134856
|
+
}
|
|
134857
|
+
|
|
134858
|
+
this.CreateChartGroupItem=function(groupItem, tbody)
|
|
134859
|
+
{
|
|
134860
|
+
var trDom=document.createElement("tr");
|
|
134861
|
+
trDom.className='UMyChart_DrawTool_Group_Tr';
|
|
134862
|
+
tbody.appendChild(trDom);
|
|
134863
|
+
|
|
134864
|
+
var tdDom=document.createElement("td");
|
|
134865
|
+
tdDom.className="UMyChart_DrawTool_Group_Td";
|
|
134866
|
+
tdDom.innerText=groupItem.Title;
|
|
134867
|
+
tdDom.colSpan=this.ColumnCount;
|
|
134868
|
+
trDom.appendChild(tdDom);
|
|
134869
|
+
|
|
134870
|
+
var chartCount=groupItem.AryChart.length;
|
|
134871
|
+
for(var i=0,j=0;i<chartCount;)
|
|
134872
|
+
{
|
|
134873
|
+
var trDom=document.createElement("tr");
|
|
134874
|
+
trDom.className='UMyChart_DrawTool_Tr';
|
|
134875
|
+
|
|
134876
|
+
for(j=0;j<this.ColumnCount && i<chartCount; ++j, ++i)
|
|
134877
|
+
{
|
|
134878
|
+
var item=groupItem.AryChart[i];
|
|
134879
|
+
this.CreateChartItem(item, trDom);
|
|
134880
|
+
}
|
|
134881
|
+
|
|
134882
|
+
tbody.appendChild(trDom);
|
|
134883
|
+
}
|
|
134884
|
+
}
|
|
134885
|
+
|
|
134886
|
+
this.CreateChartItem=function(item, trDom)
|
|
134887
|
+
{
|
|
134888
|
+
var tdDom=document.createElement("td");
|
|
134889
|
+
tdDom.className="UMyChart_DrawTool_Td";
|
|
134890
|
+
tdDom.title=item.Title;
|
|
134891
|
+
trDom.appendChild(tdDom);
|
|
134892
|
+
|
|
134893
|
+
var spanDom=document.createElement("span");
|
|
134894
|
+
spanDom.className=item.ClassName;
|
|
134895
|
+
spanDom.classList.add("UMyChart_DrawTool_Span");
|
|
134896
|
+
tdDom.appendChild(spanDom);
|
|
134897
|
+
|
|
134898
|
+
var data={ Item:item, TD:tdDom, Span:spanDom };
|
|
134899
|
+
tdDom.onmousedown=(e)=> { this.OnClickItem(e, data); }; //点击
|
|
134900
|
+
|
|
134901
|
+
this.AryDivChart.push(data);
|
|
134902
|
+
}
|
|
134903
|
+
|
|
134904
|
+
this.OnClickItem=function(e, data)
|
|
134905
|
+
{
|
|
134906
|
+
console.log('[JSDialogDrawTool::OnClickChartItem] ', data);
|
|
134907
|
+
if (!data.Item || !data.Item.Data) return;
|
|
134908
|
+
|
|
134909
|
+
var type=data.Item.Type;
|
|
134910
|
+
var id=data.Item.Data.ID;
|
|
134911
|
+
if (type==2 && id==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID)
|
|
134912
|
+
{
|
|
134913
|
+
this.OnChangeLineColor(data);
|
|
134914
|
+
}
|
|
134915
|
+
else if (type==2 && id==JS_DRAWTOOL_MENU_ID.CMD_DELETE_ALL_RAW_CHART_ID)
|
|
134916
|
+
{
|
|
134917
|
+
this.DeleteAllChart();
|
|
134918
|
+
}
|
|
134919
|
+
else if (type==1 && id==JS_DRAWTOOL_MENU_ID.CMD_SELECTED_ID)
|
|
134920
|
+
{
|
|
134921
|
+
this.ClearAllSelectedChart();
|
|
134922
|
+
this.ClearCurrnetDrawPicture();
|
|
134923
|
+
}
|
|
134924
|
+
else if (type==0)
|
|
134925
|
+
{
|
|
134926
|
+
this.ClearAllSelectedChart();
|
|
134927
|
+
data.Span.classList.add("UMyChart_DrawTool_Span_Selected");
|
|
134928
|
+
this.CreateDrawPicture(data);
|
|
134929
|
+
}
|
|
134930
|
+
}
|
|
134931
|
+
|
|
134932
|
+
//清空选中状态
|
|
134933
|
+
this.ClearAllSelectedChart=function()
|
|
134934
|
+
{
|
|
134935
|
+
for(var i=0;i<this.AryDivChart.length;++i)
|
|
134936
|
+
{
|
|
134937
|
+
var item=this.AryDivChart[i];
|
|
134938
|
+
item.Span.classList.remove("UMyChart_DrawTool_Span_Selected");
|
|
134939
|
+
}
|
|
134940
|
+
}
|
|
134941
|
+
|
|
134942
|
+
this.CreateToolGroup=function(tbody)
|
|
134943
|
+
{
|
|
134944
|
+
var trDom=document.createElement("tr");
|
|
134945
|
+
trDom.className='UMyChart_DrawTool_Group_Tr';
|
|
134946
|
+
tbody.appendChild(trDom);
|
|
134947
|
+
|
|
134948
|
+
var tdDom=document.createElement("td");
|
|
134949
|
+
tdDom.className="UMyChart_DrawTool_Group_Td";
|
|
134950
|
+
tdDom.innerText=this.ToolConfig.Title;
|
|
134951
|
+
tdDom.colSpan=this.ColumnCount;
|
|
134952
|
+
trDom.appendChild(tdDom);
|
|
134953
|
+
|
|
134954
|
+
var chartCount=this.ToolConfig.AryTool.length;
|
|
134955
|
+
for(var i=0,j=0;i<chartCount;)
|
|
134956
|
+
{
|
|
134957
|
+
var trDom=document.createElement("tr");
|
|
134958
|
+
trDom.className='UMyChart_DrawTool_Tr';
|
|
134959
|
+
|
|
134960
|
+
for(j=0;j<this.ColumnCount && i<chartCount; ++j, ++i)
|
|
134961
|
+
{
|
|
134962
|
+
var item=this.ToolConfig.AryTool[i];
|
|
134963
|
+
this.CreateToolItem(item, trDom);
|
|
134964
|
+
}
|
|
134965
|
+
|
|
134966
|
+
tbody.appendChild(trDom);
|
|
134967
|
+
}
|
|
134968
|
+
}
|
|
134969
|
+
|
|
134970
|
+
this.CreateToolItem=function(item, trDom)
|
|
134971
|
+
{
|
|
134972
|
+
var tdDom=document.createElement("td");
|
|
134973
|
+
tdDom.className="UMyChart_DrawTool_Td";
|
|
134974
|
+
tdDom.title=item.Title;
|
|
134975
|
+
trDom.appendChild(tdDom);
|
|
134976
|
+
|
|
134977
|
+
var spanDom=document.createElement("span");
|
|
134978
|
+
spanDom.className=item.ClassName;
|
|
134979
|
+
spanDom.classList.add("UMyChart_DrawTool_Span");
|
|
134980
|
+
tdDom.appendChild(spanDom);
|
|
134981
|
+
var data={ Item:item, TD:tdDom, Span:spanDom };
|
|
134982
|
+
|
|
134983
|
+
if (item.Type==2 && item.Data.ID==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID) //颜色
|
|
134984
|
+
{
|
|
134985
|
+
spanDom.style['color']=this.LineColor;
|
|
134986
|
+
}
|
|
134987
|
+
|
|
134988
|
+
tdDom.onmousedown=(e)=> { this.OnClickItem(e, data); }; //点击
|
|
134989
|
+
|
|
134990
|
+
this.AryDivChart.push(data);
|
|
134991
|
+
}
|
|
134992
|
+
|
|
134993
|
+
|
|
134994
|
+
|
|
134995
|
+
this.OnChangeLineColor=function(data)
|
|
134996
|
+
{
|
|
134997
|
+
++this.LineColorIndex;
|
|
134998
|
+
var index=this.LineColorIndex%this.RandomLineColor.length;
|
|
134999
|
+
this.LineColor=this.RandomLineColor[index];
|
|
135000
|
+
|
|
135001
|
+
data.Span.style['color']=this.LineColor;
|
|
135002
|
+
}
|
|
135003
|
+
|
|
135004
|
+
//清空所有画图工具
|
|
135005
|
+
this.DeleteAllChart=function()
|
|
135006
|
+
{
|
|
135007
|
+
if (!this.HQChart) return;
|
|
135008
|
+
|
|
135009
|
+
this.HQChart.ClearChartDrawPicture();
|
|
135010
|
+
}
|
|
135011
|
+
|
|
135012
|
+
this.CreateDrawPicture=function(data)
|
|
135013
|
+
{
|
|
135014
|
+
if (!this.HQChart) return null;
|
|
135015
|
+
|
|
135016
|
+
var option=
|
|
135017
|
+
{
|
|
135018
|
+
LineColor:this.LineColor, //线段颜色
|
|
135019
|
+
LineWidth:this.LineWidth, //线段宽度
|
|
135020
|
+
//PointColor:'rgba(255,130,71,0.5)' //点颜色
|
|
135021
|
+
};
|
|
135022
|
+
|
|
135023
|
+
var name=data.Item.Data.ID;
|
|
135024
|
+
if (["icon-arrow_up","icon-arrow_down","icon-arrow_left", "icon-arrow_right"].includes(name)) option=null;
|
|
135025
|
+
|
|
135026
|
+
this.HQChart.CreateChartDrawPicture(name, option, (chart)=>{ this.OnFinishDrawPicture(chart, data); });
|
|
135027
|
+
}
|
|
135028
|
+
|
|
135029
|
+
this.ClearCurrnetDrawPicture=function()
|
|
135030
|
+
{
|
|
135031
|
+
if (this.HQChart) this.HQChart.ClearCurrnetDrawPicture();
|
|
135032
|
+
}
|
|
135033
|
+
|
|
135034
|
+
//画图工具绘制完成
|
|
135035
|
+
this.OnFinishDrawPicture=function(chart, data)
|
|
135036
|
+
{
|
|
135037
|
+
data.Span.classList.remove("UMyChart_DrawTool_Span_Selected");
|
|
135038
|
+
}
|
|
135039
|
+
|
|
135040
|
+
this.Show=function(x, y)
|
|
135041
|
+
{
|
|
135042
|
+
if (!this.DivDialog) return;
|
|
135043
|
+
|
|
135044
|
+
this.DivDialog.style.visibility='visible';
|
|
135045
|
+
this.DivDialog.style.top = y + "px";
|
|
135046
|
+
this.DivDialog.style.left = x + "px";
|
|
135047
|
+
}
|
|
135048
|
+
|
|
135049
|
+
this.Close=function(e)
|
|
135050
|
+
{
|
|
135051
|
+
if (!this.DivDialog) return;
|
|
135052
|
+
|
|
135053
|
+
this.DivDialog.style.visibility='hidden';
|
|
135054
|
+
}
|
|
135055
|
+
|
|
135056
|
+
this.IsShow=function()
|
|
135057
|
+
{
|
|
135058
|
+
if (!this.DivDialog) return false;
|
|
135059
|
+
|
|
135060
|
+
return this.DivDialog.style.visibility==='visible';
|
|
135061
|
+
}
|
|
135062
|
+
|
|
135063
|
+
this.OnMouseDownTitle=function(e)
|
|
135064
|
+
{
|
|
135065
|
+
if (!this.DivDialog) return;
|
|
135066
|
+
|
|
135067
|
+
var dragData={ X:e.clientX, Y:e.clientY };
|
|
135068
|
+
dragData.YOffset=e.clientX - this.DivDialog.offsetLeft;
|
|
135069
|
+
dragData.XOffset=e.clientY - this.DivDialog.offsetTop;
|
|
135070
|
+
this.DragTitle=dragData;
|
|
135071
|
+
|
|
135072
|
+
document.onmousemove=(e)=>{ this.DocOnMouseMoveTitle(e); }
|
|
135073
|
+
document.onmouseup=(e)=>{ this.DocOnMouseUpTitle(e); }
|
|
135074
|
+
}
|
|
135075
|
+
|
|
135076
|
+
this.DocOnMouseMoveTitle=function(e)
|
|
135077
|
+
{
|
|
135078
|
+
if (!this.DragTitle) return;
|
|
135079
|
+
|
|
135080
|
+
var left = e.clientX - this.DragTitle.YOffset;
|
|
135081
|
+
var top = e.clientY - this.DragTitle.XOffset;
|
|
135082
|
+
|
|
135083
|
+
var right=left+this.DivDialog.offsetWidth;
|
|
135084
|
+
var bottom=top+ this.DivDialog.offsetHeight;
|
|
135085
|
+
|
|
135086
|
+
if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
|
|
135087
|
+
if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
|
|
135088
|
+
|
|
135089
|
+
this.DivDialog.style.left = left + 'px'
|
|
135090
|
+
this.DivDialog.style.top = top + 'px'
|
|
135091
|
+
}
|
|
135092
|
+
|
|
135093
|
+
this.DocOnMouseUpTitle=function(e)
|
|
135094
|
+
{
|
|
135095
|
+
this.DragTitle=null;
|
|
135096
|
+
this.onmousemove = null;
|
|
135097
|
+
this.onmouseup = null;
|
|
135098
|
+
}
|
|
135099
|
+
}
|
|
135100
|
+
|
|
135101
|
+
|
|
135102
|
+
|
|
135103
|
+
|
|
135104
|
+
|
|
134913
135105
|
///////////////////////////////////////////////////////////////////////////////////
|
|
134914
135106
|
// 工作线程计算指标示例
|
|
134915
135107
|
//
|
|
@@ -135031,7 +135223,7 @@ function HQChartScriptWorker()
|
|
|
135031
135223
|
|
|
135032
135224
|
|
|
135033
135225
|
|
|
135034
|
-
var HQCHART_VERSION="1.1.
|
|
135226
|
+
var HQCHART_VERSION="1.1.13244";
|
|
135035
135227
|
|
|
135036
135228
|
function PrintHQChartVersion()
|
|
135037
135229
|
{
|
|
@@ -135171,5 +135363,6 @@ export default {
|
|
|
135171
135363
|
HQChartScriptWorker:HQChartScriptWorker, //计算工作线程
|
|
135172
135364
|
|
|
135173
135365
|
JSPopMenu:JSPopMenu, //弹出菜单
|
|
135366
|
+
JSDialogDrawTool:JSDialogDrawTool, //画图工具对话框
|
|
135174
135367
|
|
|
135175
135368
|
}
|