Stock growth chart example
Our next example (for the online demo, see http://joekuan.org/Learning_Highcharts/Chapter_11/chart2.html) is to demonstrate the following events:
chart.events
:addSeries
plotOptions.series.events
:click
,checkboxClick
, andlegendItemClick
plotOptions.series.point.events
:update
andremove
Suppose that we want to draft a long-term investment portfolio based on past stock growth performance as a reference. The demo contains a chart started with two series, Portfolio and Average growth, and a form to input stock symbols. Basically, we enter a stock symbol in this demo, and then a line series of stock growth is inserted into the chart.
So we can plot multiple stock yield trends and tweak their proportion in our portfolio to observe how the Average and Portfolio lines perform. The following screenshot shows the initial screen:
Plotting averaging series from displayed stock series
Let's query for two stocks and click on the Average legend to enable the series:
As expected...