Novos Recursos do
Mathematica
8: Visualização Financeira
◄
anterior
|
próximo
►
Gráficos & Visualização
Etiquete eventos históricos por data
Adicione etiquetas a pontos que correspondam com datas específicas.
In[1]:=
X
Clear[datelabel]; data = FinancialData["AAPL", "OHLC", {{2010, 10, 14}, {2010, 11, 5}}]; row[list_] := Row[list, " "]; stylelabel[label_] := Framed[label, Background -> LightYellow, ContentPadding -> False]; labels = {Style["Recent Company Events:", Bold], row@{stylelabel@"1", "Price hit new 52-week high ($315.00)"}, row@{stylelabel@"2", "Price hit new 52-week high ($319.00)"}, row@{stylelabel@"3", Hyperlink[ "APPLE INC Files SEC form 8-K, Results of Operations and \ Financial Condition, Financial Statements and Exhibits", "http://biz.yahoo.com/e/101018/aapl8-k.html"]}, row@{stylelabel@"4", Hyperlink["APPLE INC Files SEC form 10-K, Annual Report", "http://biz.yahoo.com/e/101027/aapl10-k.html"]}, row@{stylelabel@"5", "Price hit new 52-week high ($320.18)"}}; datelabel[label_, pos_: Above] := Placed[Column[{Framed[Style[label, 14], Background -> LightYellow, ContentPadding -> False]}, Center], pos]; Grid[{{CandlestickChart[data, EventLabels -> { {2010, 10, 15} -> datelabel["1"], {2010, 10, 18} -> datelabel["2"], {2010, 10, 18} -> datelabel["3", Below], {2010, 10, 27} -> datelabel["4"], {2010, 11, 4} -> datelabel["5"]}, ImageSize -> 500, BaseStyle -> {FontFamily -> "Helvetica"}, TrendStyle -> "Blue", Frame -> {Left, Right, Top}, FrameTicks -> {{True, True}, {False, False}}, Axes -> {True, False}, PlotRangePadding -> {None, {Scaled[0], Scaled[0.15]}}, ChartElementFunction -> "FadingCandlestick"]}, {Column[labels, ItemSize -> {45, 1}, Frame -> False, BaseStyle -> FontFamily -> "Helvetica"]}}, Alignment -> Center]
Out[1]=