Skip to content

Commit

Permalink
Merge pull request #100 from ElemeFE/1202-fix-time-axis
Browse files Browse the repository at this point in the history
修改:时间轴折线图 tooltip 显示问题
  • Loading branch information
西瓜 authored Dec 2, 2017
2 parents b358f28 + f691523 commit b6907ce
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
17 changes: 17 additions & 0 deletions examples/data/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ export default {
},
settings: {}
},
{
name: '时间轴折线图',
data: {
columns: ['日期', '余额', '年龄'],
rows: [
{ '日期': new Date(1512097200000), '余额': 123, '年龄': 3 },
{ '日期': new Date(1512097220000), '余额': 1223, '年龄': 6 },
{ '日期': new Date(1512097230000), '余额': 2123, '年龄': 9 },
{ '日期': new Date(1512097240000), '余额': 4123, '年龄': 12 },
{ '日期': new Date(1512097260000), '余额': 3123, '年龄': 15 },
{ '日期': new Date(1512097280000), '余额': 7123, '年龄': 20 }
]
},
settings: {
xAxisType: 'time'
}
},
{
name: 'label 属性配置',
data: {
Expand Down
4 changes: 3 additions & 1 deletion src/packages/line/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ function getLineTooltip (args) {
trigger: 'axis',
formatter (items) {
let tpl = []
tpl.push(`${items[0].name}<br>`)
const { name, axisValueLabel } = items[0]
const title = name || axisValueLabel
tpl.push(`${title}<br>`)
items.forEach(item => {
let showData = null
const type = ~rightList.indexOf(item.seriesName)
Expand Down

0 comments on commit b6907ce

Please sign in to comment.