Skip to content

Commit 134a5cf

Browse files
author
Niilo Keinänen
committed
Update examples
1 parent 8f18005 commit 134a5cf

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
@@ -15,18 +15,19 @@ const chart = lightningChart({
1515
.ChartXY({
1616
theme: (() => {
1717
const t = Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined
18-
const smallView = Math.min(window.innerWidth, window.innerHeight) < 500
18+
const smallView = window.devicePixelRatio >= 2
1919
if (!window.__lcjsDebugOverlay) {
2020
window.__lcjsDebugOverlay = document.createElement('div')
2121
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'
2222
if (document.body) document.body.appendChild(window.__lcjsDebugOverlay)
2323
setInterval(() => {
2424
if (!window.__lcjsDebugOverlay.parentNode && document.body) document.body.appendChild(window.__lcjsDebugOverlay)
25-
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (Math.min(window.innerWidth, window.innerHeight) < 500)
25+
window.__lcjsDebugOverlay.textContent = window.innerWidth + 'x' + window.innerHeight + ' dpr=' + window.devicePixelRatio + ' small=' + (window.devicePixelRatio >= 2)
2626
}, 500)
2727
}
2828
return t && smallView ? lcjs.scaleTheme(t, 0.5) : t
29-
})(),
29+
})(),
30+
textRenderer: window.devicePixelRatio >= 2 ? lcjs.htmlTextRenderer : undefined,
3031
})
3132
.setTitle('Daily temperature range, April 2019')
3233

0 commit comments

Comments
 (0)