zz-chart
Advanced tools
Comparing version 0.1.0-beta.23 to 0.1.0-beta.24
@@ -16,2 +16,3 @@ import { StyleSheet, css } from 'aphrodite/no-important.js'; | ||
fontSize: '12px', | ||
whiteSpace: 'nowrap', | ||
// background: '#fff', | ||
@@ -72,3 +73,3 @@ }, | ||
markEl.className = `u-mark-x ${css(styles['mark-x'])}`; | ||
markEl.style.left = `${Math.round(u.valToPos(data, 'x'))}px`; | ||
const x = Math.round(u.valToPos(data, 'x')); | ||
let labelEl = markLabelE || document.createElement('div'); | ||
@@ -87,3 +88,12 @@ labelEl.className = `u-mark-x-label ${css(styles['mark-x-label'])}`; | ||
requestAnimationFrame(() => { | ||
markEl.style.top = `-${0 + parseInt(labelStyle.height, 10)}px`; | ||
const markElWidth = parseInt(labelStyle.width, 10) / 2; | ||
let left = x; | ||
if (x + markElWidth > u.over.clientWidth) { | ||
left = x - markElWidth; | ||
} | ||
if (x <= 0) { | ||
left = x + markElWidth; | ||
} | ||
markEl.style.left = `${left}px`; | ||
markEl.style.top = `-${parseInt(labelStyle.height, 10) + TEXT_SPACE}px`; | ||
}); | ||
@@ -90,0 +100,0 @@ !markLabelE && markEl.appendChild(labelEl); |
{ | ||
"name": "zz-chart", | ||
"version": "0.1.0-beta.23", | ||
"version": "0.1.0-beta.24", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "author": "Alauda", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
492496
12916