(일단 데이터 가져온 것으로 확인) |
(→다른 그래프: Vega 2) |
||
153번째 줄: | 153번째 줄: | ||
"width": 400, | "width": 400, | ||
"height": 200, | "height": 200, | ||
"padding": | "padding": {"top": 10, "left": 30, "bottom": 30, "right": 10}, | ||
"data": [ | "data": [ | ||
{ | { | ||
"name": "table", | "name": "table", | ||
"values": [ | "values": [ | ||
{" | {"x": 1, "y": 28}, {"x": 2, "y": 55}, | ||
{" | {"x": 3, "y": 43}, {"x": 4, "y": 91}, | ||
{" | {"x": 5, "y": 81}, {"x": 6, "y": 53}, | ||
{" | {"x": 7, "y": 19}, {"x": 8, "y": 87}, | ||
{" | {"x": 9, "y": 52}, {"x": 10, "y": 48}, | ||
{" | {"x": 11, "y": 24}, {"x": 12, "y": 49}, | ||
{" | {"x": 13, "y": 87}, {"x": 14, "y": 66}, | ||
{" | {"x": 15, "y": 17}, {"x": 16, "y": 27}, | ||
{"x": 17, "y": 68}, {"x": 18, "y": 16}, | |||
{"x": 19, "y": 49}, {"x": 20, "y": 15} | |||
] | ] | ||
} | } | ||
], | ], | ||
"scales": [ | "scales": [ | ||
{ | { | ||
"name": " | "name": "x", | ||
"type": " | "type": "ordinal", | ||
"range": "width", | "range": "width", | ||
" | "domain": {"data": "table", "field": "x"} | ||
}, | }, | ||
{ | { | ||
"name": " | "name": "y", | ||
"domain": {"data": "table", "field": " | "type": "linear", | ||
"nice": true | "range": "height", | ||
"domain": {"data": "table", "field": "y"}, | |||
"nice": true | |||
} | } | ||
], | ], | ||
"axes": [ | "axes": [ | ||
{ " | {"type": "x", "scale": "x"}, | ||
{ " | {"type": "y", "scale": "y"} | ||
], | ], | ||
"marks": [ | "marks": [ | ||
{ | { | ||
"type": "rect", | "type": "rect", | ||
"from": {"data":"table"}, | "from": {"data": "table"}, | ||
" | "properties": { | ||
"enter": { | "enter": { | ||
"x": {"scale": " | "x": {"scale": "x", "field": "x"}, | ||
"width": {"scale": " | "width": {"scale": "x", "band": true, "offset": -1}, | ||
"y": {"scale": " | "y": {"scale": "y", "field": "y"}, | ||
"y2": {"scale": " | "y2": {"scale": "y", "value": 0} | ||
}, | }, | ||
"update": { | "update": { | ||
220번째 줄: | 206번째 줄: | ||
"hover": { | "hover": { | ||
"fill": {"value": "red"} | "fill": {"value": "red"} | ||
} | } | ||
} | } | ||
244번째 줄: | 211번째 줄: | ||
] | ] | ||
} | } | ||
</graph> | </graph> |