Skip to content

Commit 3c28af2

Browse files
author
Niilo Keinänen
committed
Update examples
1 parent 5de6658 commit 3c28af2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@ const chart = lightningChart({
1919
legend: { visible: false },
2020
theme: (() => {
2121
const t = Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined
22-
const smallView = Math.min(window.innerWidth, window.innerHeight) < 500
22+
const smallView = window.devicePixelRatio >= 2
2323
if (!window.__lcjsDebugOverlay) {
2424
window.__lcjsDebugOverlay = document.createElement('div')
2525
window.__lcjsDebugOverlay.style.cssText = 'position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);color:#fff;padding:4px 8px;z-index:99999;font:12px monospace;pointer-events:none'
2626
if (document.body) document.body.appendChild(window.__lcjsDebugOverlay)
2727
setInterval(() => {
2828
if (!window.__lcjsDebugOverlay.parentNode && document.body) document.body.appendChild(window.__lcjsDebugOverlay)
29-
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (Math.min(window.innerWidth, window.innerHeight) < 500)
29+
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (window.devicePixelRatio >= 2)
3030
}, 500)
3131
}
3232
return t && smallView ? lcjs.scaleTheme(t, 0.5) : t
33-
})(),
33+
})(),
34+
textRenderer: window.devicePixelRatio >= 2 ? lcjs.htmlTextRenderer : undefined,
3435
})
3536
.setTitle('TimeTickStrategy example')
3637

0 commit comments

Comments
 (0)