Skip to content

Commit 6fc0539

Browse files
author
Niilo Keinänen
committed
Update examples
1 parent e9329e7 commit 6fc0539

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@ const dashboard = lightningChart({
1010
}).Dashboard({
1111
theme: (() => {
1212
const t = Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined
13-
const smallView = Math.min(window.innerWidth, window.innerHeight) < 500
13+
const smallView = window.devicePixelRatio >= 2
1414
if (!window.__lcjsDebugOverlay) {
1515
window.__lcjsDebugOverlay = document.createElement('div')
1616
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'
1717
if (document.body) document.body.appendChild(window.__lcjsDebugOverlay)
1818
setInterval(() => {
1919
if (!window.__lcjsDebugOverlay.parentNode && document.body) document.body.appendChild(window.__lcjsDebugOverlay)
20-
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (Math.min(window.innerWidth, window.innerHeight) < 500)
20+
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (window.devicePixelRatio >= 2)
2121
}, 500)
2222
}
2323
return t && smallView ? lcjs.scaleTheme(t, 0.5) : t
2424
})(),
25+
textRenderer: window.devicePixelRatio >= 2 ? lcjs.htmlTextRenderer : undefined,
2526
numberOfRows: 1,
2627
numberOfColumns: 2,
2728
})

0 commit comments

Comments
 (0)