Skip to content

Instantly share code, notes, and snippets.

@djouallah
Created April 22, 2019 23:34
Show Gist options
  • Save djouallah/a0bc3b62105f5d2a0223cbb98f10047f to your computer and use it in GitHub Desktop.
Save djouallah/a0bc3b62105f5d2a0223cbb98f10047f to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<style>
.vega-actions a {
margin-right: 12px;
color: #757575;
font-weight: normal;
font-size: 13px;
}
.error {
color: red;
}
</style>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm//vega@4"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm//[email protected]"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm//vega-embed@3"></script>
</head>
<body>
<div id="vis"></div>
<script>
var spec = {"config": {"view": {"width": 400, "height": 300}}, "vconcat": [{"hconcat": [{"data": {"name": "data-f44e96ffcc4f402603b3b66ca029da7f"}, "mark": "bar", "encoding": {"color": {"condition": {"value": "steelblue", "selection": "selector006"}, "value": "grey"}, "tooltip": [{"type": "quantitative", "field": "progresstodate", "format": ",.2%"}, {"type": "nominal", "field": "category2"}], "x": {"type": "quantitative", "axis": {"format": "%"}, "field": "progresstodate"}, "y": {"type": "nominal", "field": "category2", "sort": {"op": "max", "field": "progresstodate", "order": "descending"}, "title": "Area"}}, "height": 400, "selection": {"selector006": {"type": "multi", "encodings": ["y"]}}, "transform": [{"aggregate": [{"op": "sum", "field": "last_budget", "as": "max_budget"}, {"op": "sum", "field": "earned", "as": "sum_Installed_qty"}], "groupby": ["category2"]}, {"calculate": "datum.sum_Installed_qty/ datum.max_budget", "as": "progresstodate"}], "width": 550}, {"data": {"name": "data-f44e96ffcc4f402603b3b66ca029da7f"}, "mark": "bar", "encoding": {"color": {"condition": {"value": "steelblue", "selection": "selector005"}, "value": "grey"}, "tooltip": [{"type": "quantitative", "field": "progresstodate", "format": ",.2%"}, {"type": "nominal", "field": "category"}], "x": {"type": "quantitative", "axis": {"format": "%"}, "field": "progresstodate"}, "y": {"type": "nominal", "axis": {"orient": "right"}, "field": "category", "sort": {"op": "max", "field": "progresstodate", "order": "descending"}, "title": "Subcontractors"}}, "height": 400, "selection": {"selector005": {"type": "multi", "encodings": ["y"]}}, "transform": [{"filter": {"selection": "selector006"}}, {"aggregate": [{"op": "sum", "field": "last_budget", "as": "max_budget"}, {"op": "sum", "field": "earned", "as": "sum_Installed_qty"}], "groupby": ["category"]}, {"calculate": "datum.sum_Installed_qty/ datum.max_budget", "as": "progresstodate"}], "width": 550}]}, {"layer": [{"layer": [{"data": {"name": "data-f44e96ffcc4f402603b3b66ca029da7f"}, "mark": {"type": "bar", "color": "black"}, "encoding": {"tooltip": [{"type": "quantitative", "field": "earned_cumulative", "format": ",.2%"}, {"type": "quantitative", "field": "planned_cumulative", "format": ",.2%"}], "x": {"type": "ordinal", "axis": {"format": "%d %b %y"}, "field": "date", "timeUnit": "yearmonthdate", "title": "date"}, "y": {"type": "quantitative", "field": "period"}}, "transform": [{"filter": {"selection": "selector006"}}, {"filter": {"selection": "selector005"}}, {"aggregate": [{"op": "sum", "field": "earned_cumulative", "as": "sum_installed_cumulative"}, {"op": "sum", "field": "planned_cumulative", "as": "sum_planned_cumulative"}, {"op": "sum", "field": "budget", "as": "sum_budget"}, {"op": "sum", "field": "baseline_budget", "as": "sum_baseline_budget"}, {"op": "sum", "field": "earned", "as": "sum_Installed_qty"}, {"op": "sum", "field": "type", "as": "sum_type"}], "groupby": ["date"]}, {"calculate": "if (datum.sum_type>0,datum.sum_installed_cumulative / datum.sum_budget,null)", "as": "earned_cumulative"}, {"calculate": "if(datum.sum_baseline_budget > 0 ,datum.sum_planned_cumulative / datum.sum_baseline_budget,null)", "as": "planned_cumulative"}, {"calculate": "if(datum.sum_Installed_qty >0,datum.sum_Installed_qty/ datum.sum_budget,null)", "as": "period"}]}, {"data": {"name": "data-f44e96ffcc4f402603b3b66ca029da7f"}, "mark": {"type": "text", "align": "center", "baseline": "bottom", "dx": 7}, "encoding": {"text": {"type": "quantitative", "field": "period", "format": ",.2%"}, "tooltip": [{"type": "quantitative", "field": "earned_cumulative", "format": ",.2%"}, {"type": "quantitative", "field": "planned_cumulative", "format": ",.2%"}], "x": {"type": "ordinal", "axis": {"format": "%d %b %y"}, "field": "date", "timeUnit": "yearmonthdate", "title": "date"}, "y": {"type": "quantitative", "field": "period"}}, "transform": [{"filter": {"selection": "selector006"}}, {"filter": {"selection": "selector005"}}, {"aggregate": [{"op": "sum", "field": "earned_cumulative", "as": "sum_installed_cumulative"}, {"op": "sum", "field": "planned_cumulative", "as": "sum_planned_cumulative"}, {"op": "sum", "field": "budget", "as": "sum_budget"}, {"op": "sum", "field": "baseline_budget", "as": "sum_baseline_budget"}, {"op": "sum", "field": "earned", "as": "sum_Installed_qty"}, {"op": "sum", "field": "type", "as": "sum_type"}], "groupby": ["date"]}, {"calculate": "if (datum.sum_type>0,datum.sum_installed_cumulative / datum.sum_budget,null)", "as": "earned_cumulative"}, {"calculate": "if(datum.sum_baseline_budget > 0 ,datum.sum_planned_cumulative / datum.sum_baseline_budget,null)", "as": "planned_cumulative"}, {"calculate": "if(datum.sum_Installed_qty >0,datum.sum_Installed_qty/ datum.sum_budget,null)", "as": "period"}]}]}, {"layer": [{"data": {"name": "data-f44e96ffcc4f402603b3b66ca029da7f"}, "mark": {"type": "line", "color": "red"}, "encoding": {"tooltip": [{"type": "quantitative", "field": "earned_cumulative", "format": ",.2%"}, {"type": "quantitative", "field": "planned_cumulative", "format": ",.2%"}], "x": {"type": "ordinal", "axis": {"format": "%d %b %y"}, "field": "date", "timeUnit": "yearmonthdate", "title": "date"}, "y": {"type": "quantitative", "field": "earned_cumulative"}}, "transform": [{"filter": {"selection": "selector006"}}, {"filter": {"selection": "selector005"}}, {"aggregate": [{"op": "sum", "field": "earned_cumulative", "as": "sum_installed_cumulative"}, {"op": "sum", "field": "planned_cumulative", "as": "sum_planned_cumulative"}, {"op": "sum", "field": "budget", "as": "sum_budget"}, {"op": "sum", "field": "baseline_budget", "as": "sum_baseline_budget"}, {"op": "sum", "field": "earned", "as": "sum_Installed_qty"}, {"op": "sum", "field": "type", "as": "sum_type"}], "groupby": ["date"]}, {"calculate": "if (datum.sum_type>0,datum.sum_installed_cumulative / datum.sum_budget,null)", "as": "earned_cumulative"}, {"calculate": "if(datum.sum_baseline_budget > 0 ,datum.sum_planned_cumulative / datum.sum_baseline_budget,null)", "as": "planned_cumulative"}, {"calculate": "if(datum.sum_Installed_qty >0,datum.sum_Installed_qty/ datum.sum_budget,null)", "as": "period"}]}, {"data": {"name": "data-f44e96ffcc4f402603b3b66ca029da7f"}, "mark": {"type": "line", "color": "green"}, "encoding": {"tooltip": [{"type": "quantitative", "field": "earned_cumulative", "format": ",.2%"}, {"type": "quantitative", "field": "planned_cumulative", "format": ",.2%"}], "x": {"type": "ordinal", "axis": {"format": "%d %b %y"}, "field": "date", "timeUnit": "yearmonthdate", "title": "date"}, "y": {"type": "quantitative", "field": "planned_cumulative"}}, "transform": [{"filter": {"selection": "selector006"}}, {"filter": {"selection": "selector005"}}, {"aggregate": [{"op": "sum", "field": "earned_cumulative", "as": "sum_installed_cumulative"}, {"op": "sum", "field": "planned_cumulative", "as": "sum_planned_cumulative"}, {"op": "sum", "field": "budget", "as": "sum_budget"}, {"op": "sum", "field": "baseline_budget", "as": "sum_baseline_budget"}, {"op": "sum", "field": "earned", "as": "sum_Installed_qty"}, {"op": "sum", "field": "type", "as": "sum_type"}], "groupby": ["date"]}, {"calculate": "if (datum.sum_type>0,datum.sum_installed_cumulative / datum.sum_budget,null)", "as": "earned_cumulative"}, {"calculate": "if(datum.sum_baseline_budget > 0 ,datum.sum_planned_cumulative / datum.sum_baseline_budget,null)", "as": "planned_cumulative"}, {"calculate": "if(datum.sum_Installed_qty >0,datum.sum_Installed_qty/ datum.sum_budget,null)", "as": "period"}]}]}], "height": 300, "resolve": {"scale": {"y": "independent"}}, "width": 1150}], "resolve": {"legend": {"color": "independent", "size": "independent"}}, "$schema": "https://vega.github.io/schema/vega-lite/v2.6.0.json", "datasets": {"data-f44e96ffcc4f402603b3b66ca029da7f": [{"date": "2010-01-01T00:00:00", "category": "piling Contractor", "category2": "a", "earned": 9.0, "earned_cumulative": 9.0, "budget": 2000, "planned_cumulative": 153.84615380000002, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-01T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": 48.0, "earned_cumulative": 48.0, "budget": 3000, "planned_cumulative": 230.76923080000003, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-01T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": 79.0, "earned_cumulative": 79.0, "budget": 2000, "planned_cumulative": 153.84615380000002, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-01T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": 79.0, "earned_cumulative": 79.0, "budget": 2000, "planned_cumulative": 153.84615380000002, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-02T00:00:00", "category": "piling Contractor", "category2": "a", "earned": 11.0, "earned_cumulative": 20.0, "budget": 2000, "planned_cumulative": 307.69230760000005, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-02T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": 45.0, "earned_cumulative": 93.0, "budget": 3000, "planned_cumulative": 461.53846160000006, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-02T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": 17.0, "earned_cumulative": 96.0, "budget": 2000, "planned_cumulative": 307.69230760000005, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-02T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": 17.0, "earned_cumulative": 96.0, "budget": 2000, "planned_cumulative": 307.69230760000005, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-03T00:00:00", "category": "piling Contractor", "category2": "a", "earned": 94.0, "earned_cumulative": 114.0, "budget": 2000, "planned_cumulative": 461.5384614, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-03T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": 3.0, "earned_cumulative": 96.0, "budget": 3000, "planned_cumulative": 692.3076924, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-03T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": 88.0, "earned_cumulative": 184.0, "budget": 2000, "planned_cumulative": 461.5384614, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-03T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": 88.0, "earned_cumulative": 184.0, "budget": 2000, "planned_cumulative": 461.5384614, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-04T00:00:00", "category": "piling Contractor", "category2": "a", "earned": 81.0, "earned_cumulative": 195.0, "budget": 2000, "planned_cumulative": 615.3846152000001, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-04T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": 77.0, "earned_cumulative": 173.0, "budget": 3000, "planned_cumulative": 923.0769232000001, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-04T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": 8.0, "earned_cumulative": 192.0, "budget": 2000, "planned_cumulative": 615.3846152000001, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-04T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": 8.0, "earned_cumulative": 192.0, "budget": 2000, "planned_cumulative": 615.3846152000001, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-05T00:00:00", "category": "piling Contractor", "category2": "a", "earned": 99.0, "earned_cumulative": 294.0, "budget": 2000, "planned_cumulative": 769.230769, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-05T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": 11.0, "earned_cumulative": 184.0, "budget": 3000, "planned_cumulative": 1153.8461539999998, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-05T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": 26.0, "earned_cumulative": 218.0, "budget": 2000, "planned_cumulative": 769.230769, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-05T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": 26.0, "earned_cumulative": 218.0, "budget": 2000, "planned_cumulative": 769.230769, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-06T00:00:00", "category": "piling Contractor", "category2": "a", "earned": 85.0, "earned_cumulative": 379.0, "budget": 2000, "planned_cumulative": 923.0769228, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-06T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": 66.0, "earned_cumulative": 250.0, "budget": 3000, "planned_cumulative": 1384.615385, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-06T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": 61.0, "earned_cumulative": 279.0, "budget": 2000, "planned_cumulative": 923.0769228, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-06T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": 61.0, "earned_cumulative": 279.0, "budget": 2000, "planned_cumulative": 923.0769228, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-07T00:00:00", "category": "piling Contractor", "category2": "a", "earned": 92.0, "earned_cumulative": 471.0, "budget": 2000, "planned_cumulative": 1076.923077, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-07T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": 56.0, "earned_cumulative": 306.0, "budget": 3000, "planned_cumulative": 1615.384616, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-07T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": 29.0, "earned_cumulative": 308.0, "budget": 2000, "planned_cumulative": 1076.923077, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-07T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": 29.0, "earned_cumulative": 308.0, "budget": 2000, "planned_cumulative": 1076.923077, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-08T00:00:00", "category": "piling Contractor", "category2": "a", "earned": 66.0, "earned_cumulative": 537.0, "budget": 2000, "planned_cumulative": 1230.76923, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-08T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": 90.0, "earned_cumulative": 396.0, "budget": 3000, "planned_cumulative": 1846.1538460000002, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-08T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": 27.0, "earned_cumulative": 335.0, "budget": 2000, "planned_cumulative": 1230.76923, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-08T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": 27.0, "earned_cumulative": 335.0, "budget": 2000, "planned_cumulative": 1230.76923, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-09T00:00:00", "category": "piling Contractor", "category2": "a", "earned": 32.0, "earned_cumulative": 569.0, "budget": 2000, "planned_cumulative": 1384.615384, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-09T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": 70.0, "earned_cumulative": 466.0, "budget": 3000, "planned_cumulative": 2076.923077, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-09T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": 53.0, "earned_cumulative": 388.0, "budget": 2000, "planned_cumulative": 1384.615384, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-09T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": 53.0, "earned_cumulative": 388.0, "budget": 2000, "planned_cumulative": 1384.615384, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-10T00:00:00", "category": "piling Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1538.461538, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-10T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 3000, "planned_cumulative": 2307.6923079999997, "type": 0, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-10T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1538.461538, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-10T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1538.461538, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-11T00:00:00", "category": "piling Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1692.307692, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-11T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 3000, "planned_cumulative": 2538.461539, "type": 0, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-11T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1692.307692, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-11T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1692.307692, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-12T00:00:00", "category": "piling Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1846.1538460000002, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-12T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 3000, "planned_cumulative": 2769.23077, "type": 0, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-12T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1846.1538460000002, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-12T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1846.1538460000002, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-13T00:00:00", "category": "piling Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1999.999999, "type": 0, "last_budget": 2000.0, "baseline_budget": 2000}, {"date": "2010-01-13T00:00:00", "category": "Earthworks Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 3000, "planned_cumulative": 3000.0, "type": 0, "last_budget": 3000.0, "baseline_budget": 3000}, {"date": "2010-01-13T00:00:00", "category": "Civil Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1999.999999, "type": 0, "last_budget": 2000.0, "baseline_budget": 2000}, {"date": "2010-01-13T00:00:00", "category": "Mec Contractor", "category2": "a", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1999.999999, "type": 0, "last_budget": 2000.0, "baseline_budget": 2000}, {"date": "2010-01-01T00:00:00", "category": "piling Contractor", "category2": "b", "earned": 9.0, "earned_cumulative": 9.0, "budget": 2000, "planned_cumulative": 153.84615380000002, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-01T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": 48.0, "earned_cumulative": 48.0, "budget": 3000, "planned_cumulative": 230.76923080000003, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-01T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": 79.0, "earned_cumulative": 79.0, "budget": 2000, "planned_cumulative": 153.84615380000002, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-01T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": 79.0, "earned_cumulative": 79.0, "budget": 2000, "planned_cumulative": 153.84615380000002, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-02T00:00:00", "category": "piling Contractor", "category2": "b", "earned": 11.0, "earned_cumulative": 20.0, "budget": 2000, "planned_cumulative": 307.69230760000005, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-02T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": 45.0, "earned_cumulative": 93.0, "budget": 3000, "planned_cumulative": 461.53846160000006, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-02T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": 17.0, "earned_cumulative": 96.0, "budget": 2000, "planned_cumulative": 307.69230760000005, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-02T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": 17.0, "earned_cumulative": 96.0, "budget": 2000, "planned_cumulative": 307.69230760000005, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-03T00:00:00", "category": "piling Contractor", "category2": "b", "earned": 94.0, "earned_cumulative": 114.0, "budget": 2000, "planned_cumulative": 461.5384614, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-03T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": 3.0, "earned_cumulative": 96.0, "budget": 3000, "planned_cumulative": 692.3076924, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-03T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": 88.0, "earned_cumulative": 184.0, "budget": 2000, "planned_cumulative": 461.5384614, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-03T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": 88.0, "earned_cumulative": 184.0, "budget": 2000, "planned_cumulative": 461.5384614, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-04T00:00:00", "category": "piling Contractor", "category2": "b", "earned": 81.0, "earned_cumulative": 195.0, "budget": 2000, "planned_cumulative": 615.3846152000001, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-04T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": 77.0, "earned_cumulative": 173.0, "budget": 3000, "planned_cumulative": 923.0769232000001, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-04T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": 8.0, "earned_cumulative": 192.0, "budget": 2000, "planned_cumulative": 615.3846152000001, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-04T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": 8.0, "earned_cumulative": 192.0, "budget": 2000, "planned_cumulative": 615.3846152000001, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-05T00:00:00", "category": "piling Contractor", "category2": "b", "earned": 99.0, "earned_cumulative": 294.0, "budget": 2000, "planned_cumulative": 769.230769, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-05T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": 11.0, "earned_cumulative": 184.0, "budget": 3000, "planned_cumulative": 1153.8461539999998, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-05T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": 26.0, "earned_cumulative": 218.0, "budget": 2000, "planned_cumulative": 769.230769, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-05T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": 26.0, "earned_cumulative": 218.0, "budget": 2000, "planned_cumulative": 769.230769, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-06T00:00:00", "category": "piling Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 923.0769228, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-06T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": 66.0, "earned_cumulative": 250.0, "budget": 3000, "planned_cumulative": 1384.615385, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-06T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": 61.0, "earned_cumulative": 279.0, "budget": 2000, "planned_cumulative": 923.0769228, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-06T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": 61.0, "earned_cumulative": 279.0, "budget": 2000, "planned_cumulative": 923.0769228, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-07T00:00:00", "category": "piling Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1076.923077, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-07T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": 56.0, "earned_cumulative": 306.0, "budget": 3000, "planned_cumulative": 1615.384616, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-07T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": 29.0, "earned_cumulative": 308.0, "budget": 2000, "planned_cumulative": 1076.923077, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-07T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": 29.0, "earned_cumulative": 308.0, "budget": 2000, "planned_cumulative": 1076.923077, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-08T00:00:00", "category": "piling Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1230.76923, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-08T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": 90.0, "earned_cumulative": 396.0, "budget": 3000, "planned_cumulative": 1846.1538460000002, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-08T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": 27.0, "earned_cumulative": 335.0, "budget": 2000, "planned_cumulative": 1230.76923, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-08T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": 27.0, "earned_cumulative": 335.0, "budget": 2000, "planned_cumulative": 1230.76923, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-09T00:00:00", "category": "piling Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1384.615384, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-09T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": 70.0, "earned_cumulative": 466.0, "budget": 3000, "planned_cumulative": 2076.923077, "type": 1, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-09T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": 53.0, "earned_cumulative": 388.0, "budget": 2000, "planned_cumulative": 1384.615384, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-09T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": 53.0, "earned_cumulative": 388.0, "budget": 2000, "planned_cumulative": 1384.615384, "type": 1, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-10T00:00:00", "category": "piling Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1538.461538, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-10T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 3000, "planned_cumulative": 2307.6923079999997, "type": 0, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-10T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1538.461538, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-10T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1538.461538, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-11T00:00:00", "category": "piling Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1692.307692, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-11T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 3000, "planned_cumulative": 2538.461539, "type": 0, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-11T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1692.307692, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-11T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1692.307692, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-12T00:00:00", "category": "piling Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1846.1538460000002, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-12T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 3000, "planned_cumulative": 2769.23077, "type": 0, "last_budget": null, "baseline_budget": 3000}, {"date": "2010-01-12T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1846.1538460000002, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-12T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1846.1538460000002, "type": 0, "last_budget": null, "baseline_budget": 2000}, {"date": "2010-01-13T00:00:00", "category": "piling Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1999.999999, "type": 0, "last_budget": 2000.0, "baseline_budget": 2000}, {"date": "2010-01-13T00:00:00", "category": "Earthworks Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 3000, "planned_cumulative": 3000.0, "type": 0, "last_budget": 3000.0, "baseline_budget": 3000}, {"date": "2010-01-13T00:00:00", "category": "Civil Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1999.999999, "type": 0, "last_budget": 2000.0, "baseline_budget": 2000}, {"date": "2010-01-13T00:00:00", "category": "Mec Contractor", "category2": "b", "earned": null, "earned_cumulative": null, "budget": 2000, "planned_cumulative": 1999.999999, "type": 0, "last_budget": 2000.0, "baseline_budget": 2000}]}};
var embedOpt = {"mode": "vega-lite"};
function showError(el, error){
el.innerHTML = ('<div class="error" style="color:red;">'
+ '<p>JavaScript Error: ' + error.message + '</p>'
+ "<p>This usually means there's a typo in your chart specification. "
+ "See the javascript console for the full traceback.</p>"
+ '</div>');
throw error;
}
const el = document.getElementById('vis');
vegaEmbed("#vis", spec, embedOpt)
.catch(error => showError(el, error));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment