Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
lightweight-charts - How to setup a chart background collor to black?

I am using the [lightweight-charts] javascript library to generate some charts. For this example I am using the Realtime emulation chart.

In this example the background color is white. I would like to set the background color to black. I am following the documentation but I can't achieve the goal.

Following is the code I am using but it is not working:

var chart = LightweightCharts.createChart(document.getElementById('chart'), {
    width: 1200,
    height: 800,
    background: '#000000',
    textColor: '#ffffff'
});


var candleSeries = chart.addCandlestickSeries();
var data = [...]

What am I missing?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You'll need to wrap both background & textColor within a layout property like

var chart = LightweightCharts.createChart(document.getElementById('chart'), {
  width: 1200,
  height: 800,
  layout: {
    background: {
      color: '#000000'
    },
    textColor: '#ffffff'
  }
});

as seen in this doc

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!