11.26 修改K线图样式
This commit is contained in:
@@ -18,6 +18,8 @@ const _sfc_main = {
|
||||
//股票code
|
||||
categoryList: ["分时图", "日K线"],
|
||||
selectCategory: 0,
|
||||
tradeData: null,
|
||||
//成交数据
|
||||
option: {
|
||||
title: {
|
||||
show: false
|
||||
@@ -33,7 +35,7 @@ const _sfc_main = {
|
||||
type: "cross"
|
||||
},
|
||||
formatter: function(params) {
|
||||
common_vendor.index.__f__("log", "at pages/index/stockDetails/stockDetails.vue:66", params);
|
||||
common_vendor.index.__f__("log", "at pages/index/stockDetails/stockDetails.vue:74", params);
|
||||
let res = "日期:" + params[0].name + "\n开盘价:" + params[0].data[1] + "\n收盘价:" + params[0].data[2] + "\n最低价:" + params[0].data[3] + "\n最高价:" + params[0].data[4];
|
||||
return res;
|
||||
}
|
||||
@@ -54,7 +56,7 @@ const _sfc_main = {
|
||||
axisLine: { onZero: false },
|
||||
splitLine: { show: false },
|
||||
min: "dataMin",
|
||||
max: "dataMax"
|
||||
max: ""
|
||||
},
|
||||
yAxis: {
|
||||
scale: true,
|
||||
@@ -82,10 +84,10 @@ const _sfc_main = {
|
||||
type: "candlestick",
|
||||
data: [],
|
||||
itemStyle: {
|
||||
color: "#ec0000",
|
||||
color0: "#00da3c",
|
||||
borderColor: "#ec0000",
|
||||
borderColor0: "#00da3c"
|
||||
color: "#ffffff",
|
||||
color0: "#355422",
|
||||
borderColor: "#c00000",
|
||||
borderColor0: "#355422"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -96,14 +98,13 @@ const _sfc_main = {
|
||||
},
|
||||
tooltip: {
|
||||
position: function(pos, params, dom, rect, size) {
|
||||
var obj = { top: "10%" };
|
||||
var obj = { top: "5%" };
|
||||
obj[["left", "right"][+(pos[0] < size.viewSize[0] / 2)]] = 5;
|
||||
return obj;
|
||||
},
|
||||
trigger: "axis",
|
||||
formatter: function(params) {
|
||||
common_vendor.index.__f__("log", "at pages/index/stockDetails/stockDetails.vue:137", params);
|
||||
let res = "时间:" + params[0].name + "\n高:" + params[0].data[2] + "\n开:" + params[0].data[3] + "\n低:" + params[0].data[4] + "\n收:" + params[0].data[1] + "\n涨幅:" + params[0].data[5] + "%";
|
||||
let res = "时间:" + params[0].name + "\n高:" + params[0].data[2] + "\n开:" + params[0].data[3] + "\n低:" + params[0].data[4] + "\n收:" + params[0].data[1] + "\n涨幅:" + params[0].data[5] + "%\n量:" + params[0].data[6] + "\n金额:" + params[0].data[7];
|
||||
return res;
|
||||
}
|
||||
},
|
||||
@@ -115,7 +116,10 @@ const _sfc_main = {
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
scale: true
|
||||
scale: true,
|
||||
axisLabel: {
|
||||
customValues: ["09:30", "10:00", "10:30", "11:00", "11:30", "13:00", "13:30", "14:00", "14:30", "15:00"]
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
show: false,
|
||||
@@ -197,13 +201,22 @@ const _sfc_main = {
|
||||
if (res.code == 200) {
|
||||
this.navTitle = res.data.basic_info.stock_name + "(" + res.data.basic_info.stock_code + ")";
|
||||
let data = res.data.minute_chart_data;
|
||||
this.tradeData = res.data.latest_trade;
|
||||
let categoryData = [];
|
||||
let valueData = [];
|
||||
let open = data[0].open;
|
||||
for (let item of data) {
|
||||
categoryData.push(item.time);
|
||||
let rate = utils_util.accMul(utils_util.accDiv(utils_util.accSub(item.close, open), open).toFixed(4), 100);
|
||||
valueData.push([item.time, item.close, item.high, item.open, item.low, rate]);
|
||||
let volume = item.volume;
|
||||
if (volume > 1e4) {
|
||||
volume = (volume / 1e4).toFixed(0) + "万";
|
||||
}
|
||||
let amount = item.amount;
|
||||
if (amount > 1e4) {
|
||||
amount = (amount / 1e4).toFixed(0) + "万";
|
||||
}
|
||||
valueData.push([item.time, item.close, item.high, item.open, item.low, rate, volume, amount]);
|
||||
}
|
||||
let min = open;
|
||||
let max = 0;
|
||||
@@ -239,7 +252,8 @@ const _sfc_main = {
|
||||
this.option1.yAxis.max = intervalList[intervalList.length - 1].toFixed(2);
|
||||
this.option1.series.data = valueData;
|
||||
let markData = [];
|
||||
let time = res.data.event_info;
|
||||
let time = res.data.event_info.event_start_time.split("T")[1];
|
||||
time = time.substring(0, 5);
|
||||
for (let item of intervalList) {
|
||||
markData.push(
|
||||
{
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view><nav-bar wx:if="{{a}}" u-i="ab03f7e6-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view wx:if="{{c}}" class="tabC fixed" style="{{e}}"><view wx:for="{{d}}" wx:for-item="item" wx:key="d" class="{{item.c}}" bindtap="{{item.e}}">{{item.a}} <view wx:if="{{item.b}}" class="line absolute"></view></view></view><view class="{{k}}" style="{{l}}"><view wx:if="{{f}}" style="width:750rpx;height:400rpx"><l-echart class="r" u-r="chartRef" u-i="ab03f7e6-1" bind:__l="__l"></l-echart></view><view class="section">关联描述</view><view class="des">{{h}}<text class="ai">(AI合成)【风险提示:解析内容由价值前沿人工采集整理自新闻、公告、研报等公开信息,团队辛苦编写,未经许可严禁转载。本产品内容内容均不构成投资建议,请投资者注意风险,独立审慎决策。】</text></view><view wx:if="{{i}}" class="section">信息来源</view><view class="list"><view wx:for="{{j}}" wx:for-item="item" wx:key="e" class="item"><view class="content">{{item.a}}</view><view class="article">——《{{item.b}}》</view><view class="authorDateC flex"><view class="author flex1">{{item.c}}</view><view class="date">{{item.d}}</view></view></view></view></view></view>
|
||||
<view><nav-bar wx:if="{{a}}" u-i="ab03f7e6-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view wx:if="{{c}}" class="tabC fixed" style="{{e}}"><view wx:for="{{d}}" wx:for-item="item" wx:key="d" class="{{item.c}}" bindtap="{{item.e}}">{{item.a}} <view wx:if="{{item.b}}" class="line absolute"></view></view></view><view class="{{k}}" style="{{l}}"><view wx:if="{{f}}" style="width:750rpx;height:400rpx"><l-echart class="r" u-r="chartRef" u-i="ab03f7e6-1" bind:__l="__l"></l-echart></view><view class="section">关联描述</view><view class="des">{{h}}<text class="ai">(AI合成)</text></view><view class="riskTips"> 【风险提示:解析内容由价值前沿人工采集整理自新闻、公告、研报等公开信息,团队辛苦编写,未经许可严禁转载。本产品内容内容均不构成投资建议,请投资者注意风险,独立审慎决策。】 </view><view wx:if="{{i}}" class="section">信息来源</view><view class="list"><view wx:for="{{j}}" wx:for-item="item" wx:key="e" class="item"><view class="content">{{item.a}}</view><view class="article">——《{{item.b}}》</view><view class="authorDateC flex"><view class="author flex1">{{item.c}}</view><view class="date">{{item.d}}</view></view></view></view></view></view>
|
||||
@@ -37,6 +37,14 @@
|
||||
bottom: 0;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.contentC .volumeAmountC {
|
||||
padding: 20rpx;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
.contentC .volumeAmountC .volume {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.contentC .section {
|
||||
padding: 0 28rpx;
|
||||
line-height: 80rpx;
|
||||
@@ -45,9 +53,7 @@
|
||||
color: #222;
|
||||
}
|
||||
.contentC .des {
|
||||
padding: 0 0 30rpx;
|
||||
margin: 0 25rpx;
|
||||
border-bottom: solid 1rpx #E4E4E4;
|
||||
line-height: 1.4rem;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
@@ -56,6 +62,14 @@
|
||||
.contentC .des .ai {
|
||||
color: #C00000;
|
||||
}
|
||||
.contentC .riskTips {
|
||||
margin: 20rpx 25rpx 0;
|
||||
padding-bottom: 30rpx;
|
||||
line-height: 1.4rem;
|
||||
font-size: 20rpx;
|
||||
color: #999;
|
||||
border-bottom: solid 1rpx #E4E4E4;
|
||||
}
|
||||
.contentC .list {
|
||||
padding: 0 25rpx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user