Skip to content

Commit

Permalink
ver 7445
Browse files Browse the repository at this point in the history
7442 增加区间选择事件通知
7440 数字货币增加分时图demo
  • Loading branch information
jones2000 committed Nov 19, 2019
1 parent 8c2fdf7 commit 2e6d173
Show file tree
Hide file tree
Showing 10 changed files with 320 additions and 146 deletions.
13 changes: 13 additions & 0 deletions umychart_uniapp_h5/umychart.uniapp.h5.js
Original file line number Diff line number Diff line change
Expand Up @@ -4566,6 +4566,7 @@ var JSCHART_EVENT_ID=
RECV_STOP_AUTOUPDATE:10, //停止自动更新
ON_CONTEXT_MENU:11, //右键菜单事件
ON_TITLE_DRAW:12, //标题信息绘制事件
ON_SELECT_RECT:13 //区间选择事件通知
}

var JSCHART_OPERATOR_ID=
Expand Down Expand Up @@ -4903,6 +4904,18 @@ function JSChartContainer(uielement)

if (this.JSChartContainer.GetSelectRectData(selectData))
{
var event=this.JSChartContainer.GetEventCallback(JSCHART_EVENT_ID.ON_SELECT_RECT);
if (event && event.Callback)
{
var data=
{
X:drag.LastMove.X-uielement.getBoundingClientRect().left,
Y:drag.LastMove.Y-uielement.getBoundingClientRect().top,
SelectData:selectData, //区间选择的数据
};
event.Callback(event,data,this.JSChartContainer);
}

if (this.JSChartContainer.SelectRectRightMenu)
{
e.data=
Expand Down
6 changes: 3 additions & 3 deletions vue.demo/bitdemo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vue.demo/bitdemo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"babel-preset-vue-app": "^1.2.0",
"css-loader": "^0.27.0",
"file-loader": "^0.10.1",
"hqchart": "^1.1.7426",
"hqchart": "^1.1.7439",
"html-webpack-plugin": "^2.24.1",
"node-sass": "^4.12.0",
"postcss-loader": "^1.3.3",
Expand Down
14 changes: 3 additions & 11 deletions vue.demo/bitdemo/src/pages/stockHq/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div id="app" ref='app' style="height:100%">
<stockHq DefaultPairName="ETH/BTC" DefaultName="以太币" DefaultfloatPrecision=8 DefaultPeriod=0 ref='klinechart'></stockHq>
<stockHq DefaultPairName="ETH/BTC" DefaultName="以太币" DefaultfloatPrecision=8 DefaultPeriod=0 ref='klinechart'>
</stockHq>
<coinList @ChangeSymbol="ChangeSymbol">
</coinList>
</div>
Expand All @@ -20,26 +21,18 @@ export default
var data={};
return data;
},
components:
{
stockHq: stockHq,
coinList: coinList
},
created()
{
},
mounted()
{
this.OnSize();
},
computed:
{
},
methods:
{
ChangeSymbol(symbol,name,floatPrecision) //转发切换股票数据到图形
Expand Down Expand Up @@ -69,4 +62,3 @@ a {text-decoration: none;}
ul,ol {list-style: none;}
.clear:after {content: " "; height: 0; display: block; overflow: hidden; clear: both;}
</style>

18 changes: 9 additions & 9 deletions vue.demo/bitdemo/src/pages/stockHq/components/coinList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ function numberFormat(value) {
sizes = ['', '', '亿', '万亿'],
i,
result;
if(value < k){
result = keepTwoDecimal(value, 2);
}else{
i = Math.floor(Math.log(value) / Math.log(k));
result = ((value / Math.pow(k, i))).toFixed(2) + sizes[i];
}
if(value < k){
result = keepTwoDecimal(value, 2);
}else{
i = Math.floor(Math.log(value) / Math.log(k));
result = ((value / Math.pow(k, i))).toFixed(2) + sizes[i];
}
return result;
}
Expand All @@ -76,7 +76,7 @@ DefaultData.BitList=function()
export default
{
name:'BitList', //类名
name:'BitList',
data()
{
Expand All @@ -97,7 +97,7 @@ export default
{
ClickSymbol(item)
{
this.$emit('ChangeSymbol', item.Symbol, item.Name,item.FloatPrecision)
this.$emit('ChangeSymbol', item.Symbol, item.Name, item.FloatPrecision)
},
LoadMarketData()
Expand Down
Loading

0 comments on commit 2e6d173

Please sign in to comment.