Skip to content

Commit 717a586

Browse files
author
Niilo Keinänen
committed
Update examples
1 parent 8f7627c commit 717a586

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,19 @@ const chart = lightningChart({
2121
legend: { visible: false },
2222
theme: (() => {
2323
const t = Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined
24-
const smallView = Math.min(window.innerWidth, window.innerHeight) < 500
24+
const smallView = window.devicePixelRatio >= 2
2525
if (!window.__lcjsDebugOverlay) {
2626
window.__lcjsDebugOverlay = document.createElement('div')
2727
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'
2828
if (document.body) document.body.appendChild(window.__lcjsDebugOverlay)
2929
setInterval(() => {
3030
if (!window.__lcjsDebugOverlay.parentNode && document.body) document.body.appendChild(window.__lcjsDebugOverlay)
31-
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (Math.min(window.innerWidth, window.innerHeight) < 500)
31+
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (window.devicePixelRatio >= 2)
3232
}, 500)
3333
}
3434
return t && smallView ? lcjs.scaleTheme(t, 0.5) : t
35-
})(),
35+
})(),
36+
textRenderer: window.devicePixelRatio >= 2 ? lcjs.htmlTextRenderer : undefined,
3637
})
3738

3839
chart

0 commit comments

Comments
 (0)