hqchart 1.1.15191 → 1.1.15210
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 +61 -61
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +136 -103
- package/src/jscommon/umychart.js +62 -33
- package/src/jscommon/umychart.resource/css/tools.css +47 -3
- package/src/jscommon/umychart.resource/font/drawtool/demo_index.html +49 -49
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.css +11 -11
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.js +1 -1
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.json +14 -14
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.ttf +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff2 +0 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +63 -34
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +199 -137
package/package.json
CHANGED
|
@@ -167,8 +167,6 @@ function JSDialogDrawTool()
|
|
|
167
167
|
this.AryDivChart=[];
|
|
168
168
|
this.HQChart=null;
|
|
169
169
|
this.LineColor='rgb(255,140,0)';
|
|
170
|
-
this.LineColorIndex=0;
|
|
171
|
-
this.RandomLineColor=["rgb(255,69,0)", "rgb(0,191,255)", "rgb(255,0,255)", "rgb(255,105,180)"];
|
|
172
170
|
this.LineWidth=1*GetDevicePixelRatio();
|
|
173
171
|
this.ColumnCount=5
|
|
174
172
|
|
|
@@ -179,7 +177,6 @@ function JSDialogDrawTool()
|
|
|
179
177
|
this.Inital=function(hqchart)
|
|
180
178
|
{
|
|
181
179
|
this.LineColor=g_JSChartResource.DrawPicture.LineColor[0];
|
|
182
|
-
this.RandomLineColor.splice(0,0,this.LineColor);
|
|
183
180
|
this.HQChart=hqchart;
|
|
184
181
|
}
|
|
185
182
|
|
|
@@ -408,6 +405,13 @@ function JSDialogDrawTool()
|
|
|
408
405
|
if (item.Type==2 && item.Data.ID==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID) //颜色
|
|
409
406
|
{
|
|
410
407
|
spanDom.style['color']=this.LineColor;
|
|
408
|
+
var inputColor=document.createElement("input");
|
|
409
|
+
inputColor.setAttribute("type", "color");
|
|
410
|
+
inputColor.setAttribute("value", IChartDrawPicture.RGBToHex(this.LineColor));
|
|
411
|
+
inputColor.className="UMyChart_DrawTool_Input_Color";
|
|
412
|
+
inputColor.oninput=(e)=>{ this.OnChangeColor(e, data) };
|
|
413
|
+
tdDom.appendChild(inputColor);
|
|
414
|
+
data.InputColor=inputColor;
|
|
411
415
|
}
|
|
412
416
|
else if (item.Type==2 && item.Data.ID==JS_DRAWTOOL_MENU_ID.CMD_CROSS_PERIOD_ID)
|
|
413
417
|
{
|
|
@@ -424,16 +428,20 @@ function JSDialogDrawTool()
|
|
|
424
428
|
}
|
|
425
429
|
|
|
426
430
|
|
|
427
|
-
|
|
428
|
-
this.OnChangeLineColor=function(data)
|
|
431
|
+
this.OnChangeColor=function(e, data)
|
|
429
432
|
{
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
this.LineColor=
|
|
433
|
-
|
|
433
|
+
var color=data.InputColor.value;
|
|
434
|
+
color=IChartDrawPicture.HexToRGB(color);
|
|
435
|
+
this.LineColor=color;
|
|
434
436
|
data.Span.style['color']=this.LineColor;
|
|
435
437
|
}
|
|
436
438
|
|
|
439
|
+
this.OnChangeLineColor=function(data)
|
|
440
|
+
{
|
|
441
|
+
data.InputColor.setAttribute("value", IChartDrawPicture.RGBToHex(this.LineColor));
|
|
442
|
+
data.InputColor.click(); //显示选色器
|
|
443
|
+
}
|
|
444
|
+
|
|
437
445
|
//清空所有画图工具
|
|
438
446
|
this.DeleteAllChart=function()
|
|
439
447
|
{
|
|
@@ -677,24 +685,19 @@ function JSDialogModifyDraw()
|
|
|
677
685
|
this.ModifyTextButton=null;
|
|
678
686
|
this.AdvancedButton=null;
|
|
679
687
|
|
|
680
|
-
this.RandomLineColor=["rgb(255,69,0)", "rgb(173,255,47)", "rgb(238,154,73)", "rgb(255,105,180)"]; //线段颜色
|
|
681
|
-
this.RandomBGColor=["rgba(210,251,209,0.8)", "rgb(217,217,253)", "rgb(255,208,204)", "rgb(252,249,206)"]; //背景颜色
|
|
682
|
-
this.RandomFontColor=["rgb(0,0,0)", "rgb(255, 0, 0)", "rgb(20, 255, 0)", "rgb(255, 0, 255)"]; //文字颜色
|
|
683
|
-
this.RandomBorderColor=["rgb(0,0,0)", "rgb(5, 246, 143)", "rgb(139, 137, 137)", "rgb(255, 20, 147)"]; //边框颜色
|
|
684
|
-
|
|
685
688
|
this.AryButton=
|
|
686
689
|
[
|
|
687
|
-
{ Title:"
|
|
688
|
-
{ Title:"修改字体颜色", ClassName: 'hqchart_drawtool icon-
|
|
689
|
-
{ Title:"修改背景颜色", ClassName: 'hqchart_drawtool icon-zitibeijingse', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID }},
|
|
690
|
-
{ Title:"修改边框颜色", ClassName: 'hqchart_drawtool icon-biankuang', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID }},
|
|
691
|
-
{ Title:"字体放大", ClassName: 'hqchart_drawtool icon-zoomin', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_ZOOM_FONT_ID }},
|
|
692
|
-
{ Title:"字体缩小", ClassName: 'hqchart_drawtool icon-zoomout', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_ZOOM_OUT_FONT_ID }},
|
|
693
|
-
{ Title:"随机生成文字内容", ClassName: 'hqchart_drawtool icon-bianji', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_MODIFY_TEXT_ID }},
|
|
694
|
-
{ Title:"高级设置", ClassName: 'hqchart_drawtool icon-setting', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_ADVANCED_SETTING_ID }},
|
|
690
|
+
{ Title:"修改图形颜色", ClassName: 'hqchart_drawtool icon-Vector UMyChart_Draw_Modify_Dialog_Button_Color_Span', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID }},
|
|
691
|
+
{ Title:"修改字体颜色", ClassName: 'hqchart_drawtool icon-zitiyanse1 UMyChart_Draw_Modify_Dialog_Button_Color_Span ', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID }},
|
|
692
|
+
{ Title:"修改背景颜色", ClassName: 'hqchart_drawtool icon-zitibeijingse UMyChart_Draw_Modify_Dialog_Button_Color_Span', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID }},
|
|
693
|
+
{ Title:"修改边框颜色", ClassName: 'hqchart_drawtool icon-biankuang UMyChart_Draw_Modify_Dialog_Button_Color_Span', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID }},
|
|
694
|
+
{ Title:"字体放大", ClassName: 'hqchart_drawtool icon-zoomin UMyChart_Draw_Modify_Dialog_Button_Span', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_ZOOM_FONT_ID }},
|
|
695
|
+
{ Title:"字体缩小", ClassName: 'hqchart_drawtool icon-zoomout UMyChart_Draw_Modify_Dialog_Button_Span', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_ZOOM_OUT_FONT_ID }},
|
|
696
|
+
{ Title:"随机生成文字内容", ClassName: 'hqchart_drawtool icon-bianji UMyChart_Draw_Modify_Dialog_Button_Span', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_MODIFY_TEXT_ID }},
|
|
697
|
+
{ Title:"高级设置", ClassName: 'hqchart_drawtool icon-setting UMyChart_Draw_Modify_Dialog_Button_Span', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_ADVANCED_SETTING_ID }},
|
|
695
698
|
|
|
696
699
|
{ Title:"上锁", ClassName: 'hqchart_drawtool icon-lock', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID }},
|
|
697
|
-
{ Title:"删除图形", ClassName: 'hqchart_drawtool icon-recycle_bin', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID }},
|
|
700
|
+
{ Title:"删除图形", ClassName: 'hqchart_drawtool icon-recycle_bin UMyChart_Draw_Modify_Dialog_Button_Span', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID }},
|
|
698
701
|
];
|
|
699
702
|
|
|
700
703
|
this.RestoreFocusDelay=800;
|
|
@@ -750,10 +753,9 @@ function JSDialogModifyDraw()
|
|
|
750
753
|
spanTooltip.innerText=item.Title;
|
|
751
754
|
divItem.appendChild(spanTooltip);
|
|
752
755
|
|
|
753
|
-
|
|
754
756
|
var spanDom=document.createElement("span");
|
|
755
757
|
spanDom.className=item.ClassName;
|
|
756
|
-
spanDom.classList.add("UMyChart_Draw_Modify_Dialog_Button_Span");
|
|
758
|
+
//spanDom.classList.add("UMyChart_Draw_Modify_Dialog_Button_Span");
|
|
757
759
|
divItem.appendChild(spanDom);
|
|
758
760
|
|
|
759
761
|
|
|
@@ -767,17 +769,33 @@ function JSDialogModifyDraw()
|
|
|
767
769
|
{
|
|
768
770
|
case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID:
|
|
769
771
|
this.ColorButton=data;
|
|
772
|
+
var divColorBar=this.CreateColorBar(data);
|
|
773
|
+
divItem.appendChild(divColorBar);
|
|
774
|
+
var inputColor=this.CreateInputColor(data);
|
|
775
|
+
divItem.appendChild(inputColor);
|
|
770
776
|
break;
|
|
771
777
|
case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID:
|
|
772
778
|
this.BGColorButton=data;
|
|
779
|
+
var divColorBar=this.CreateColorBar(data);
|
|
780
|
+
divItem.appendChild(divColorBar);
|
|
781
|
+
var inputColor=this.CreateInputColor(data);
|
|
782
|
+
divItem.appendChild(inputColor);
|
|
773
783
|
divItem.style.display="none";
|
|
774
784
|
break;
|
|
775
785
|
case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID:
|
|
776
786
|
this.FontColorButton=data;
|
|
787
|
+
var divColorBar=this.CreateColorBar(data);
|
|
788
|
+
divItem.appendChild(divColorBar);
|
|
789
|
+
var inputColor=this.CreateInputColor(data);
|
|
790
|
+
divItem.appendChild(inputColor);
|
|
777
791
|
divItem.style.display="none";
|
|
778
792
|
break;
|
|
779
793
|
case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID:
|
|
780
794
|
this.BorderColorButton=data;
|
|
795
|
+
var divColorBar=this.CreateColorBar(data);
|
|
796
|
+
divItem.appendChild(divColorBar);
|
|
797
|
+
var inputColor=this.CreateInputColor(data);
|
|
798
|
+
divItem.appendChild(inputColor);
|
|
781
799
|
divItem.style.display="none";
|
|
782
800
|
break;
|
|
783
801
|
case JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID:
|
|
@@ -804,6 +822,27 @@ function JSDialogModifyDraw()
|
|
|
804
822
|
parentDivDom.appendChild(divItem);
|
|
805
823
|
}
|
|
806
824
|
|
|
825
|
+
this.CreateInputColor=function(data)
|
|
826
|
+
{
|
|
827
|
+
var inputColor=document.createElement("input");
|
|
828
|
+
inputColor.setAttribute("type", "color");
|
|
829
|
+
inputColor.className="UMyChart_Draw_Modify_Input_Color";
|
|
830
|
+
data.InputColor=inputColor;
|
|
831
|
+
inputColor.oninput=(e)=>{ this.OnChangeColor(e, data) };
|
|
832
|
+
|
|
833
|
+
return inputColor;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
//颜色块
|
|
837
|
+
this.CreateColorBar=function(data)
|
|
838
|
+
{
|
|
839
|
+
var divColor=document.createElement("div");
|
|
840
|
+
divColor.className="UMyChart_Draw_Modify_Dialog_Button_ColorBar_Div";
|
|
841
|
+
data.DivColorBar=divColor;
|
|
842
|
+
|
|
843
|
+
return divColor;
|
|
844
|
+
}
|
|
845
|
+
|
|
807
846
|
this.OnClickButton=function(e, data)
|
|
808
847
|
{
|
|
809
848
|
console.log('[JSDialogModifyDraw::OnClickButton] ', data);
|
|
@@ -813,19 +852,19 @@ function JSDialogModifyDraw()
|
|
|
813
852
|
switch(id)
|
|
814
853
|
{
|
|
815
854
|
case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID:
|
|
816
|
-
this.ModifyLineColor();
|
|
855
|
+
this.ModifyLineColor(data);
|
|
817
856
|
break;
|
|
818
857
|
case JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID:
|
|
819
858
|
this.DeleteDrawPicture();
|
|
820
859
|
break;
|
|
821
860
|
case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID:
|
|
822
|
-
this.ModifyBGColor();
|
|
861
|
+
this.ModifyBGColor(data);
|
|
823
862
|
break;
|
|
824
863
|
case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID:
|
|
825
|
-
this.ModifyFontColor();
|
|
864
|
+
this.ModifyFontColor(data);
|
|
826
865
|
break;
|
|
827
866
|
case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID:
|
|
828
|
-
this.ModifyBorderColor();
|
|
867
|
+
this.ModifyBorderColor(data);
|
|
829
868
|
break;
|
|
830
869
|
case JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID:
|
|
831
870
|
this.ModifyLockChart();
|
|
@@ -902,83 +941,89 @@ function JSDialogModifyDraw()
|
|
|
902
941
|
dom.style.display=diaplay;
|
|
903
942
|
}
|
|
904
943
|
|
|
905
|
-
this.
|
|
944
|
+
this.OnChangeColor=function(e, data)
|
|
906
945
|
{
|
|
907
|
-
|
|
908
|
-
|
|
946
|
+
if (!this.ChartPicture || !this.HQChart) return;
|
|
947
|
+
|
|
948
|
+
var color=data.InputColor.value;
|
|
949
|
+
color=IChartDrawPicture.HexToRGB(color);
|
|
950
|
+
|
|
951
|
+
if (data.Item.Data.ID==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID)
|
|
909
952
|
{
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
break;
|
|
914
|
-
}
|
|
915
|
-
}
|
|
953
|
+
this.ChartPicture.LineColor=color;
|
|
954
|
+
if (this.ColorButton) this.ColorButton.DivColorBar.style['background-color']=color;
|
|
955
|
+
if (this.HQChart.ChartDrawStorage) this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture); //保存下
|
|
916
956
|
|
|
917
|
-
|
|
918
|
-
|
|
957
|
+
this.HQChart.Draw();
|
|
958
|
+
}
|
|
959
|
+
else if (data.Item.Data.ID==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID)
|
|
960
|
+
{
|
|
961
|
+
if (this.ChartPicture.ClassName=="ChartDrawNote") this.ChartPicture.NoteBorderColor=color;
|
|
962
|
+
else this.ChartPicture.BorderColor=color;
|
|
963
|
+
|
|
964
|
+
if (this.BorderColorButton) this.BorderColorButton.DivColorBar.style['background-color']=color;
|
|
965
|
+
if (this.HQChart.ChartDrawStorage) this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture); //保存下
|
|
919
966
|
|
|
920
|
-
|
|
921
|
-
|
|
967
|
+
this.HQChart.Draw();
|
|
968
|
+
}
|
|
969
|
+
else if (data.Item.Data.ID==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID)
|
|
970
|
+
{
|
|
971
|
+
if (this.ChartPicture.ClassName=="ChartDrawNote") this.ChartPicture.NoteTextColor=color;
|
|
972
|
+
else this.ChartPicture.TextColor=color;
|
|
922
973
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
if (!this.ChartPicture || !this.HQChart) return;
|
|
974
|
+
if (this.FontColorButton) this.FontColorButton.DivColorBar.style['background-color']=color;
|
|
975
|
+
if (this.HQChart.ChartDrawStorage) this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture); //保存下
|
|
926
976
|
|
|
927
|
-
|
|
977
|
+
this.HQChart.Draw();
|
|
978
|
+
}
|
|
979
|
+
else if (data.Item.Data.ID==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID)
|
|
980
|
+
{
|
|
981
|
+
color=IChartDrawPicture.ColorToRGBA(color, 0.8);
|
|
982
|
+
if (this.ChartPicture.ClassName=="ChartDrawNote") this.ChartPicture.NoteBGColor=color;
|
|
983
|
+
else this.ChartPicture.BGColor=color;
|
|
928
984
|
|
|
929
|
-
|
|
930
|
-
|
|
985
|
+
if (this.BGColorButton) this.BGColorButton.DivColorBar.style['background-color']=color;
|
|
986
|
+
if (this.HQChart.ChartDrawStorage) this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture); //保存下
|
|
931
987
|
|
|
932
|
-
|
|
988
|
+
this.HQChart.Draw();
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
}
|
|
933
992
|
|
|
934
|
-
|
|
993
|
+
this.ShowColorPicker=function(data, defaultColor)
|
|
994
|
+
{
|
|
995
|
+
if (!data.InputColor) return;
|
|
935
996
|
|
|
936
|
-
|
|
997
|
+
data.InputColor.setAttribute("value", IChartDrawPicture.RGBToHex(defaultColor));
|
|
998
|
+
data.InputColor.click(); //显示选色器
|
|
937
999
|
}
|
|
938
1000
|
|
|
939
|
-
this.
|
|
1001
|
+
this.ModifyLineColor=function(data)
|
|
940
1002
|
{
|
|
941
1003
|
if (!this.ChartPicture || !this.HQChart) return;
|
|
942
1004
|
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
var color=this.GetRandomColor(this.ChartPicture.NoteTextColor, this.RandomFontColor);
|
|
947
|
-
this.ChartPicture.NoteTextColor=color;
|
|
948
|
-
}
|
|
949
|
-
else
|
|
950
|
-
{
|
|
951
|
-
var color=this.GetRandomColor(this.ChartPicture.TextColor, this.RandomFontColor);
|
|
952
|
-
this.ChartPicture.TextColor=color;
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
if (this.FontColorButton) this.FontColorButton.Span.style['color']=color;
|
|
1005
|
+
var color=this.ChartPicture.LineColor;
|
|
1006
|
+
this.ShowColorPicker(data, color);
|
|
1007
|
+
}
|
|
957
1008
|
|
|
958
|
-
|
|
1009
|
+
this.ModifyFontColor=function(data)
|
|
1010
|
+
{
|
|
1011
|
+
if (!this.ChartPicture || !this.HQChart) return;
|
|
959
1012
|
|
|
960
|
-
this.
|
|
1013
|
+
var color=this.ChartPicture.TextColor;
|
|
1014
|
+
if (this.ChartPicture.ClassName=="ChartDrawNote") color=this.ChartPicture.NoteTextColor;
|
|
1015
|
+
|
|
1016
|
+
this.ShowColorPicker(data, color);
|
|
961
1017
|
}
|
|
962
1018
|
|
|
963
|
-
this.ModifyBGColor=function()
|
|
1019
|
+
this.ModifyBGColor=function(data)
|
|
964
1020
|
{
|
|
965
1021
|
if (!this.ChartPicture || !this.HQChart) return;
|
|
966
1022
|
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
var color=this.GetRandomColor(this.ChartPicture.NoteBGColor, this.RandomBGColor);
|
|
970
|
-
this.ChartPicture.NoteBGColor=color;
|
|
971
|
-
}
|
|
972
|
-
else
|
|
973
|
-
{
|
|
974
|
-
var color=this.GetRandomColor(this.ChartPicture.BGColor, this.RandomBGColor);
|
|
975
|
-
this.ChartPicture.BGColor=color;
|
|
976
|
-
}
|
|
1023
|
+
var color=this.ChartPicture.BGColor;
|
|
1024
|
+
if (this.ChartPicture.ClassName=="ChartDrawNote") color=this.ChartPicture.NoteBGColor;
|
|
977
1025
|
|
|
978
|
-
|
|
979
|
-
if (this.HQChart.ChartDrawStorage) this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture); //保存下
|
|
980
|
-
|
|
981
|
-
this.HQChart.Draw();
|
|
1026
|
+
this.ShowColorPicker(data, color);
|
|
982
1027
|
}
|
|
983
1028
|
|
|
984
1029
|
this.ModifyLockChart=function()
|
|
@@ -1005,26 +1050,14 @@ function JSDialogModifyDraw()
|
|
|
1005
1050
|
}
|
|
1006
1051
|
}
|
|
1007
1052
|
|
|
1008
|
-
this.ModifyBorderColor=function()
|
|
1053
|
+
this.ModifyBorderColor=function(data)
|
|
1009
1054
|
{
|
|
1010
1055
|
if (!this.ChartPicture || !this.HQChart) return;
|
|
1011
1056
|
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
var color=this.GetRandomColor(this.ChartPicture.NoteBorderColor, this.RandomBorderColor);
|
|
1015
|
-
this.ChartPicture.NoteBorderColor=color;
|
|
1016
|
-
}
|
|
1017
|
-
else
|
|
1018
|
-
{
|
|
1019
|
-
var color=this.GetRandomColor(this.ChartPicture.BorderColor, this.RandomBorderColor);
|
|
1020
|
-
this.ChartPicture.BorderColor=color;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1057
|
+
var color= this.ChartPicture.BorderColor;
|
|
1058
|
+
if (this.ChartPicture.ClassName=="ChartDrawNote") color=this.ChartPicture.NoteBorderColor;
|
|
1023
1059
|
|
|
1024
|
-
|
|
1025
|
-
if (this.HQChart.ChartDrawStorage) this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture); //保存下
|
|
1026
|
-
|
|
1027
|
-
this.HQChart.Draw();
|
|
1060
|
+
this.ShowColorPicker(data, color);
|
|
1028
1061
|
}
|
|
1029
1062
|
|
|
1030
1063
|
this.ModifyFontZoom=function(step)
|
|
@@ -1151,7 +1184,7 @@ function JSDialogModifyDraw()
|
|
|
1151
1184
|
this.ShowButton(item.Div, bShowLineColor?"inline":"none");
|
|
1152
1185
|
if (bShowLineColor)
|
|
1153
1186
|
{
|
|
1154
|
-
item.
|
|
1187
|
+
item.DivColorBar.style['background-color']=chart.LineColor;
|
|
1155
1188
|
}
|
|
1156
1189
|
}
|
|
1157
1190
|
|
|
@@ -1161,7 +1194,7 @@ function JSDialogModifyDraw()
|
|
|
1161
1194
|
this.ShowButton(item.Div, bShowBGColor?"inline":"none");
|
|
1162
1195
|
if (bShowBGColor)
|
|
1163
1196
|
{
|
|
1164
|
-
item.
|
|
1197
|
+
item.DivColorBar.style['background-color']=bgColor;
|
|
1165
1198
|
}
|
|
1166
1199
|
}
|
|
1167
1200
|
|
|
@@ -1171,7 +1204,7 @@ function JSDialogModifyDraw()
|
|
|
1171
1204
|
this.ShowButton(item.Div, bShowFontColor?"inline":"none");
|
|
1172
1205
|
if (bShowFontColor)
|
|
1173
1206
|
{
|
|
1174
|
-
item.
|
|
1207
|
+
item.DivColorBar.style['background-color']=fontColor;
|
|
1175
1208
|
}
|
|
1176
1209
|
}
|
|
1177
1210
|
|
|
@@ -1181,7 +1214,7 @@ function JSDialogModifyDraw()
|
|
|
1181
1214
|
this.ShowButton(item.Div, bShowBorderColor?"inline":"none");
|
|
1182
1215
|
if (bShowBorderColor)
|
|
1183
1216
|
{
|
|
1184
|
-
item.
|
|
1217
|
+
item.DivColorBar.style['background-color']=borderColor;
|
|
1185
1218
|
}
|
|
1186
1219
|
}
|
|
1187
1220
|
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -476,6 +476,17 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
476
476
|
if (IFrameSplitOperator.IsBool(item.Enable)) chart.FastSlideConfig.Enable=item.Enable;
|
|
477
477
|
}
|
|
478
478
|
|
|
479
|
+
if (option.DataMove)
|
|
480
|
+
{
|
|
481
|
+
var item=option.DataMove;
|
|
482
|
+
|
|
483
|
+
var subItem=item.Touch;
|
|
484
|
+
if (subItem && IFrameSplitOperator.IsBool(subItem.EnableLR)) chart.DataMoveConfig.Touch.EnableLR=subItem.EnableLR;
|
|
485
|
+
|
|
486
|
+
var subItem=item.Mouse;
|
|
487
|
+
if (subItem && IFrameSplitOperator.IsBool(subItem.EnableLR)) chart.DataMoveConfig.Mouse.EnableLR=subItem.EnableLR;
|
|
488
|
+
}
|
|
489
|
+
|
|
479
490
|
if (chart.ClassName=="KLineChartContainer")
|
|
480
491
|
{
|
|
481
492
|
if (!option.DragSelectRect)
|
|
@@ -3430,8 +3441,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3430
3441
|
//SecondKeyID 1=shiftKey 2=ctrlKey 3=altKey
|
|
3431
3442
|
this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
|
|
3432
3443
|
|
|
3433
|
-
this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250, Enable:false };
|
|
3434
|
-
this.KeyboardMove={ Timer:null, Delay:100 , PressTime:500, Enable:false, Event:null };
|
|
3444
|
+
this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250, Enable:false }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
|
|
3445
|
+
this.KeyboardMove={ Timer:null, Delay:100 , PressTime:500, Enable:false, Event:null }; //键盘左右移动 PressTime=长按时间
|
|
3446
|
+
this.DataMoveConfig={ Touch:{ EnableLR: true}, Mouse:{ EnableLR:true } }; //数据移动配置
|
|
3435
3447
|
|
|
3436
3448
|
this.MapEventListenerCache=new Map(); //addEventListener 监听事件 key=type:"keydown|keyup ....", value:{ Callback:, Option: }
|
|
3437
3449
|
|
|
@@ -4932,7 +4944,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
4932
4944
|
}
|
|
4933
4945
|
else if (this.DragMode==1 || isDragSelectRect || isDragSubSelectRect) //数据上下左右拖拽 区间选择框左右拖动
|
|
4934
4946
|
{
|
|
4935
|
-
this.
|
|
4947
|
+
if (this.DataMoveConfig.Mouse.EnableLR)
|
|
4948
|
+
this.OnDragMode_One({X:moveSetp, Y:moveSetpY}, e);
|
|
4936
4949
|
}
|
|
4937
4950
|
}
|
|
4938
4951
|
|
|
@@ -6111,18 +6124,21 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6111
6124
|
var oneStepWidth=this.GetMoveOneStepWidth();
|
|
6112
6125
|
if (moveSetp<oneStepWidth) return;
|
|
6113
6126
|
|
|
6114
|
-
if(this.
|
|
6115
|
-
{
|
|
6116
|
-
this.UpdataDataoffset();
|
|
6117
|
-
this.UpdatePointByCursorIndex();
|
|
6118
|
-
this.UpdateFrameMaxMin();
|
|
6119
|
-
this.ResetFrameXYSplit();
|
|
6120
|
-
this.Draw();
|
|
6121
|
-
this.OnKLinePageChange("OnTouchMove");
|
|
6122
|
-
}
|
|
6123
|
-
else
|
|
6127
|
+
if (this.DataMoveConfig.Touch.EnableLR)
|
|
6124
6128
|
{
|
|
6125
|
-
if
|
|
6129
|
+
if(this.DataMove(moveSetp,isLeft))
|
|
6130
|
+
{
|
|
6131
|
+
this.UpdataDataoffset();
|
|
6132
|
+
this.UpdatePointByCursorIndex();
|
|
6133
|
+
this.UpdateFrameMaxMin();
|
|
6134
|
+
this.ResetFrameXYSplit();
|
|
6135
|
+
this.Draw();
|
|
6136
|
+
this.OnKLinePageChange("OnTouchMove");
|
|
6137
|
+
}
|
|
6138
|
+
else
|
|
6139
|
+
{
|
|
6140
|
+
if (this.DragDownloadData) this.DragDownloadData();
|
|
6141
|
+
}
|
|
6126
6142
|
}
|
|
6127
6143
|
|
|
6128
6144
|
drag.LastMove.X=touches[0].clientX;
|
|
@@ -10498,6 +10514,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10498
10514
|
if (IFrameSplitOperator.IsBool(frameItem.IsShowIndexTitle)) frame.IsShowIndexTitle=frameItem.IsShowIndexTitle;
|
|
10499
10515
|
if (frameItem.ClientBGColor) frame.ClientBGColor=frameItem.ClientBGColor;
|
|
10500
10516
|
|
|
10517
|
+
if (frameItem.Toolbar)
|
|
10518
|
+
{
|
|
10519
|
+
var subItem=frameItem.Toolbar.Margin;
|
|
10520
|
+
if (subItem && IFrameSplitOperator.IsNumber(subItem.Right)) frame.ToolbarConfig.Margin.Right=subItem.Right;
|
|
10521
|
+
}
|
|
10522
|
+
|
|
10501
10523
|
//分时图属性
|
|
10502
10524
|
if (IFrameSplitOperator.IsBool(frameItem.CloseBeforeButton)) frameItem.IsShowCloseButton=frameItem.CloseBeforeButton;
|
|
10503
10525
|
if (frame.YSplitOperator.RightTextConfig) //主图右侧坐标设置
|
|
@@ -13824,6 +13846,8 @@ function AverageWidthFrame()
|
|
|
13824
13846
|
this.ExportDataButton=CloneData(g_JSChartResource.Buttons.ExportData);
|
|
13825
13847
|
this.AddIndexWindowButton=CloneData(g_JSChartResource.Buttons.AddIndexWindow);
|
|
13826
13848
|
this.IndexHelpButton=CloneData(g_JSChartResource.Buttons.IndexHelp);
|
|
13849
|
+
|
|
13850
|
+
this.ToolbarConfig={ Margin:{ Right:3 } },
|
|
13827
13851
|
|
|
13828
13852
|
this.ButtonTooltip=CloneData(g_JSChartResource.Buttons.Tooltip);
|
|
13829
13853
|
|
|
@@ -13893,7 +13917,7 @@ function AverageWidthFrame()
|
|
|
13893
13917
|
var border=this.GetBorder();
|
|
13894
13918
|
if (this.IsHScreen)
|
|
13895
13919
|
{
|
|
13896
|
-
var y=border.Bottom-
|
|
13920
|
+
var y=border.Bottom-this.ToolbarConfig.Margin.Right;
|
|
13897
13921
|
var x=border.RightTitle+this.ChartBorder.TitleHeight/2;
|
|
13898
13922
|
|
|
13899
13923
|
this.ToolbarCacheSize={ RToolbar:{ Right:y, Left:y }}; //相当于额 Top, Bottom
|
|
@@ -13932,7 +13956,7 @@ function AverageWidthFrame()
|
|
|
13932
13956
|
}
|
|
13933
13957
|
else
|
|
13934
13958
|
{
|
|
13935
|
-
var right=border.RightEx-
|
|
13959
|
+
var right=border.RightEx-this.ToolbarConfig.Margin.Right;
|
|
13936
13960
|
var left=border.Left;
|
|
13937
13961
|
var yButton=border.Top+this.ChartBorder.TitleHeight/2;
|
|
13938
13962
|
|
|
@@ -66148,17 +66172,13 @@ IChartDrawPicture.ColorToRGBA=function(color,opacity)
|
|
|
66148
66172
|
var reg = /^(rgb|RGB)/;
|
|
66149
66173
|
if (reg.test(color))
|
|
66150
66174
|
{
|
|
66151
|
-
var
|
|
66152
|
-
var
|
|
66153
|
-
|
|
66154
|
-
|
|
66155
|
-
{
|
|
66156
|
-
var hex = Number(colorArr[i]).toString(16);
|
|
66157
|
-
if (hex === "0") hex += hex;
|
|
66158
|
-
strHex += hex;
|
|
66159
|
-
}
|
|
66175
|
+
var aryColor = color.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(","); // 把RGB的3个数值变成数组
|
|
66176
|
+
var r = parseInt(aryColor[0]);
|
|
66177
|
+
var g = parseInt(aryColor[1]);
|
|
66178
|
+
var b = parseInt(aryColor[2]);
|
|
66160
66179
|
|
|
66161
|
-
|
|
66180
|
+
var value=`rgba(${r},${g},${b},${opacity})`;
|
|
66181
|
+
return value;
|
|
66162
66182
|
}
|
|
66163
66183
|
|
|
66164
66184
|
return "rgba(" + parseInt("0x" + color.slice(1, 3)) + "," + parseInt("0x" + color.slice(3, 5)) + "," + parseInt("0x" + color.slice(5, 7)) + "," + opacity + ")";
|
|
@@ -66169,7 +66189,8 @@ IChartDrawPicture.RGBToHex=function(rgb)
|
|
|
66169
66189
|
// Choose correct separator
|
|
66170
66190
|
let sep = rgb.indexOf(",") > -1 ? "," : " ";
|
|
66171
66191
|
// Turn "rgb(r,g,b)" into [r,g,b]
|
|
66172
|
-
rgb = rgb.substr(
|
|
66192
|
+
if (rgb.includes("rgba(") || rgb.includes("RGBA(")) rgb = rgb.substr(5).split(")")[0].split(sep);
|
|
66193
|
+
else rgb = rgb.substr(4).split(")")[0].split(sep);
|
|
66173
66194
|
|
|
66174
66195
|
let r = (+rgb[0]).toString(16),
|
|
66175
66196
|
g = (+rgb[1]).toString(16),
|
|
@@ -88250,12 +88271,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
88250
88271
|
if (this.ChartDrawStorage)
|
|
88251
88272
|
{
|
|
88252
88273
|
this.ChartDrawStorageCache=this.ChartDrawStorage.GetDrawData( {Symbol:this.Symbol, Period:this.Period} );
|
|
88253
|
-
|
|
88254
|
-
|
|
88255
|
-
|
|
88256
|
-
|
|
88257
|
-
|
|
88258
|
-
}
|
|
88274
|
+
}
|
|
88275
|
+
|
|
88276
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_LOAD_DRAWPICTURE);
|
|
88277
|
+
if (event && event.Callback)
|
|
88278
|
+
{
|
|
88279
|
+
var sendData={ Symbol:this.Symbol, Period:this.Period, DrawStorage:this.ChartDrawStorage, ChartDrawStorageCache:this.ChartDrawStorageCache };
|
|
88280
|
+
event.Callback(event,sendData,this);
|
|
88259
88281
|
}
|
|
88260
88282
|
}
|
|
88261
88283
|
|
|
@@ -96105,6 +96127,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
96105
96127
|
{
|
|
96106
96128
|
this.ChartDrawStorageCache=this.ChartDrawStorage.GetDrawData( { Symbol:this.Symbol, Period:888888888 } );
|
|
96107
96129
|
}
|
|
96130
|
+
|
|
96131
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_LOAD_DRAWPICTURE);
|
|
96132
|
+
if (event && event.Callback)
|
|
96133
|
+
{
|
|
96134
|
+
var sendData={ Symbol:this.Symbol, Period:888888888, DrawStorage:this.ChartDrawStorage, ChartDrawStorageCache:this.ChartDrawStorageCache };
|
|
96135
|
+
event.Callback(event,sendData,this);
|
|
96136
|
+
}
|
|
96108
96137
|
}
|
|
96109
96138
|
|
|
96110
96139
|
this.CreateChartDrawPictureByStorage=function() //把缓存(this.ChartDrawStorageCache) 画图工具创建出来
|