I am having issues with using the lightweightcharts candlestick chart code with my own data.
Problem 1 is that the code below plots the candlestick chart as expected with my own financial csv file dataset, except it doesn’t plot the y-axis. I have tried several solutions but the y-axis still isn’t visible (see screenshot attached).
Here is the code to plot a static candlestick lightweight chart using your own csv file:
html file:
see screenshots below of code. Apparently the format isn’t right for stack overflow to upload….
HTML FILE CODE
js file:
see screenshots below of code. Apparently the format isn’t right for stack overflow to upload….
code part 1
code part 2
When I run the code it shows a beautiful candlestick chart in my browser (see image attached), however, the only thing that’s missing is the y-axis. How I can get the y-axis to plot with the values on it? I have attached another image of a candlestick chart which DOES show the y-axis. This is what I want on my chart. NOTE: The code that produces the candlestick chart with the y-axis shown on the chart doesn’t import the data from a csv file, it just lists the data as a long list of data points inside brackets () within the js file, whereas in the code above I have imported the data as a csv file.
CANDLESTICK CHART NO Y AXIS
CANDLESTICK CHART WITH Y AXIS
Problem 2 is that I want to plot a candlestick chart using NON-FINANCIAL data from a csv file. I thought that I would just be able to plug in my non-financial csv file into the code above, but unfortunately, running it produces a graph with nothing on it (see screenshot below).
BLANK CHART
Attached is the format of my financial data (date, high, low). The lightweightcharts code requires data in the format of date, open, high, low, close. I have tried removing open and close from the code so that the chart doesnt require those values, and I have also kept open and close in the code and set them to the high and low values to see if the code does indeed require at least some value for open and close. Both methods generate a chart that is blank (see screenshot attached). I have also attached a screenshot of the dataset; it is a very small dataset – perhaps this is the issue? Maybe there aren’t enough values to plot?
DATA SET
PS my non-financial data has values between 900 and 1150. The original data is between 0.9 and 1.15 but I multiplied it by 1000 because I thought perhaps the variation in the high and low values were too small to be seen on the chart, which is why the chart displays nothing. But I’m now not sure now why nothing is appearing on the chart.
I am writing my code on Visual Studio Code on Mac.
Thanks