private void LookupButton_Click(object sender, EventArgs e) { string ticker = tickerBox.Text.ToUpper(); API_CALL call = new API_CALL(); currentStock = call.getspecificStock(ticker); StockInfoBox.Text = "Name: " + currentStock.Name + "\r\nTicker: " + currentStock.Symbol + "\r\nCurrent Price: " + currentStock.LastPrice.ToString() + " USD" + "\r\nRecord High : " + currentStock.High.ToString() + " USD" + "\r\nRecord Low : " + currentStock.Low.ToString() + " USD" + "\r\nTime Stamp : " + currentStock.TimeStamp; foreach (var series in chart1.Series) { series.Points.Clear(); } //Thread.Sleep(5000); Stockhist currentStockhist = new Stockhist(); currentStockhist = call.getstockhist(ticker, 365, "Day", "price"); if (currentStockhist.Dates != null) { for (int i = 0; i < currentStockhist.Positions.Length; i++) { chart1.Series["Close Price"].Points.AddXY(currentStockhist.Dates[i], currentStockhist.Elements[0].DataSeries.close.values[i]); } } }
public void chartest(string ticker) { //VolumeChart API_CALL call = new API_CALL(); Stockhist currentStock = new Stockhist(); currentStock = call.getstockhist(ticker, 365, "Day", "price"); if (currentStock.Dates != null) { for (int i = 0; i < currentStock.Positions.Length; i++) { VolumeChart.Series["Close Price"].Points.AddXY(currentStock.Dates[i], currentStock.Elements[0].DataSeries.close.values[i]); } } }