2

I am working on getting a basic LightningChart example up and running in electron, looking to write a cross-platform charting app for my industry.

I grabbed the demo HTML code from the website and plopped it into my app, here's how it looks.

Blurry LightningChart JS image from Mac OS

As you can see the text is quite pixelated. Is this a Mac thing? Is it a chart setting?

It's not as bad in Windows:

Windows Screenshot of the Same App

Here's the code in my lightning.js source file.

// Replace the contents of this script tag if you want to test code from our examples:
// https://www.arction.com/lightningchart-js-interactive-examples/

// Extract required parts from LightningChartJS.
const {
    lightningChart
} = lcjs //Note: @arction/lcjs is not needed here, when using IIFE assembly

// Create a XY Chart.
const chart = lightningChart().ChartXY({
    // Set the chart into a div with id, 'target'. 
    // Chart's size will automatically adjust to div's size. 
    container: 'target'
})
    .setTitle('My first chart') // Set chart title

const data = [
    { x: 0, y: 1.52 },
    { x: 1, y: 1.56 },
    { x: 2, y: 1.42 },
    { x: 3, y: 1.85 },
    { x: 4, y: 1.62 }
]

// Add a line series.
const lineSeries = chart.addLineSeries()
    .setName('My data')
    .add(data)

Literally taken right from their website.

It's inserted into this tag in the HTML

    <!-- Create div to render the chart into-->
    <div id="target" class="row content"></div>

Thanks in advance for the help!

1 Answers1

2

Whelp, I figured it out, had to add this to the tag to enable support for high DPI devices. Jees!

<meta name="viewport" content="width=device-width, initial-scale=1.0">