I am trying to convert UNIX time from this API into datetime to show on a chart, how could I do that? Here is the code I have:
import React, { useState, useEffect } from 'react';
import ReactDOM from 'react-dom';
import { Line } from '@ant-design/plots';
import { Card } from "antd";
import { DateTime } from 'luxon';
function App() {
const [data, setData] = useState([]);
useEffect(() => {
asyncFetch();
}, []);
const asyncFetch = () => {
fetch('https://api.llama.fi/charts/Ethereum')
.then((response) => response.json())
.then((json) => setData(json))
.catch((error) => {
console.log('fetch data failed', error);
});
};
const config = {
data,
padding: 'auto',
xField: 'date',
yField: 'totalLiquidityUSD'
Here is picture of the chart: