Pergunta

I am working with HighStock to create a chart for stocks of various companies. In the API, it does not tell me how to retrieve the data about a stock, it is simply retrieving it in a JSON file. I am wondering if a stock parameter (Example: 'AAPL' or 'GOOG') can be passed in to retrieve this information.

HighStock Website

HighStock Examples

Foi útil?

Solução

The Highcharts/Highstock charts by default have turboThreshold that is used to save on expensive data checking and indexing in long series. So if you have a chart that is larger than the 1000 data points you have to do some server side processing to be able to display the chart. This example explains and illustrates that principle. Notice how when the zoom level changes the charts interval of data points changes. At first the interval is monthly as you zoom in it changes to semi-monthly, weekly, daily, hourly, and then when fully zoomed in minute.

This sample shows what is being done on the server to handle the current zoom level.

Highstock charts do not have any parameter(s) to retrieve information from any stock API. You have to code that functionality yourself. What I would suggest is using server side code to get the information from the API. Then format that data into a series with points and send it to the Highstock chart. keep in mind if you have a lot of data point to display you will have to do some sort of processing before sending it to the chart. If you send a series to a chart that has too many data points, the chart will simply not show the series.

So, make an effort at trying to produce the code needed to accomplish all of this. If you have any specific question during the process, hit us up.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top