Skip to content

Instantly share code, notes, and snippets.

@yoon-gu
Forked from mbostock/.block
Last active January 19, 2017 04:59
Show Gist options
  • Save yoon-gu/8a660040647d5a36ea3fba2e1f00c8f6 to your computer and use it in GitHub Desktop.
Save yoon-gu/8a660040647d5a36ea3fba2e1f00c8f6 to your computer and use it in GitHub Desktop.
감성고기 영업이익 Calendar View Template
license: gpl-3.0
height: 280
border: no

This example demonstrates loading of CSV data, which is then quantized into a diverging color scale. The values are visualized as colored cells per day. Days are arranged into columns by week, then grouped by month and years. Colors by Cynthia Brewer. Layout inspired by Rick Wicklin and Robert Allison. Dow Jones historical data copyright Yahoo! Finance or independent data provider; fair use for educational purposes.

Date Open High Low Close Volume Adj Close
2016-01-05 10789.72 10907.41 10759.14 10829.68 4298910000 10829.68
2016-01-06 10835.96 10960.99 10732.27 10788.05 4284160000 10788.05
2016-01-07 10857.98 10901.96 10759.75 10835.28 3990280000 10835.28
2016-01-08 10809.85 10905.44 10714.03 10858.14 4025840000 10858.14
2016-01-09 10860.03 10902.52 10776.44 10812.04 3587860000 10812.04
2016-01-11 10664.39 10897.83 10664.39 10860.26 4123950000 10860.26
2016-01-12 10738.48 10779.65 10610.12 10662.42 3847850000 10662.42
2016-01-13 10761.11 10829.75 10682.40 10739.31 3911070000 10739.31
2016-01-14 10753.39 10844.89 10674.83 10761.03 4175660000 10761.03
2016-01-15 10608.08 10783.51 10594.38 10753.62 3364080000 10753.62
2016-01-16 10595.44 10689.29 10529.67 10607.85 4086140000 10607.85
2016-01-18 10571.75 10624.58 10499.43 10594.83 3364080000 10594.83
2016-01-19 10526.42 10609.21 10453.15 10572.73 3369840000 10572.73
2016-01-20 10544.81 10622.69 10460.34 10526.49 4521050000 10526.49
2016-01-21 10458.60 10605.73 10458.45 10544.13 4521050000 10544.13
2016-01-22 10415.01 10502.80 10376.34 10462.77 3061160000 10462.77
2016-01-23 10388.22 10515.86 10359.23 10415.24 3387770000 10415.24
2016-01-25 10338.57 10460.50 10318.93 10387.01 3224640000 10387.01
2016-01-26 10446.80 10448.99 10304.44 10340.69 3107380000 10340.69
2016-01-27 10321.92 10484.71 10321.92 10447.93 3534500000 10447.93
2016-01-28 10270.08 10350.98 10211.80 10320.10 3704210000 10320.10
2016-01-29 10016.01 10305.87 10016.01 10269.47 4396880000 10269.47
2016-01-30 10006.42 10101.53 9915.73 10014.72 4038770000 10014.72
2016-01-31 10145.58 10170.10 10005.56 10009.73 2917990000 10009.73
2016-02-01 9982.40 10176.30 9925.11 10150.65 4102460000 10150.65
2016-02-02 10059.83 10138.12 9959.17 9985.81 3646710000 9985.81
2016-02-03 10040.15 10104.18 9925.34 10060.06 4360190000 10060.06
2016-02-04 10170.86 10170.86 9975.86 10040.45 4436330000 10040.45
2016-02-05 10215.51 10328.88 10146.18 10174.41 3210950000 10174.41
2016-02-06 10270.98 10276.13 10131.88 10213.62 3761570000 10213.62
2016-02-07 10411.15 10412.29 10202.34 10271.21 4290540000 10271.21
2016-02-12 10398.59 10486.38 10308.83 10415.54 3724260000 10415.54
2016-02-13 10297.55 10501.67 10297.55 10405.85 3968210000 10405.85
2016-02-15 10303.07 10354.39 10193.26 10302.01 3142450000 10302.01
2016-02-16 10320.33 10381.86 10254.18 10303.15 3328890000 10303.15
2016-02-17 10361.58 10388.37 10222.85 10319.95 4521050000 10319.95
2016-02-18 10631.82 10631.82 10339.63 10378.83 4511860000 10378.83
2016-02-19 10696.63 10717.21 10522.63 10644.25 3979360000 10644.25
2016-02-20 10654.62 10755.66 10618.26 10698.75 3191630000 10698.75
2016-02-22 10668.55 10688.08 10491.37 10653.56 3857890000 10653.56
2016-02-23 10679.67 10712.37 10571.60 10674.98 3685560000 10674.98
2016-02-24 10630.20 10738.48 10583.10 10680.43 4057850000 10680.43
2016-02-25 10673.92 10714.19 10564.18 10636.38 4071820000 10636.38
2016-02-26 10468.82 10715.21 10468.82 10674.38 4144180000 10674.38
2016-02-27 10465.19 10528.84 10327.37 10465.94 4006450000 10465.94
2016-02-29 10498.94 10609.74 10383.45 10467.16 4612420000 10467.16
2016-03-01 10537.01 10586.36 10445.17 10497.88 4002390000 10497.88
2016-03-02 10525.28 10632.52 10460.65 10537.69 4725690000 10537.69
2016-03-03 10424.17 10545.94 10391.02 10525.43 4009650000 10525.43
2016-03-04 10321.16 10465.19 10237.84 10424.62 4524570000 10424.62
2016-03-05 10121.81 10391.78 10121.81 10322.30 4826900000 10322.30
2016-03-07 10226.02 10310.04 10053.85 10120.53 4747180000 10120.53
2016-03-08 10151.48 10248.20 9973.17 10229.96 4713280000 10229.96
2016-03-09 10098.12 10213.09 10051.28 10154.43 4089500000 10154.43
2016-03-10 10356.20 10356.20 10071.63 10097.90 5297350000 10097.90
2016-03-11 10367.10 10409.49 10216.04 10359.31 4552470000 10359.31
2016-03-12 10370.96 10423.03 10265.16 10366.72 4521050000 10366.72
2016-03-14 10217.55 10436.20 10217.55 10363.02 4640460000 10363.02
2016-03-15 10199.24 10260.62 10121.13 10216.27 3426990000 10216.27
2016-03-16 10137.93 10226.48 10079.05 10198.03 3506570000 10198.03
2016-03-17 10019.26 10175.02 9987.02 10138.99 4548460000 10138.99
2016-03-18 9736.85 10029.93 9716.38 10018.28 4931220000 10018.28
2016-03-19 9689.21 9880.76 9648.26 9743.62 4691240000 9743.62
2016-03-21 9732.23 9798.19 9603.80 9686.48 3968500000 9686.48
2016-03-22 9773.27 9834.71 9596.04 9732.53 6435770000 9732.53
2016-03-23 9868.34 9951.47 9741.07 9774.02 5067080000 9774.02
2016-03-24 10135.72 10135.72 9786.45 9870.30 6136700000 9870.30
2016-03-25 10143.05 10246.82 10070.12 10138.52 3896410000 10138.52
2016-03-26 10153.48 10261.10 10039.97 10143.81 5128840000 10143.81
2016-03-28 10297.08 10314.31 10112.60 10152.80 4814830000 10152.80
2016-03-29 10293.30 10393.89 10195.81 10298.44 4526150000 10298.44
2016-03-30 10441.95 10524.78 10276.14 10293.52 4514380000 10293.52
2016-03-31 10452.46 10627.19 10387.54 10442.41 4514360000 10442.41
2016-04-01 10435.00 10513.75 10379.60 10450.64 4555360000 10450.64
2016-04-02 10409.98 10479.74 10293.49 10434.17 4557760000 10434.17
2016-04-04 10404.24 10456.39 10289.37 10409.46 5002600000 10409.46
2016-04-05 10192.40 10416.11 10192.40 10404.77 4644490000 10404.77
2016-04-06 10211.83 10354.97 10175.02 10190.89 4425830000 10190.89
2016-04-07 10166.78 10235.10 10038.31 10211.07 4059280000 10211.07
2016-04-08 9901.67 10206.61 9901.67 10172.53 5144780000 10172.53
2016-04-09 9941.57 10093.33 9859.04 9899.25 5983200000 9899.25
2016-04-11 9812.94 9971.57 9726.33 9939.98 6192750000 9939.98
2016-04-12 9931.75 10025.84 9798.73 9816.49 5467560000 9816.49
2016-04-13 10249.61 10249.61 9881.11 9931.97 6180580000 9931.97
2016-04-14 10250.67 10348.84 10158.92 10255.28 4995970000 10255.28
2016-04-15 10025.61 10256.57 10007.09 10249.54 5026360000 10249.54
2016-04-16 10133.94 10249.27 9976.56 10024.02 5271480000 10024.02
2016-04-18 10258.00 10293.45 10078.66 10136.63 4871210000 10136.63
2016-04-19 9971.73 10279.01 9971.73 10258.99 5698460000 10258.99
2016-04-20 10045.11 10211.60 9937.79 9974.45 4521050000 9974.45
2016-04-21 10061.43 10061.43 9756.11 10043.75 7329580000 10043.75
2016-04-22 10193.46 10235.63 10028.78 10066.57 5224040000 10066.57
2016-04-23 10063.93 10225.88 9860.93 10193.39 5452130000 10193.39
2016-04-25 10440.21 10440.21 10042.46 10068.01 8328569600 10068.01
2016-04-26 10505.70 10558.56 10306.22 10444.37 6765800000 10444.37
2016-04-27 10625.45 10760.05 10463.15 10510.95 6170840000 10510.95
2016-04-28 10616.98 10707.30 10424.72 10625.83 5922920000 10625.83
2016-04-29 10780.68 10780.68 10509.89 10620.16 6126400000 10620.16
2016-04-30 10896.61 10952.84 10752.72 10782.95 4870640000 10782.95
2016-05-02 10742.15 10941.88 10725.81 10896.91 5225460000 10896.91
2016-05-03 10780.00 10888.30 10653.71 10748.26 5842550000 10748.26
2016-05-04 10386.18 10880.14 10386.18 10785.14 6893700000 10785.14
2016-05-05 10519.42 10622.27 10221.50 10380.43 9472910400 10380.43
2016-05-06 10862.22 10925.86 9787.17 10520.32 10617809600 10520.32
2016-05-07 10918.40 10984.05 10754.30 10868.12 6795940000 10868.12
2016-05-09 11149.48 11149.48 10843.71 10926.77 6594720000 10926.77
2016-05-10 11009.60 11203.37 11004.15 11151.83 4938050000 11151.83
2016-05-11 11168.23 11235.94 10984.35 11008.61 6048260000 11008.61
2016-05-12 11045.64 11232.54 11045.64 11167.32 6059410000 11167.32
2016-05-13 10988.87 11115.63 10938.48 11045.27 6342310000 11045.27
2016-05-14 11203.67 11260.88 10962.81 10991.99 7454540000 10991.99
2016-05-16 11205.11 11308.95 11150.01 11205.03 5647760000 11205.03
2016-05-17 11132.18 11247.20 11058.87 11204.28 5326060000 11204.28
2016-05-18 11119.78 11175.33 10975.66 11134.29 6035780000 11134.29
2016-05-19 11116.91 11217.35 11018.59 11124.92 5724310000 11124.92
2016-05-20 11093.11 11190.22 11045.80 11117.06 5316590000 11117.06
2016-05-21 11018.36 11116.76 10940.60 11092.05 6597740000 11092.05
2016-05-23 11143.66 11186.82 10947.55 11018.66 8108470400 11018.66
2016-05-24 11122.96 11189.61 11051.31 11144.57 5995330000 11144.57
2016-05-25 11020.70 11147.14 11004.61 11123.11 5760040000 11123.11
2016-05-26 11006.72 11072.70 10925.86 11019.42 5403580000 11019.42
2016-05-27 10996.75 11066.96 10957.22 11005.97 4607090000 11005.97
2016-05-28 10926.92 11032.12 10894.19 10997.35 4511570000 10997.35
2016-05-30 10896.99 10969.92 10810.15 10927.07 4726970000 10927.07
2016-05-31 10961.95 11000.22 10835.77 10897.52 5101430000 10897.52
2016-06-01 10972.49 11017.76 10893.89 10969.99 4086180000 10969.99
2016-06-02 10927.45 11026.75 10880.36 10973.55 3881620000 10973.55
2016-06-03 10857.31 10983.14 10851.57 10927.07 4006870000 10927.07
2016-06-04 10907.34 10933.19 10802.22 10856.63 4484340000 10856.63
2016-06-06 10895.02 10968.56 10837.21 10907.42 4085000000 10907.42
2016-06-07 10849.23 10954.43 10827.91 10895.86 4375580000 10895.86
2016-06-08 10841.29 10934.85 10801.84 10850.36 4708420000 10850.36
2016-06-09 10837.51 10985.26 10818.77 10841.21 5668900000 10841.21
2016-06-10 10887.62 10925.48 10788.77 10836.15 4705750000 10836.15
2016-06-11 10787.18 10906.06 10752.41 10888.83 4411640000 10888.83
2016-06-13 10741.00 10836.68 10672.23 10785.89 4261680000 10785.89
2016-06-14 10780.00 10869.55 10665.35 10741.98 5212410000 10741.98
2016-06-15 10733.44 10821.49 10686.89 10779.17 4234510000 10779.17
2016-06-16 10686.36 10787.86 10658.10 10733.67 4963200000 10733.67
2016-06-17 10642.53 10717.42 10594.16 10685.98 4369770000 10685.98
2016-06-18 10623.41 10680.32 10540.65 10642.15 4164110000 10642.15
2016-06-20 10611.77 10690.90 10561.66 10624.69 4928160000 10624.69
2016-06-21 10560.98 10626.73 10489.87 10611.84 4669060000 10611.84
2016-06-22 10560.13 10639.05 10502.64 10567.33 5469120000 10567.33
2016-06-23 10552.24 10637.46 10493.49 10564.38 5185570000 10564.38
2016-06-24 10563.78 10632.48 10500.90 10552.52 3774680000 10552.52
2016-06-25 10445.13 10587.13 10445.13 10566.20 4133000000 10566.20
2016-06-27 10396.53 10484.05 10363.88 10444.14 3945010000 10444.14
2016-06-28 10406.28 10496.22 10359.58 10396.76 3951320000 10396.76
2016-06-29 10404.16 10493.80 10359.80 10405.98 4134680000 10405.98
2016-06-30 10326.10 10444.60 10320.05 10403.79 3847640000 10403.79
2016-07-01 10321.41 10391.24 10250.45 10325.26 3945190000 10325.26
2016-07-02 10366.60 10366.60 10155.75 10321.03 4521130000 10321.03
2016-07-04 10284.00 10416.94 10271.61 10374.16 4168360000 10374.16
2016-07-05 10383.16 10430.16 10239.34 10282.41 4521050000 10282.41
2016-07-06 10402.43 10468.55 10333.05 10383.38 3814440000 10383.38
2016-07-07 10387.77 10459.18 10316.50 10402.35 3944280000 10402.35
2016-07-08 10309.39 10416.79 10255.58 10392.90 3878620000 10392.90
2016-07-09 10261.48 10366.83 10223.16 10309.24 4259230000 10309.24
2016-07-11 10100.81 10292.62 10100.81 10268.81 4080770000 10268.81
2016-07-12 10137.23 10140.18 9962.13 10099.14 4160680000 10099.14
2016-07-13 10037.85 10184.85 9963.19 10144.19 4400870000 10144.19
2016-07-14 10055.46 10120.15 9946.26 10038.38 4251450000 10038.38
2016-07-15 9910.28 10154.24 9910.28 10058.64 5114260000 10058.64
2016-07-16 10005.43 10059.24 9882.85 9908.39 4089820000 9908.39
2016-07-18 10003.69 10078.89 9822.84 10012.23 6438900000 10012.23
2016-07-19 10273.12 10273.12 9984.35 10002.18 5859690000 10002.18
2016-07-20 10291.73 10356.86 10192.03 10270.55 4285450000 10270.55
2016-07-21 10186.13 10333.35 10138.75 10296.85 4749540000 10296.85
2016-07-22 10068.99 10227.24 10068.99 10185.53 4077610000 10185.53
2016-07-23 10122.04 10272.29 10014.35 10067.33 5412850000 10067.33
2016-07-25 10236.92 10310.68 10023.80 10120.46 5452400000 10120.46
2016-07-26 10194.29 10294.13 10060.98 10236.16 5319120000 10236.16
2016-07-27 10195.35 10323.00 10102.17 10194.29 4731910000 10194.29
2016-07-28 10175.10 10316.65 10135.95 10196.86 4481390000 10196.86
2016-07-29 10389.58 10450.04 10133.15 10172.98 6208650000 10172.98
2016-07-30 10603.91 10651.14 10334.18 10389.88 6874289600 10389.88
2016-08-01 10719.69 10719.69 10492.36 10603.15 4810560000 10603.15
2016-08-02 10608.37 10763.45 10555.47 10725.43 4724830000 10725.43
2016-08-03 10706.99 10736.54 10529.09 10609.65 4758730000 10609.65
2016-08-04 10680.16 10767.15 10619.02 10710.55 3915200000 10710.55
2016-08-05 10628.09 10747.12 10569.07 10680.77 4170360000 10680.77
2016-08-06 10662.86 10701.48 10523.35 10627.26 4716160000 10627.26
2016-08-08 10620.31 10739.87 10538.91 10663.99 4255780000 10663.99
2016-08-09 10606.40 10653.11 10509.74 10618.19 4389590000 10618.19
2016-08-10 10571.11 10655.60 10471.73 10606.86 5270680000 10606.86
2016-08-11 10564.72 10655.22 10488.28 10573.68 4972660000 10573.68
2016-08-12 10584.56 10647.14 10468.86 10572.02 2491020000 10572.02
2016-08-13 10430.69 10641.62 10430.69 10583.96 3991400000 10583.96
2016-08-15 10548.51 10578.74 10420.56 10428.05 2076990000 10428.05
2016-08-16 10544.36 10583.28 10470.75 10548.51 2277300000 10548.51
2016-08-17 10547.83 10605.65 10518.59 10545.41 2491020000 10545.41
2016-08-18 10517.91 10585.02 10477.25 10547.08 2716400000 10547.08
2016-08-19 10467.12 10541.26 10450.95 10520.10 1267710000 10520.10
2016-08-20 10464.32 10520.93 10409.00 10466.44 3166870000 10466.44
2016-08-22 10414.67 10511.56 10399.33 10464.93 3641130000 10464.93
2016-08-23 10330.10 10489.41 10330.10 10414.14 3977340000 10414.14
2016-08-24 10309.39 10412.55 10237.75 10328.89 6325890000 10328.89
2016-08-25 10439.99 10439.99 10279.39 10308.26 7615070400 10308.26
2016-08-26 10449.81 10552.75 10401.90 10441.12 4829820000 10441.12
2016-08-27 10499.31 10542.09 10380.96 10452.00 5045100000 10452.00
2016-08-29 10471.28 10566.88 10431.60 10501.05 4548490000 10501.05
2016-08-30 10403.41 10516.47 10385.42 10471.50 3791090000 10471.50
2016-08-31 10336.00 10479.06 10332.14 10405.83 3996490000 10405.83
2016-09-01 10282.85 10377.11 10207.29 10337.05 4115410000 10337.05
2016-09-02 10385.42 10385.42 10216.44 10285.97 4748030000 10285.97
2016-09-03 10386.86 10478.23 10321.11 10390.11 4103360000 10390.11
2016-09-05 10368.57 10549.04 10285.44 10388.90 5781140000 10388.90
2016-09-06 10455.63 10533.55 10338.49 10366.15 4810030000 10366.15
2016-09-07 10470.44 10537.63 10386.03 10452.68 3941340000 10452.68
2016-09-08 10343.82 10537.03 10343.82 10471.58 4249310000 10471.58
2016-09-09 10309.77 10394.34 10238.05 10344.84 3895520000 10344.84
2016-09-10 10452.23 10452.23 10179.33 10309.92 2362910000 10309.92
2016-09-11 10432.96 10513.60 10385.65 10464.40 3036350000 10464.40
2016-09-12 10451.25 10488.66 10335.62 10433.71 3700820000 10433.71
2016-09-13 10320.13 10524.40 10320.13 10450.95 3827920000 10450.95
2016-09-14 10327.91 10377.41 10237.60 10318.16 3751230000 10318.16
2016-09-19 10425.33 10425.33 10226.41 10332.44 4178030000 10332.44
2016-09-20 10426.27 10471.28 10330.33 10426.31 4293340000 10426.31
2016-09-21 10404.77 10465.76 10318.69 10437.42 3824070000 10437.42
2016-09-22 10267.53 10465.83 10267.53 10406.96 4565850000 10406.96
2016-09-23 10197.85 10332.29 10162.93 10270.47 3792610000 10270.47
2016-09-24 10289.82 10341.21 10157.64 10197.47 4160250000 10197.47
2016-09-26 10247.42 10357.38 10217.19 10291.26 4286700000 10291.26
2016-09-27 10223.01 10300.33 10148.12 10246.97 4394770000 10246.97
2016-09-28 10020.62 10248.93 10020.62 10226.94 4460030000 10226.94
2016-09-29 10001.35 10077.08 9898.49 10023.42 4277130000 10023.42
2016-09-30 9807.80 10043.75 9807.80 10005.96 4848350000 10005.96
2016-10-01 9767.30 9962.35 9745.76 9802.14 5635510000 9802.14
2016-10-03 9787.47 9844.84 9649.78 9771.91 5487500000 9771.91
2016-10-04 9712.13 9883.68 9647.06 9789.44 6202640000 9789.44
2016-10-05 9961.52 9980.19 9664.89 9712.73 6512420000 9712.73
2016-10-06 9762.91 9996.67 9762.91 9962.58 5595040000 9962.58
2016-10-07 9881.11 9940.89 9723.31 9762.69 6600350000 9762.69
2016-10-08 9868.34 9994.55 9802.36 9882.17 5337380000 9882.17
2016-10-10 9972.33 10107.99 9817.55 9867.96 6363380000 9867.96
2016-10-11 10099.90 10138.59 9908.70 9972.18 4767460000 9972.18
2016-10-12 9946.18 10133.08 9879.07 10081.31 5192410000 10081.31
2016-10-13 10038.84 10157.94 9909.83 9949.36 5616290000 9949.36
2016-10-14 10092.42 10157.26 9952.98 10041.48 5396930000 10041.48
2016-10-15 9996.67 10146.61 9967.49 10092.19 4619240000 10092.19
2016-10-17 10061.36 10072.62 9884.51 9995.91 4894740000 9995.91
2016-10-18 10014.88 10087.43 9916.93 10062.94 5369780000 10062.94
2016-10-19 9873.55 10064.98 9873.55 10015.86 5406420000 10015.86
2016-10-20 9883.98 9935.53 9780.90 9871.06 4320480000 9871.06
2016-10-21 9865.24 9978.07 9814.45 9885.80 3710430000 9885.80
2016-10-22 9786.04 9890.41 9731.32 9864.94 3763780000 9864.94
2016-10-24 9728.22 9872.50 9709.78 9786.87 4988400000 9786.87
2016-10-25 9725.69 9782.56 9634.96 9725.58 4238220000 9725.58
2016-10-26 9601.26 9793.37 9601.26 9731.25 5029840000 9731.25
2016-10-27 9488.73 9640.33 9449.81 9599.75 4313310000 9599.75
2016-10-28 9507.62 9571.71 9378.77 9487.67 5583240000 9487.67
2016-10-29 9711.60 9714.70 9482.98 9509.28 5791450000 9509.28
2016-10-31 9741.83 9817.17 9583.04 9712.28 5998860000 9712.28
2016-11-01 9789.74 9861.99 9705.10 9742.20 4949900000 9742.20
2016-11-02 9663.23 9861.39 9658.09 9789.36 3726950000 9789.36
2016-11-03 9706.68 9781.73 9605.19 9665.19 4507090000 9665.19
2016-11-04 9749.99 9836.82 9637.53 9707.44 5505610000 9707.44
2016-11-05 9830.63 9937.72 9724.90 9748.55 5531930000 9748.55
2016-11-07 9779.61 9890.71 9742.96 9829.87 5246600000 9829.87
2016-11-08 9818.61 9846.12 9688.40 9778.86 4615280000 9778.86
2016-11-09 9784.75 9898.57 9751.27 9820.20 5607970000 9820.20
2016-11-10 9789.82 9896.38 9706.23 9783.92 6668110000 9783.92
2016-11-11 9683.71 9837.05 9648.95 9791.71 6793529600 9791.71
2016-11-12 9626.42 9745.91 9553.80 9683.41 6185620000 9683.41
2016-11-14 9598.08 9662.10 9492.96 9626.80 4979610000 9626.80
2016-11-15 9625.44 9698.67 9532.11 9605.41 4922600000 9605.41
2016-11-16 9546.54 9666.55 9479.20 9627.48 5191380000 9627.48
2016-11-17 9496.59 9604.43 9435.45 9547.22 5202550000 9547.22
2016-11-18 9440.13 9564.45 9402.80 9497.34 5235160000 9497.34
2016-11-19 9345.36 9465.37 9302.28 9441.27 4097370000 9441.27
2016-11-21 9282.03 9350.27 9252.93 9344.61 4624280000 9344.61
2016-11-22 9306.21 9378.77 9223.08 9280.67 5842730000 9280.67
2016-11-23 9492.32 9573.67 9275.15 9310.60 6862360000 9310.60
2016-11-24 9542.91 9552.97 9389.27 9496.28 5004560000 9496.28
2016-11-25 9582.74 9666.71 9476.63 9544.20 5785780000 9544.20
2016-11-26 9541.63 9629.98 9440.43 9580.63 5785880000 9580.63
2016-11-28 9538.61 9613.65 9446.71 9543.52 5080060000 9543.52
2016-11-29 9509.21 9646.53 9485.70 9539.29 5768740000 9539.29
2016-11-30 9506.18 9625.89 9442.17 9509.28 6302450000 9509.28
2016-12-01 9347.86 9549.19 9347.86 9505.96 5885550000 9505.96
2016-12-02 9278.55 9385.72 9237.52 9350.05 4893160000 9350.05
2016-12-03 9208.68 9333.34 9099.14 9279.16 4257000000 9279.16
2016-12-05 9134.36 9262.08 9124.08 9217.94 4198970000 9217.94
2016-12-06 9313.85 9313.85 9078.28 9135.34 4854970000 9135.34
2016-12-07 9398.04 9425.17 9214.47 9321.40 4940750000 9321.40
2016-12-08 9362.29 9448.97 9269.26 9398.19 5250660000 9398.19
2016-12-09 9236.06 9442.47 9199.80 9361.61 5498170000 9361.61
2016-12-10 9334.33 9351.86 9180.23 9241.45 5773160000 9241.45
2016-12-12 9368.41 9420.56 9249.99 9337.95 5406080000 9337.95
2016-12-13 9258.45 9466.89 9258.45 9370.07 6827089600 9370.07
2016-12-14 9277.19 9378.01 9168.44 9256.26 6753380000 9256.26
2016-12-15 9315.36 9374.38 9173.20 9280.97 7242120000 9280.97
2016-12-16 9285.05 9370.30 9207.21 9320.19 5713700000 9320.19
2016-12-17 9173.65 9342.11 9162.09 9286.56 5603440000 9286.56
2016-12-19 9154.61 9264.65 9081.30 9171.61 5139070000 9171.61
2016-12-20 9072.84 9298.13 9072.84 9154.46 6035180000 9154.46
2016-12-21 9092.34 9141.23 8967.26 9070.72 5178770000 9070.72
2016-12-22 9106.92 9154.76 8980.03 9096.72 5490350000 9096.72
2016-12-23 9093.09 9154.23 8996.58 9108.51 4631290000 9108.51
2016-12-24 9066.11 9144.48 8955.77 9093.24 4458300000 9093.24
2016-12-26 8882.31 9143.05 8837.95 9069.29 5761650000 9069.29
2016-12-27 8912.39 8993.48 8802.13 8881.26 4634100000 8881.26
2016-12-28 8848.15 8991.07 8780.82 8915.94 5309300000 8915.94
2016-12-29 8746.05 8884.43 8717.26 8848.15 4853150000 8848.15
2016-12-30 8711.89 8797.97 8638.81 8743.94 5141380000 8743.94
2016-12-31 8612.66 8750.28 8543.97 8711.82 4898640000 8711.82
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
shape-rendering: crispEdges;
}
.day {
fill: #fff;
stroke: #ccc;
}
.month {
fill: none;
stroke: #000;
stroke-width: 2px;
}
.RdYlGn .q0-11{fill:rgb(165,0,38)}
.RdYlGn .q1-11{fill:rgb(215,48,39)}
.RdYlGn .q2-11{fill:rgb(244,109,67)}
.RdYlGn .q3-11{fill:rgb(253,174,97)}
.RdYlGn .q4-11{fill:rgb(254,224,139)}
.RdYlGn .q5-11{fill:rgb(255,255,191)}
.RdYlGn .q6-11{fill:rgb(217,239,139)}
.RdYlGn .q7-11{fill:rgb(166,217,106)}
.RdYlGn .q8-11{fill:rgb(102,189,99)}
.RdYlGn .q9-11{fill:rgb(26,152,80)}
.RdYlGn .q10-11{fill:rgb(0,104,55)}
</style>
<body>
<script src="//d3js.org/d3.v3.min.js"></script>
<script>
var width = 960,
height = 136,
cellSize = 17; // cell size
var percent = d3.format(".1%"),
format = d3.time.format("%Y-%m-%d");
var color = d3.scale.quantize()
.domain([-.05, .05])
.range(d3.range(11).map(function(d) { return "q" + d + "-11"; }));
var svg = d3.select("body").selectAll("svg")
.data(d3.range(2016, 2018))
.enter().append("svg")
.attr("width", width)
.attr("height", height)
.attr("class", "RdYlGn")
.append("g")
.attr("transform", "translate(" + ((width - cellSize * 53) / 2) + "," + (height - cellSize * 7 - 1) + ")");
svg.append("text")
.attr("transform", "translate(-6," + cellSize * 3.5 + ")rotate(-90)")
.style("text-anchor", "middle")
.text(function(d) { return d; });
var rect = svg.selectAll(".day")
.data(function(d) { return d3.time.days(new Date(d, 0, 1), new Date(d + 1, 0, 1)); })
.enter().append("rect")
.attr("class", "day")
.attr("width", cellSize)
.attr("height", cellSize)
.attr("x", function(d) { return d3.time.weekOfYear(d) * cellSize; })
.attr("y", function(d) { return d.getDay() * cellSize; })
.datum(format);
rect.append("title")
.text(function(d) { return d; });
svg.selectAll(".month")
.data(function(d) { return d3.time.months(new Date(d, 0, 1), new Date(d + 1, 0, 1)); })
.enter().append("path")
.attr("class", "month")
.attr("d", monthPath);
d3.csv("dji.csv", function(error, csv) {
if (error) throw error;
var data = d3.nest()
.key(function(d) { return d.Date; })
.rollup(function(d) { return (d[0].Close - d[0].Open) / d[0].Open; })
.map(csv);
rect.filter(function(d) { return d in data; })
.attr("class", function(d) { return "day " + color(data[d]); })
.select("title")
.text(function(d) { return d + ": " + percent(data[d]); });
});
function monthPath(t0) {
var t1 = new Date(t0.getFullYear(), t0.getMonth() + 1, 0),
d0 = t0.getDay(), w0 = d3.time.weekOfYear(t0),
d1 = t1.getDay(), w1 = d3.time.weekOfYear(t1);
return "M" + (w0 + 1) * cellSize + "," + d0 * cellSize
+ "H" + w0 * cellSize + "V" + 7 * cellSize
+ "H" + w1 * cellSize + "V" + (d1 + 1) * cellSize
+ "H" + (w1 + 1) * cellSize + "V" + 0
+ "H" + (w0 + 1) * cellSize + "Z";
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment