As in highcharts, datasets need to be input using the "add_data_set" or "add_data_from_jsonp" methods. Options can be either set by "set_options" method as showing here or construct a option dictionary object and input using "set_dict_options" method (recommended).
In highstock, the (new) feature "navigator" is automatically added into the bottom of the chart based on the first dataset added into chart. But the dataset used in navigator can be changed using add_navi_series and add_navi_series_from_jsonp methods:
add_navi_series(data, series_type="line", **kwargs)
add_navi_series_from_jsonp(data_src=None, data_name='json_data', series_type="line", **kwargs) add dataset from the data_src using jsonp. It is converted to jquery function "$.getJSON" in javascript environment
In most examples, add_data_from_jsonp method is used to show a similar practice in Highstock Demos
The following example is from Highstock Demos Single line series: http://www.highcharts.com/stock/demo/basic-line
In [1]:
from highcharts import Highstock
from highcharts.highstock.highstock_helper import jsonp_loader
H = Highstock()
data_url = 'http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?'
H.add_data_from_jsonp(data_url, 'json_data', 'line', 'AAPL', tooltip = {
'valueDecimals': 2
}
)
options = {
'rangeSelector' : {
'selected' : 1
},
'title' : {
'text' : 'AAPL Stock Price'
},
}
H.set_dict_options(options)
H
Out[1]: