This Node application is comprised into two sections /client and /server. The client side contains the charting logic and the server side collects data located under the /data direcotry and provides access to them via a three different webapi get requests
It requests data from its server component and displays stock market close data in a HighChart as shown below:

- This project Utitlizes Angular 2 built with Typescript.
- The application was building us Mongo. If you want to connect the application to your own mongoDB, adjust the URL variable under /server/server.js. I have it pointing to my local DB on my network.
var URL = 'mongodb://172.16.0.9:27017/stocks';- right click to zoom onto any date range to view a more detailed view. Highcharts has interactive x-axis zooming built in by passing the object a zoom type
chart: {
type: 'line',
zoomType: 'x'
},- toggle the various series by clicking on the legends HighCharts does not include any regression on averages in its charting library, you need to use the stock charts for that type of funcitonality. We can manually calculate the moving average and add it to the charting surface as a seperate series.
calculateMovingAverage(arr,currentIndex){
var movingAverage = this.movingAverage,
currentVal = 0,
lowerBound = currentIndex - movingAverage;
while ( lowerBound < currentIndex ) {
currentVal = currentVal + arr[lowerBound];
lowerBound++;
}
currentVal = currentVal / movingAverage ;
return currentVal ;
}- the HighCharts line chart has native support for interactive toggling between the various stocks. Click on the series in the legend to show or hide the various series.
Additionally, this project was generated with Angular CLI version 1.0.0-rc.1.

