Skip to content

Commit bae7883

Browse files
author
Niilo Keinänen
committed
Update examples
1 parent 1646a6d commit bae7883

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
@@ -22,18 +22,19 @@ const dashboard = lightningChart({
2222
}).Dashboard({
2323
theme: (() => {
2424
const t = Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined
25-
const smallView = Math.min(window.innerWidth, window.innerHeight) < 500
25+
const smallView = window.devicePixelRatio >= 2
2626
if (!window.__lcjsDebugOverlay) {
2727
window.__lcjsDebugOverlay = document.createElement('div')
2828
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'
2929
if (document.body) document.body.appendChild(window.__lcjsDebugOverlay)
3030
setInterval(() => {
3131
if (!window.__lcjsDebugOverlay.parentNode && document.body) document.body.appendChild(window.__lcjsDebugOverlay)
32-
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (Math.min(window.innerWidth, window.innerHeight) < 500)
32+
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (window.devicePixelRatio >= 2)
3333
}, 500)
3434
}
3535
return t && smallView ? lcjs.scaleTheme(t, 0.5) : t
36-
})(),
36+
})(),
37+
textRenderer: window.devicePixelRatio >= 2 ? lcjs.htmlTextRenderer : undefined,
3738
numberOfColumns: 3,
3839
numberOfRows: 2,
3940
})

0 commit comments

Comments
 (0)