Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
bluefrankey
hqchart
提交
53aa7db3
hqchart
项目概览
bluefrankey
/
hqchart
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
hqchart
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
53aa7db3
编写于
11月 15, 2019
作者:
HQChart
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ver 7409
7408 增加K线标题绘制回调事件
上级
43fc7ac4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
115 addition
and
20 deletion
+115
-20
umychart_uniapp_h5/umychart.uniapp.h5.js
umychart_uniapp_h5/umychart.uniapp.h5.js
+23
-4
vuehqchart/src/jscommon/umychart.js
vuehqchart/src/jscommon/umychart.js
+23
-4
vuehqchart/src/jscommon/umychart.vue/umychart.vue.js
vuehqchart/src/jscommon/umychart.vue/umychart.vue.js
+23
-4
webhqchart.demo/jscommon/umychart.js
webhqchart.demo/jscommon/umychart.js
+23
-4
webhqchart/umychart.js
webhqchart/umychart.js
+23
-4
未找到文件。
umychart_uniapp_h5/umychart.uniapp.h5.js
浏览文件 @
53aa7db3
...
@@ -4564,6 +4564,7 @@ var JSCHART_EVENT_ID=
...
@@ -4564,6 +4564,7 @@ var JSCHART_EVENT_ID=
RECV_START_AUTOUPDATE:9, //开始自动更新
RECV_START_AUTOUPDATE:9, //开始自动更新
RECV_STOP_AUTOUPDATE:10, //停止自动更新
RECV_STOP_AUTOUPDATE:10, //停止自动更新
ON_CONTEXT_MENU:11, //右键菜单事件
ON_CONTEXT_MENU:11, //右键菜单事件
ON_TITLE_DRAW:12, //标题信息绘制事件
}
}
var JSCHART_OPERATOR_ID=
var JSCHART_OPERATOR_ID=
...
@@ -5263,13 +5264,14 @@ function JSChartContainer(uielement)
...
@@ -5263,13 +5264,14 @@ function JSChartContainer(uielement)
}
}
}
}
var eventTitleDraw=this.GetEventCallback(JSCHART_EVENT_ID.ON_TITLE_DRAW);
for(var i in this.TitlePaint)
for(var i in this.TitlePaint)
{
{
var item=this.TitlePaint[i];
var item=this.TitlePaint[i];
if (!item.IsDynamic) continue;
if (!item.IsDynamic) continue;
item.CursorIndex=this.CursorIndex;
item.CursorIndex=this.CursorIndex;
item.OnDrawEvent=eventTitleDraw;
item.Draw();
item.Draw();
}
}
...
@@ -19491,6 +19493,7 @@ function DynamicKLineTitlePainting()
...
@@ -19491,6 +19493,7 @@ function DynamicKLineTitlePainting()
this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
this.IsShowDateTime=true; //是否显示日期
this.IsShowDateTime=true; //是否显示日期
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.OnDrawEvent;
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
{
{
...
@@ -19624,8 +19627,11 @@ function DynamicKLineTitlePainting()
...
@@ -19624,8 +19627,11 @@ function DynamicKLineTitlePainting()
this.Draw=function()
this.Draw=function()
{
{
if (!this.IsShow) return;
if (!this.IsShow) return;
if (this.CursorIndex==null || !this.Data) return;
if (this.CursorIndex==null || !this.Data || this.Data.length<=0)
if (this.Data.length<=0) return;
{
this.OnDrawEventCallback(null);
return;
}
this.Canvas.font=this.Font;
this.Canvas.font=this.Font;
this.SpaceWidth = this.Canvas.measureText('0').width;
this.SpaceWidth = this.Canvas.measureText('0').width;
...
@@ -19634,14 +19640,26 @@ function DynamicKLineTitlePainting()
...
@@ -19634,14 +19640,26 @@ function DynamicKLineTitlePainting()
index=parseInt(index.toFixed(0));
index=parseInt(index.toFixed(0));
var dataIndex=this.Data.DataOffset+index;
var dataIndex=this.Data.DataOffset+index;
if (dataIndex>=this.Data.Data.length) dataIndex=this.Data.Data.length-1;
if (dataIndex>=this.Data.Data.length) dataIndex=this.Data.Data.length-1;
if (dataIndex<0) return;
if (dataIndex<0)
{
this.OnDrawEventCallback(null);
return;
}
var item=this.Data.Data[dataIndex];
var item=this.Data.Data[dataIndex];
this.OnDrawEventCallback(item);
this.Canvas.save();
this.Canvas.save();
this.DrawItem(item);
this.DrawItem(item);
this.Canvas.restore();
this.Canvas.restore();
}
}
this.OnDrawEventCallback=function(drawData)
{
if (!this.OnDrawEvent || !this.OnDrawEvent.Callback) return;
var data={ Draw: drawData, Name:'DynamicKLineTitlePainting'};
this.OnDrawEvent.Callback(this.OnDrawEvent,data,this);
}
this.GetColor=function(price,yclse)
this.GetColor=function(price,yclse)
{
{
if(price>yclse) return this.UpColor;
if(price>yclse) return this.UpColor;
...
@@ -19681,6 +19699,7 @@ function DynamicMinuteTitlePainting()
...
@@ -19681,6 +19699,7 @@ function DynamicMinuteTitlePainting()
this.OverlayChartPaint; //叠加画法
this.OverlayChartPaint; //叠加画法
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LastShowData; //保存最后显示的数据 给tooltip用
this.LastShowData; //保存最后显示的数据 给tooltip用
this.OnDrawEvent;
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
{
{
vuehqchart/src/jscommon/umychart.js
浏览文件 @
53aa7db3
...
@@ -1246,6 +1246,7 @@ var JSCHART_EVENT_ID=
...
@@ -1246,6 +1246,7 @@ var JSCHART_EVENT_ID=
RECV_START_AUTOUPDATE:9, //开始自动更新
RECV_START_AUTOUPDATE:9, //开始自动更新
RECV_STOP_AUTOUPDATE:10, //停止自动更新
RECV_STOP_AUTOUPDATE:10, //停止自动更新
ON_CONTEXT_MENU:11, //右键菜单事件
ON_CONTEXT_MENU:11, //右键菜单事件
ON_TITLE_DRAW:12, //标题信息绘制事件
}
}
var JSCHART_OPERATOR_ID=
var JSCHART_OPERATOR_ID=
...
@@ -1945,13 +1946,14 @@ function JSChartContainer(uielement)
...
@@ -1945,13 +1946,14 @@ function JSChartContainer(uielement)
}
}
}
}
var eventTitleDraw=this.GetEventCallback(JSCHART_EVENT_ID.ON_TITLE_DRAW);
for(var i in this.TitlePaint)
for(var i in this.TitlePaint)
{
{
var item=this.TitlePaint[i];
var item=this.TitlePaint[i];
if (!item.IsDynamic) continue;
if (!item.IsDynamic) continue;
item.CursorIndex=this.CursorIndex;
item.CursorIndex=this.CursorIndex;
item.OnDrawEvent=eventTitleDraw;
item.Draw();
item.Draw();
}
}
...
@@ -16173,6 +16175,7 @@ function DynamicKLineTitlePainting()
...
@@ -16173,6 +16175,7 @@ function DynamicKLineTitlePainting()
this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
this.IsShowDateTime=true; //是否显示日期
this.IsShowDateTime=true; //是否显示日期
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.OnDrawEvent;
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
{
{
...
@@ -16306,8 +16309,11 @@ function DynamicKLineTitlePainting()
...
@@ -16306,8 +16309,11 @@ function DynamicKLineTitlePainting()
this.Draw=function()
this.Draw=function()
{
{
if (!this.IsShow) return;
if (!this.IsShow) return;
if (this.CursorIndex==null || !this.Data) return;
if (this.CursorIndex==null || !this.Data || this.Data.length<=0)
if (this.Data.length<=0) return;
{
this.OnDrawEventCallback(null);
return;
}
this.Canvas.font=this.Font;
this.Canvas.font=this.Font;
this.SpaceWidth = this.Canvas.measureText('0').width;
this.SpaceWidth = this.Canvas.measureText('0').width;
...
@@ -16316,14 +16322,26 @@ function DynamicKLineTitlePainting()
...
@@ -16316,14 +16322,26 @@ function DynamicKLineTitlePainting()
index=parseInt(index.toFixed(0));
index=parseInt(index.toFixed(0));
var dataIndex=this.Data.DataOffset+index;
var dataIndex=this.Data.DataOffset+index;
if (dataIndex>=this.Data.Data.length) dataIndex=this.Data.Data.length-1;
if (dataIndex>=this.Data.Data.length) dataIndex=this.Data.Data.length-1;
if (dataIndex<0) return;
if (dataIndex<0)
{
this.OnDrawEventCallback(null);
return;
}
var item=this.Data.Data[dataIndex];
var item=this.Data.Data[dataIndex];
this.OnDrawEventCallback(item);
this.Canvas.save();
this.Canvas.save();
this.DrawItem(item);
this.DrawItem(item);
this.Canvas.restore();
this.Canvas.restore();
}
}
this.OnDrawEventCallback=function(drawData)
{
if (!this.OnDrawEvent || !this.OnDrawEvent.Callback) return;
var data={ Draw: drawData, Name:'DynamicKLineTitlePainting'};
this.OnDrawEvent.Callback(this.OnDrawEvent,data,this);
}
this.GetColor=function(price,yclse)
this.GetColor=function(price,yclse)
{
{
if(price>yclse) return this.UpColor;
if(price>yclse) return this.UpColor;
...
@@ -16363,6 +16381,7 @@ function DynamicMinuteTitlePainting()
...
@@ -16363,6 +16381,7 @@ function DynamicMinuteTitlePainting()
this.OverlayChartPaint; //叠加画法
this.OverlayChartPaint; //叠加画法
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LastShowData; //保存最后显示的数据 给tooltip用
this.LastShowData; //保存最后显示的数据 给tooltip用
this.OnDrawEvent;
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
{
{
vuehqchart/src/jscommon/umychart.vue/umychart.vue.js
浏览文件 @
53aa7db3
...
@@ -4605,6 +4605,7 @@ var JSCHART_EVENT_ID=
...
@@ -4605,6 +4605,7 @@ var JSCHART_EVENT_ID=
RECV_START_AUTOUPDATE:9, //开始自动更新
RECV_START_AUTOUPDATE:9, //开始自动更新
RECV_STOP_AUTOUPDATE:10, //停止自动更新
RECV_STOP_AUTOUPDATE:10, //停止自动更新
ON_CONTEXT_MENU:11, //右键菜单事件
ON_CONTEXT_MENU:11, //右键菜单事件
ON_TITLE_DRAW:12, //标题信息绘制事件
}
}
var JSCHART_OPERATOR_ID=
var JSCHART_OPERATOR_ID=
...
@@ -5304,13 +5305,14 @@ function JSChartContainer(uielement)
...
@@ -5304,13 +5305,14 @@ function JSChartContainer(uielement)
}
}
}
}
var eventTitleDraw=this.GetEventCallback(JSCHART_EVENT_ID.ON_TITLE_DRAW);
for(var i in this.TitlePaint)
for(var i in this.TitlePaint)
{
{
var item=this.TitlePaint[i];
var item=this.TitlePaint[i];
if (!item.IsDynamic) continue;
if (!item.IsDynamic) continue;
item.CursorIndex=this.CursorIndex;
item.CursorIndex=this.CursorIndex;
item.OnDrawEvent=eventTitleDraw;
item.Draw();
item.Draw();
}
}
...
@@ -19532,6 +19534,7 @@ function DynamicKLineTitlePainting()
...
@@ -19532,6 +19534,7 @@ function DynamicKLineTitlePainting()
this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
this.IsShowDateTime=true; //是否显示日期
this.IsShowDateTime=true; //是否显示日期
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.OnDrawEvent;
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
{
{
...
@@ -19665,8 +19668,11 @@ function DynamicKLineTitlePainting()
...
@@ -19665,8 +19668,11 @@ function DynamicKLineTitlePainting()
this.Draw=function()
this.Draw=function()
{
{
if (!this.IsShow) return;
if (!this.IsShow) return;
if (this.CursorIndex==null || !this.Data) return;
if (this.CursorIndex==null || !this.Data || this.Data.length<=0)
if (this.Data.length<=0) return;
{
this.OnDrawEventCallback(null);
return;
}
this.Canvas.font=this.Font;
this.Canvas.font=this.Font;
this.SpaceWidth = this.Canvas.measureText('0').width;
this.SpaceWidth = this.Canvas.measureText('0').width;
...
@@ -19675,14 +19681,26 @@ function DynamicKLineTitlePainting()
...
@@ -19675,14 +19681,26 @@ function DynamicKLineTitlePainting()
index=parseInt(index.toFixed(0));
index=parseInt(index.toFixed(0));
var dataIndex=this.Data.DataOffset+index;
var dataIndex=this.Data.DataOffset+index;
if (dataIndex>=this.Data.Data.length) dataIndex=this.Data.Data.length-1;
if (dataIndex>=this.Data.Data.length) dataIndex=this.Data.Data.length-1;
if (dataIndex<0) return;
if (dataIndex<0)
{
this.OnDrawEventCallback(null);
return;
}
var item=this.Data.Data[dataIndex];
var item=this.Data.Data[dataIndex];
this.OnDrawEventCallback(item);
this.Canvas.save();
this.Canvas.save();
this.DrawItem(item);
this.DrawItem(item);
this.Canvas.restore();
this.Canvas.restore();
}
}
this.OnDrawEventCallback=function(drawData)
{
if (!this.OnDrawEvent || !this.OnDrawEvent.Callback) return;
var data={ Draw: drawData, Name:'DynamicKLineTitlePainting'};
this.OnDrawEvent.Callback(this.OnDrawEvent,data,this);
}
this.GetColor=function(price,yclse)
this.GetColor=function(price,yclse)
{
{
if(price>yclse) return this.UpColor;
if(price>yclse) return this.UpColor;
...
@@ -19722,6 +19740,7 @@ function DynamicMinuteTitlePainting()
...
@@ -19722,6 +19740,7 @@ function DynamicMinuteTitlePainting()
this.OverlayChartPaint; //叠加画法
this.OverlayChartPaint; //叠加画法
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LastShowData; //保存最后显示的数据 给tooltip用
this.LastShowData; //保存最后显示的数据 给tooltip用
this.OnDrawEvent;
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
{
{
webhqchart.demo/jscommon/umychart.js
浏览文件 @
53aa7db3
...
@@ -1246,6 +1246,7 @@ var JSCHART_EVENT_ID=
...
@@ -1246,6 +1246,7 @@ var JSCHART_EVENT_ID=
RECV_START_AUTOUPDATE:9, //开始自动更新
RECV_START_AUTOUPDATE:9, //开始自动更新
RECV_STOP_AUTOUPDATE:10, //停止自动更新
RECV_STOP_AUTOUPDATE:10, //停止自动更新
ON_CONTEXT_MENU:11, //右键菜单事件
ON_CONTEXT_MENU:11, //右键菜单事件
ON_TITLE_DRAW:12, //标题信息绘制事件
}
}
var JSCHART_OPERATOR_ID=
var JSCHART_OPERATOR_ID=
...
@@ -1945,13 +1946,14 @@ function JSChartContainer(uielement)
...
@@ -1945,13 +1946,14 @@ function JSChartContainer(uielement)
}
}
}
}
var eventTitleDraw=this.GetEventCallback(JSCHART_EVENT_ID.ON_TITLE_DRAW);
for(var i in this.TitlePaint)
for(var i in this.TitlePaint)
{
{
var item=this.TitlePaint[i];
var item=this.TitlePaint[i];
if (!item.IsDynamic) continue;
if (!item.IsDynamic) continue;
item.CursorIndex=this.CursorIndex;
item.CursorIndex=this.CursorIndex;
item.OnDrawEvent=eventTitleDraw;
item.Draw();
item.Draw();
}
}
...
@@ -16173,6 +16175,7 @@ function DynamicKLineTitlePainting()
...
@@ -16173,6 +16175,7 @@ function DynamicKLineTitlePainting()
this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
this.IsShowDateTime=true; //是否显示日期
this.IsShowDateTime=true; //是否显示日期
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.OnDrawEvent;
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
{
{
...
@@ -16306,8 +16309,11 @@ function DynamicKLineTitlePainting()
...
@@ -16306,8 +16309,11 @@ function DynamicKLineTitlePainting()
this.Draw=function()
this.Draw=function()
{
{
if (!this.IsShow) return;
if (!this.IsShow) return;
if (this.CursorIndex==null || !this.Data) return;
if (this.CursorIndex==null || !this.Data || this.Data.length<=0)
if (this.Data.length<=0) return;
{
this.OnDrawEventCallback(null);
return;
}
this.Canvas.font=this.Font;
this.Canvas.font=this.Font;
this.SpaceWidth = this.Canvas.measureText('0').width;
this.SpaceWidth = this.Canvas.measureText('0').width;
...
@@ -16316,14 +16322,26 @@ function DynamicKLineTitlePainting()
...
@@ -16316,14 +16322,26 @@ function DynamicKLineTitlePainting()
index=parseInt(index.toFixed(0));
index=parseInt(index.toFixed(0));
var dataIndex=this.Data.DataOffset+index;
var dataIndex=this.Data.DataOffset+index;
if (dataIndex>=this.Data.Data.length) dataIndex=this.Data.Data.length-1;
if (dataIndex>=this.Data.Data.length) dataIndex=this.Data.Data.length-1;
if (dataIndex<0) return;
if (dataIndex<0)
{
this.OnDrawEventCallback(null);
return;
}
var item=this.Data.Data[dataIndex];
var item=this.Data.Data[dataIndex];
this.OnDrawEventCallback(item);
this.Canvas.save();
this.Canvas.save();
this.DrawItem(item);
this.DrawItem(item);
this.Canvas.restore();
this.Canvas.restore();
}
}
this.OnDrawEventCallback=function(drawData)
{
if (!this.OnDrawEvent || !this.OnDrawEvent.Callback) return;
var data={ Draw: drawData, Name:'DynamicKLineTitlePainting'};
this.OnDrawEvent.Callback(this.OnDrawEvent,data,this);
}
this.GetColor=function(price,yclse)
this.GetColor=function(price,yclse)
{
{
if(price>yclse) return this.UpColor;
if(price>yclse) return this.UpColor;
...
@@ -16363,6 +16381,7 @@ function DynamicMinuteTitlePainting()
...
@@ -16363,6 +16381,7 @@ function DynamicMinuteTitlePainting()
this.OverlayChartPaint; //叠加画法
this.OverlayChartPaint; //叠加画法
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LastShowData; //保存最后显示的数据 给tooltip用
this.LastShowData; //保存最后显示的数据 给tooltip用
this.OnDrawEvent;
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
{
{
webhqchart/umychart.js
浏览文件 @
53aa7db3
...
@@ -1246,6 +1246,7 @@ var JSCHART_EVENT_ID=
...
@@ -1246,6 +1246,7 @@ var JSCHART_EVENT_ID=
RECV_START_AUTOUPDATE:9, //开始自动更新
RECV_START_AUTOUPDATE:9, //开始自动更新
RECV_STOP_AUTOUPDATE:10, //停止自动更新
RECV_STOP_AUTOUPDATE:10, //停止自动更新
ON_CONTEXT_MENU:11, //右键菜单事件
ON_CONTEXT_MENU:11, //右键菜单事件
ON_TITLE_DRAW:12, //标题信息绘制事件
}
}
var JSCHART_OPERATOR_ID=
var JSCHART_OPERATOR_ID=
...
@@ -1945,13 +1946,14 @@ function JSChartContainer(uielement)
...
@@ -1945,13 +1946,14 @@ function JSChartContainer(uielement)
}
}
}
}
var eventTitleDraw=this.GetEventCallback(JSCHART_EVENT_ID.ON_TITLE_DRAW);
for(var i in this.TitlePaint)
for(var i in this.TitlePaint)
{
{
var item=this.TitlePaint[i];
var item=this.TitlePaint[i];
if (!item.IsDynamic) continue;
if (!item.IsDynamic) continue;
item.CursorIndex=this.CursorIndex;
item.CursorIndex=this.CursorIndex;
item.OnDrawEvent=eventTitleDraw;
item.Draw();
item.Draw();
}
}
...
@@ -16173,6 +16175,7 @@ function DynamicKLineTitlePainting()
...
@@ -16173,6 +16175,7 @@ function DynamicKLineTitlePainting()
this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
this.IsShowDateTime=true; //是否显示日期
this.IsShowDateTime=true; //是否显示日期
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.OnDrawEvent;
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
{
{
...
@@ -16306,8 +16309,11 @@ function DynamicKLineTitlePainting()
...
@@ -16306,8 +16309,11 @@ function DynamicKLineTitlePainting()
this.Draw=function()
this.Draw=function()
{
{
if (!this.IsShow) return;
if (!this.IsShow) return;
if (this.CursorIndex==null || !this.Data) return;
if (this.CursorIndex==null || !this.Data || this.Data.length<=0)
if (this.Data.length<=0) return;
{
this.OnDrawEventCallback(null);
return;
}
this.Canvas.font=this.Font;
this.Canvas.font=this.Font;
this.SpaceWidth = this.Canvas.measureText('0').width;
this.SpaceWidth = this.Canvas.measureText('0').width;
...
@@ -16316,14 +16322,26 @@ function DynamicKLineTitlePainting()
...
@@ -16316,14 +16322,26 @@ function DynamicKLineTitlePainting()
index=parseInt(index.toFixed(0));
index=parseInt(index.toFixed(0));
var dataIndex=this.Data.DataOffset+index;
var dataIndex=this.Data.DataOffset+index;
if (dataIndex>=this.Data.Data.length) dataIndex=this.Data.Data.length-1;
if (dataIndex>=this.Data.Data.length) dataIndex=this.Data.Data.length-1;
if (dataIndex<0) return;
if (dataIndex<0)
{
this.OnDrawEventCallback(null);
return;
}
var item=this.Data.Data[dataIndex];
var item=this.Data.Data[dataIndex];
this.OnDrawEventCallback(item);
this.Canvas.save();
this.Canvas.save();
this.DrawItem(item);
this.DrawItem(item);
this.Canvas.restore();
this.Canvas.restore();
}
}
this.OnDrawEventCallback=function(drawData)
{
if (!this.OnDrawEvent || !this.OnDrawEvent.Callback) return;
var data={ Draw: drawData, Name:'DynamicKLineTitlePainting'};
this.OnDrawEvent.Callback(this.OnDrawEvent,data,this);
}
this.GetColor=function(price,yclse)
this.GetColor=function(price,yclse)
{
{
if(price>yclse) return this.UpColor;
if(price>yclse) return this.UpColor;
...
@@ -16363,6 +16381,7 @@ function DynamicMinuteTitlePainting()
...
@@ -16363,6 +16381,7 @@ function DynamicMinuteTitlePainting()
this.OverlayChartPaint; //叠加画法
this.OverlayChartPaint; //叠加画法
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
this.LastShowData; //保存最后显示的数据 给tooltip用
this.LastShowData; //保存最后显示的数据 给tooltip用
this.OnDrawEvent;
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
this.GetCurrentKLineData=function() //获取当天鼠标位置所在的K线数据
{
{
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录