Stocks' growth chart example
Our next example is to demonstrate the following events:
chart.events
:addSeries
plotOptions.series.events
:click
,checkboxClick
,legendItemClick
plotOptions.series.point.events
:update
,remove
Suppose we want to draft a long term investment portfolio based on the stocks' past growth performance as a reference. The demo contains a chart started with two series, Portfolio and Average growths, 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 Average and Portfolio lines perform. The following screenshot shows the initial screen:
Plot averaging series from displayed stocks series
Let's query for two stocks and click on the Average legend to enable the series:
As expected, the Average line is plotted in between the two stock lines. Assuming the future growth is similar...