|
|
Linia 1: |
Linia 1: |
− | <graph mode=interactive title="Zoomable Graph"> | + | <!--{{GraphChart|width=400|height=100|type=line|x=1,2,3,4,5,6,7,8|y=10, 12, 6, 14, 2, 10, 7, 9}}--> |
− | {
| |
− | "version": 2,
| |
− | "width": 600,
| |
− | "height": 400,
| |
| | | |
− | "signals": [
| + | {{Graph:Chart|width=400|height=100|showValues=1|fontsize=12|fontcolor=red|xAxisTitle=X|yAxisTitle=Cazuri |
− | {
| + | |type=rect|x=1,2,3,4,5,6,7,8,9|y=10,12,6,14,2,10,7,9,3}} |
− | "name": "brush_start",
| |
− | "streams": [{
| |
− | "type": "@overview:mousedown",
| |
− | "expr": "eventX()",
| |
− | "scale": {"name": "xOverview", "invert": true}
| |
− | }]
| |
− | },
| |
− | {
| |
− | "name": "brush_end",
| |
− | "init": {"expr": "datetime('Jan 1 2000')"},
| |
− | "streams": [{
| |
− | "type": "@overview:mousedown, [@overview:mousedown, window:mouseup] > window:mousemove",
| |
− | "expr": "clamp(eventX(), 0, 720)",
| |
− | "scale": {"name": "xOverview", "invert": true}
| |
− | }]
| |
− | },
| |
− | {
| |
− | "name": "min_date",
| |
− | "init": {"expr": "datetime('Jan 1 2000')"},
| |
− | "expr": "time(brush_start) === time(brush_end) ? datetime('Jan 1 2000') : min(brush_start, brush_end)"
| |
− | },
| |
− | {
| |
− | "name": "max_date",
| |
− | "init": {"expr": "datetime('Mar 1 2010')"},
| |
− | "expr": "time(brush_start) === time(brush_end) ? datetime('Mar 1 2010') : max(brush_start, brush_end)"
| |
− | }
| |
− | ],
| |
− | | |
− | "data": [
| |
− | {
| |
− | "name": "sp500",
| |
− | "url": "wikiraw:///Extension:Graph/data/sp500-csv",
| |
− | "format": {"type": "csv", "parse": {"price": "number", "date": "date"}}
| |
− | }
| |
− | ],
| |
− | | |
− | "scales": [
| |
− | {
| |
− | "name": "xOverview",
| |
− | "type": "time",
| |
− | "range": [0, 720],
| |
− | "domain": {"data": "sp500", "field": "date"}
| |
− | },
| |
− | {
| |
− | "name": "yOverview",
| |
− | "type": "linear",
| |
− | "range": [70, 0],
| |
− | "nice": true,
| |
− | "domain": {"data": "sp500", "field": "price"}
| |
− | },
| |
− | {
| |
− | "name": "xDetail",
| |
− | "type": "time",
| |
− | "range": [0, 720],
| |
− | "domainMin": {"signal": "min_date"},
| |
− | "domainMax": {"signal": "max_date"}
| |
− | },
| |
− | {
| |
− | "name": "yDetail",
| |
− | "type": "linear",
| |
− | "range": [390, 0],
| |
− | "nice": true,
| |
− | "domain": {"data": "sp500", "field": "price"}
| |
− | }
| |
− | ],
| |
− | | |
− | "marks": [
| |
− | {
| |
− | "type": "group",
| |
− | "name": "detail",
| |
− | "properties": {
| |
− | "enter": {
| |
− | "height": {"value": 390},
| |
− | "width": {"value": 720}
| |
− | }
| |
− | },
| |
− | "axes": [
| |
− | {"type": "x", "scale": "xDetail"},
| |
− | {"type": "y", "scale": "yDetail"}
| |
− | ],
| |
− | "marks": [
| |
− | {
| |
− | "type": "group",
| |
− | "properties": {
| |
− | "enter": {
| |
− | "height": {"field": {"group": "height"}},
| |
− | "width": {"field": {"group": "width"}},
| |
− | "clip": {"value": true}
| |
− | }
| |
− | },
| |
− | "marks": [
| |
− | {
| |
− | "type": "area",
| |
− | "from": {"data": "sp500"},
| |
− | "properties": {
| |
− | "update": {
| |
− | "x": {"scale": "xDetail", "field": "date"},
| |
− | "y": {"scale": "yDetail", "field": "price"},
| |
− | "y2": {"scale": "yDetail", "value": 0},
| |
− | "fill": {"value": "steelblue"}
| |
− | }
| |
− | }
| |
− | }
| |
− | ]
| |
− | }
| |
− | ]
| |
− | },
| |
− | | |
− | {
| |
− | "type": "group",
| |
− | "name": "overview",
| |
− | "properties": {
| |
− | "enter": {
| |
− | "x": {"value": 0},
| |
− | "y": {"value": 430},
| |
− | "height": {"value": 70},
| |
− | "width": {"value": 720}
| |
− | }
| |
− | },
| |
− | "axes": [
| |
− | {"type": "x", "scale": "xOverview"}
| |
− | ],
| |
− | "marks": [
| |
− | {
| |
− | "type": "area",
| |
− | "from": {"data": "sp500"},
| |
− | "properties": {
| |
− | "update": {
| |
− | "x": {"scale": "xOverview", "field": "date"},
| |
− | "y": {"scale": "yOverview", "field": "price"},
| |
− | "y2": {"scale": "yOverview", "value": 0},
| |
− | "fill": {"value": "steelblue"}
| |
− | }
| |
− | }
| |
− | },
| |
− | {
| |
− | "type": "rect",
| |
− | "properties":{
| |
− | "enter":{
| |
− | "y": {"value": 0},
| |
− | "height": {"value":70},
| |
− | "fill": {"value": "#333"},
| |
− | "fillOpacity": {"value":0.2}
| |
− | },
| |
− | "update":{
| |
− | "x": {"scale": "xOverview", "signal": "brush_start"},
| |
− | "x2": {"scale": "xOverview", "signal": "brush_end"}
| |
− | }
| |
− | }
| |
− | }
| |
− | ]
| |
− | }
| |
| | | |
− | ]
| |
− | }
| |
− | </graph>
| |
| | | |
| + | {{Graph:Chart |
| + | | width=400 |
| + | | height=100 |
| + | | type=area |
| + | | x=1,2,3,4,5,6,7,8 |
| + | | y=10,12,6,14,2,10,7,9 |
| + | }} |
| | | |
− | <!--{{GraphChart|width=400|height=100|type=line|x=1,2,3,4,5,6,7,8|y=10, 12, 6, 14, 2, 10, 7, 9}}-->
| |
| | | |
− | {{Graph:Chart|width=400|height=100|xAxisTitle=X|yAxisTitle=Cazuri | + | {{Graph:Chart |
− | |type=rect|x=1,2,3,4,5,6,7,8,9|y=10,12,6,14,2,10,7,9,3}} | + | | width=100 |
| + | | height=100 |
| + | | type=pie |
| + | | innerRadius=40 |
| + | | x=A,B,C,D,E,F,G,H,I |
| + | | y1=100,200,150,300,100,100,150,50,200 |
| + | }} |
| | | |
| | | |
| + | {{Graph:Chart |
| + | | width=auto |
| + | | height=150 |
| + | | xAxisTitle= |
| + | | yAxisTitle= |
| + | | legend= |
| + | | type=line |
| + | | x=1,2,3,4,5,6,7,8 |
| + | | y1=10,12,6,14,2,10,7,9 |
| + | | y2=2,4,6,8,13,11,9,2 |
| + | | colors=#c00,#080 |
| + | | interpolate=monotone |
| + | }} |
| | | |
| {{Graph:Chart|width=100|height=100|type=pie|legend=<translate><!--T:75--> Legend</translate> | | {{Graph:Chart|width=100|height=100|type=pie|legend=<translate><!--T:75--> Legend</translate> |