Customize the Appearance of Chart Elements
Customize the Appearance of Chart Elements
Use different appearances for financial chart elements.
data = FinancialData["MSFT", "OHLC", {{2010, 1, 8}, {2010, 1, 15}}];cross[{{xmin_, xmax_}, {ymin_, ymax_}}, {o_, h_, l_, c_}, metadata_] := {Line[{{(xmin + xmax) / 2, l}, {(xmin + xmax) / 2, h}}], Line[{{xmin, o}, {xmax, c}}]}arrow[{{xmin_, xmax_}, {ymin_, ymax_}}, {o_, h_, l_, c_}, metadata_] := {Arrowheads[Large], Arrow[{{(xmin + xmax) / 2, o}, {(xmin + xmax) / 2, c}}], Line[{{{xmin, o}, {(xmin + xmax) / 2, o}, {(xmin + xmax) / 2, If[o < c, l, h]}}, {{xmax, c}, {(xmin + xmax) / 2, c}, {(xmin + xmax) / 2, If[o < c, h, l]}}}]}cf = {"GlassCandlestick", "FadingCandlestick", "OHLC", "HLC", "FadingOHLC", "ArrowCandlestick", cross, arrow, ChartElementDataFunction["ArrowCandlestick", "TaperRatio" -> 1., "ArrowheadAngle" -> 101, "ArrowWidth" -> 0.5]};Grid@Partition[Table[CandlestickChart[data, Axes -> False, GridLines -> None, AspectRatio -> 1, ImageSize -> 160, BarSpacing -> 0.3, TrendStyle -> "BlueYellow", ChartBaseStyle -> AbsoluteThickness[3], ChartElementFunction -> cf[[i]], PlotLabel -> If[StringQ[cf[[i]]], cf[[i]], "Customized"], BaseStyle -> {FontFamily -> "Helvetica"}], {i, 1, 9}], 3]