Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.72 KB | None | 0 0
  1. {
  2. "width": 550,
  3. "height": 480,
  4. "padding": {"top": 0, "right": 40},
  5. "autosize": "none",
  6. "data": [
  7. {
  8. "name": "table",
  9. "values": [
  10. {
  11. "position": 1,
  12. "value": 70000,
  13. "header": "Desired Income",
  14. "desc": "How much you told us you want to spend in retirement."
  15. },
  16. {
  17. "position": 2,
  18. "value": 25000,
  19. "header": "Safe Income",
  20. "desc": "How much you can currently expect in retirement. <a href=#>Learn More</a>"
  21. },
  22. {
  23. "position": 3,
  24. "value": 72000,
  25. "header": "Our Income",
  26. "desc": "How much Edelman Financial Engines can get you."
  27. }
  28. ],
  29. "transform": [
  30. {
  31. "type": "formula",
  32. "expr": "format(datum.value,'$,') + '/yr'",
  33. "as": "incomevalue"
  34. }
  35. ]
  36. }
  37. ],
  38. "scales": [
  39. {
  40. "name": "xscale",
  41. "type": "linear",
  42. "domain": [0, 72000],
  43. "range": "width",
  44. "round": true,
  45. "zero": true,
  46. "nice": true
  47. },
  48. {
  49. "name": "color",
  50. "type": "ordinal",
  51. "range": [ "#e3e8e9", "#e3e8e9", "#0075d6" ]
  52. },
  53. {
  54. "name": "fontcolor",
  55. "type": "ordinal",
  56. "range": [ "#1b242d", "#1b242d", "#ffffff" ]
  57. },
  58. {
  59. "name": "fontsize",
  60. "type": "ordinal",
  61. "range": [24]
  62. },
  63. {
  64. "name": "textsize",
  65. "type": "ordinal",
  66. "range": [16]
  67. }
  68. ],
  69. "marks": [
  70. {
  71. "name": "group-mark-bars",
  72. "type": "group",
  73. "from": {
  74. "facet": {
  75. "data": "table",
  76. "name": "facet",
  77. "groupby": "field"
  78. }
  79. },
  80. "scales": [
  81. {
  82. "name": "pos",
  83. "type": "band",
  84. "range": "height",
  85. "padding": 0.5,
  86. "paddingInner": 0.62,
  87. "domain": {
  88. "data": "facet",
  89. "field": "position"
  90. }
  91. }
  92. ],
  93. "marks": [
  94. {
  95. "name": "bars",
  96. "from": {
  97. "data": "facet"
  98. },
  99. "type": "rect",
  100. "encode": {
  101. "enter": {
  102. "y": {
  103. "scale": "pos",
  104. "field": "position",
  105. "offset": 30
  106. },
  107. "height": {
  108. "scale": "pos",
  109. "band": 1
  110. },
  111. "x": {
  112. "scale": "xscale",
  113. "field": "value"
  114. },
  115. "x2": {
  116. "scale": "xscale",
  117. "value": 0
  118. },
  119. "fill": {
  120. "scale": "color",
  121. "field": "position"
  122. },
  123. "cornerRadius": {"value": 0}
  124. }
  125. }
  126. },
  127. {
  128. "type": "text",
  129. "from": {
  130. "data": "bars"
  131. },
  132. "encode": {
  133. "enter": {
  134. "x": {
  135. "field": "x",
  136. "offset": 15
  137. },
  138. "y": {
  139. "field": "y",
  140. "offset": {
  141. "field": "height",
  142. "mult": 0.5
  143. }
  144. },
  145. "fill": {
  146. "scale": "fontcolor",
  147. "field": "y"
  148. },
  149. "align": { "value": "left" },
  150. "baseline": { "value": "middle" },
  151. "text": { "field": "datum.incomevalue" },
  152. "font": { "value": "Roboto" },
  153. "fontSize": {
  154. "scale": "fontsize",
  155. "field": "y"
  156. }
  157. }
  158. }
  159. },
  160. {
  161. "type": "text",
  162. "from": {"data": "bars"},
  163. "encode": {
  164. "enter": {
  165. "x": {"field": "x", "offset": 0},
  166. "y": {"field": "y", "offset": -25},
  167. "align": {"value": "left"},
  168. "baseline": {"value": "top"},
  169. "text": {"field": "datum.header"},
  170. "font": {"value": "Roboto"},
  171. "fontSize": {
  172. "scale": "textsize",
  173. "field": "y"
  174. },
  175. "fontWeight": {"value": "bold"}
  176. }
  177. }
  178. },
  179. {
  180. "type": "text",
  181. "from": {"data": "bars"},
  182. "encode": {
  183. "enter": {
  184. "y": {"field": "y", "offset": {"field": "height", "mult":1.6}},
  185. "align": {"value": "left"},
  186. "baseline": {"value": "bottom"},
  187. "text": {"field": "datum.desc"},
  188. "href": "#",
  189. "font": { "value": "Roboto" },
  190. "fontSize": {
  191. "scale": "textsize",
  192. "field": "y"
  193. }
  194. }
  195. }
  196. }
  197. ]
  198. }
  199. ]
  200. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement