I am trying to set up a financial chart to display the time series data for a stock (lets say GOOG). How do you get the data from the template to the dataSource property? Am I not casting the type of data correctly? The chart is showing up on screen, but it is not displaying any data... Does anyone have experience with igx charts that can help? Im starting to wonder if you need to sign up with their service (ie pay money) just to try their charts?.. seems unlikely But I dont see anything on that here
I have tried following the steps outlined in their docs here: https://www.infragistics.com/products/ignite-ui-angular/angular/components/financialchart.html
seems simple enough, but no matter which way i slice it, the dataSource doesn't seem to be populating the data on the chart.
Here is how I fetch the data and change it to the way the igx dataSource needs it.
stockDailyDisplay: ChartDisplayModel[] = [];
getTimeSeriesDaily(stockSymbol: string) {
this.alphaService.getTimeSeriesDaily(stockSymbol).subscribe((resp: AlphavantageDailyResponse) => {
for (const [key, value] of Object.entries(resp['Time Series (Daily)'])) {
const s: ChartDisplayModel = {
time: new Date(key).toString(),
open: value['1. open'],
high: value['2. high'],
low: value['3. low'],
close: value['4. close'],
volume: value['5. volume']
};
this.stockDailyDisplay.push(s);
}
});
}
Template:
<igx-financial-chart
[dataSource]="stockDailyDisplay"
width="850px"
height="600px">
</igx-financial-chart>
Im not receiving any errors. And the data appears to be processing as expected. stockDailyDisplay
returns an Array of objects like so:
{time: string, open: string, high: string, low: string, close: string, volume: string}