Skip to content

Commit

Permalink
ver 12742
Browse files Browse the repository at this point in the history
12740 X轴支持XLineExtend => Mode=2
12739 ON_CREATE_OVERLAY_FRAME事件放在指标创建完成以后触发
12738 增加指标窗口选中
12736 K线支持窗口选中
12735 修正ChartDrawSVG数据Y轴坐标计算错误
12734 函数TIPICON支持叠加指标
12732 HQTradeFrame::GetScaleTextWidth()不需要还原最大最小值
  • Loading branch information
jones2000 committed Nov 28, 2023
1 parent fda7f4f commit 0d97e43
Show file tree
Hide file tree
Showing 15 changed files with 1,217 additions and 190 deletions.
277 changes: 240 additions & 37 deletions umychart_uniapp_h5/umychart.uniapp.h5.js

Large diffs are not rendered by default.

71 changes: 71 additions & 0 deletions vuehqchart/src/jscommon/umychart.complier.js
Original file line number Diff line number Diff line change
Expand Up @@ -21604,6 +21604,9 @@ function OverlayScriptIndex(name,script,args,option)
case 'DRAWICON':
this.CreateIcon(hqChart,windowIndex,item,i);
break;
case "TIPICON":
this.CreateTipIcon(hqChart,windowIndex,item,i);
break;
case 'DRAWCHANNEL':
this.CreateChannel(hqChart,windowIndex,item,i);
break;
Expand Down Expand Up @@ -22316,6 +22319,74 @@ function OverlayScriptIndex(name,script,args,option)
frame.ChartPaint.push(chart);
}

this.CreateTipIcon=function(hqChart,windowIndex,varItem,id)
{
var overlayIndex=this.OverlayIndex;
var frame=overlayIndex.Frame;
var chart=new ChartDrawSVG();
chart.Canvas=hqChart.Canvas;

chart.Name=varItem.Name;
chart.ChartBorder=frame.Frame.ChartBorder;
chart.ChartFrame=frame.Frame;
chart.Identify=overlayIndex.Identify;

if (hqChart.ChartPaint[0].IsMinuteFrame())
chart.Data=hqChart.SourceData;
else
chart.Data=hqChart.ChartPaint[0].Data; //绑定K线

chart.Family=varItem.Draw.Icon.Family;
chart.TextFont=g_JSChartResource.TIPICON.TextFont;

var svgSize=g_JSChartResource.TIPICON.Size;
var svgColor=g_JSChartResource.TIPICON.Color;
var svgYOffset=0;
var svgVAlign=2; //上下对齐方式
if (IFrameSplitOperator.IsNumber(varItem.YOffset)) svgYOffset=varItem.YOffset;
if (varItem.Color) svgColor=this.GetColor(varItem.Color);
if (varItem.DrawFontSize>0) svgSize=varItem.DrawFontSize;
if (varItem.DrawVAlign>=0) svgVAlign=varItem.DrawVAlign;

if (varItem.Draw && IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.DrawData) && varItem.Draw.Icon)
{
var drawData=varItem.Draw.DrawData;
var aryData=[];
var isArrayTip=Array.isArray(varItem.Draw.Text);
var singleTip=null;
if (!isArrayTip && varItem.Draw.Text) singleTip={ Text:varItem.Draw.Text };

for(var j=0;j<drawData.length;++j)
{
var item=drawData[j];
if (!IFrameSplitOperator.IsNumber(item)) continue;

var svgItem=
{
Index:j, Value:item,
SVG:{ Symbol:varItem.Draw.Icon.Symbol, Size:svgSize, Color:svgColor, YOffset:svgYOffset, VAlign:svgVAlign }
};

if (isArrayTip)
{
var text=varItem.Draw.Text[j];
if (text) svgItem.Tooltip={ Text:text };
}
else
{
svgItem.Tooltip=singleTip;
}

aryData.push(svgItem);
}

chart.Texts= aryData;
}

frame.ChartPaint.push(chart);
}


//创建通道
this.CreateChannel=function(hqChart,windowIndex,varItem,id)
{
Expand Down
Loading

0 comments on commit 0d97e43

Please sign in to comment.