{
  "version": "xarts.metric-panels/1",
  "family": "metric-panels",
  "provenance": {
    "legacyId": "varianceanalysis"
  },
  "data": {
    "rows": [
      {
        "Category": "Revenue",
        "Budget ($K)": 4200,
        "Actual ($K)": 4550
      },
      {
        "Category": "COGS",
        "Budget ($K)": 1680,
        "Actual ($K)": 1590
      },
      {
        "Category": "Gross Profit",
        "Budget ($K)": 2520,
        "Actual ($K)": 2960
      },
      {
        "Category": "OpEx",
        "Budget ($K)": 1200,
        "Actual ($K)": 1350
      },
      {
        "Category": "EBITDA",
        "Budget ($K)": 1320,
        "Actual ($K)": 1610
      },
      {
        "Category": "Net Income",
        "Budget ($K)": 920,
        "Actual ($K)": 1050
      }
    ]
  },
  "encoding": {
    "metric": "Category",
    "unit": {
      "source": "lookup",
      "values": {
        "Revenue": "$K",
        "COGS": "$K",
        "Gross Profit": "$K",
        "OpEx": "$K",
        "EBITDA": "$K",
        "Net Income": "$K"
      }
    },
    "series": [
      {
        "id": "budget",
        "field": "Budget ($K)",
        "label": "Budget",
        "geometry": "bar"
      },
      {
        "id": "actual",
        "field": "Actual ($K)",
        "label": "Actual",
        "geometry": "bar"
      }
    ],
    "ranges": []
  },
  "calculation": {
    "duplicates": "reject",
    "missing": "reject",
    "order": "input",
    "comparison": {
      "mode": "differences",
      "pairs": [
        {
          "id": "variance",
          "label": "Desviación",
          "from": "budget",
          "to": "actual",
          "relativeDenominator": "positive-baseline",
          "assessment": {
            "direction": {
              "source": "lookup",
              "values": {
                "Revenue": "higher",
                "COGS": "lower",
                "Gross Profit": "higher",
                "OpEx": "lower",
                "EBITDA": "higher",
                "Net Income": "higher"
              }
            },
            "labels": {
              "favorable": "Favorable",
              "unfavorable": "Unfavorable",
              "unchanged": "Favorable"
            }
          }
        }
      ]
    }
  },
  "layout": {
    "view": "row-comparison",
    "orientation": "horizontal",
    "columns": 1,
    "placement": "grouped",
    "scales": "shared-by-unit",
    "includeZero": true,
    "padding": 0.1
  },
  "rowComparison": {
    "mode": "paired-bars",
    "margin": {
      "top": 20,
      "right": 90,
      "bottom": 40,
      "left": 100
    },
    "comparison": "variance",
    "fromSeries": "budget",
    "toSeries": "actual",
    "categoryPadding": 0.3,
    "clampDomainAtZero": false,
    "categoryLabel": {
      "fontSize": 11,
      "fontWeight": 500,
      "gap": 8
    },
    "bars": {
      "height": 14,
      "gap": 3,
      "radius": 0,
      "baselineOpacity": 0.5,
      "effectOpacity": 0.9,
      "legendGap": 64,
      "legendY": -10,
      "legendSize": 10,
      "comparisonGap": 8,
      "comparisonOffset": -5,
      "assessmentOffset": 15,
      "comparisonSize": 10,
      "comparisonWeight": 600,
      "format": {
        "prefix": "$",
        "suffixSmall": "K",
        "suffixLarge": "M",
        "largeThreshold": 1000,
        "decimals": 1
      }
    }
  },
  "marks": {
    "opacity": 1,
    "rangeOpacity": 0.16,
    "barFraction": 0.65,
    "pointRadius": 7
  },
  "labels": {
    "visible": true,
    "fontSize": 15,
    "decimals": 1
  },
  "axes": {
    "grid": true,
    "ticks": 5
  },
  "legend": {
    "visible": true
  },
  "summary": {
    "visible": false
  },
  "annotations": [],
  "document": {
    "header": {
      "title": "Budget Variance",
      "subtitle": "Actual vs budget comparison with variance indicators"
    },
    "footer": {
      "source": "xarts · demo data",
      "notes": "Illustrative data to explore the chart and replace with your own."
    },
    "spacing": {
      "horizontalPadding": 24,
      "topPadding": 22,
      "bottomPadding": 24,
      "minimumTextGap": 6
    }
  },
  "output": {
    "filename": "varianceanalysis",
    "embedSpec": true,
    "geometryDecimals": 2
  },
  "presentation": {
    "theme": "anlak",
    "dimensions": {
      "width": 800,
      "height": 500
    },
    "locale": "en-US",
    "fonts": "reference",
    "surface": "theme",
    "framePadding": 24
  }
}
