I'm attempting to showcase a price chart view for a specific cryptocurrency chosen from a list of cryptocurrencies, but I keep encountering a type mismatch error.
Within my application, I have utilized the angular-highcharts module and brought in the Chart library from that module.
import { Chart } from 'angular-highcharts';
series: [{
name: 'Price',
data: [{
id: this.comparearray[0].symbol,
name: this.comparearray[0].name,
y: this.comparearray[0].quotes.USD.price
}]
},
{
name: "Volume_24h",
data: [{
id: this.comparearray[0].symbol,
name: this.comparearray[0].name,
y: this.comparearray[0].quotes.USD.volume_24h
}]
}]
An error message is being displayed on all the lines above:
Type '{ name: string; data: { id: any; name: any; y: any; }[]; }' is not assignable to type 'SeriesAbandsOptions | SeriesAdOptions | SeriesAoOptions | SeriesApoOptions | SeriesAreaOptions | SeriesArearangeOptions | SeriesAreasplineOptions | SeriesAreasplinerangeOptions | ... 82 more ... | SeriesZigzagOptions'.
Property 'type' is missing in type '{ name: string; data: { id: any; name: any; y: any; }[]; }' but required in type 'SeriesXrangeOptions'.ts(2322) highcharts.d.ts(339172, 5): 'type' is declared here.
The goal is to generate a chart displaying the selected cryptocurrency's price and volume over a 24-hour period.