At the end of this part you have changed a chart yourself: the line chart from Part 6 becomes a column chart. No prompt, no AI. – Today your AI companion has the day off 😉
Time: about half an hour the first time, almost all of it learning; the second time it’s 5 minutes. Credits: 0.
Everything so far in this series said „let the AI do it“. This post says: the code is not a black box. The charts in your app are Vega-Lite, the same language as the Power BI custom visual Deneb. If you’ve ever touched a Deneb spec, you can do this. And if you haven’t, this is a gentle start.
I built this part live with Claude guiding me step by step, on the forecast app from Parts 4 to 6.
Exercise 1: Line chart to column chart
In Part 6, a 25 kEUR difference between two scenarios disappeared in a line chart. Let’s turn it into columns by hand.
Step 1: A safe playground with Git
Your app still shows the line chart from Part 6. You could edit it directly, but a practice branch is a safe playground: whatever you break there, your main branch stays untouched. Git is not just an undo button; it’s also a parallel universe.
You do (VS Code terminal, one command at a time):
- Open the terminal (menu Terminal → New Terminal) and type git status. It must say „nothing to commit, working tree clean“. If not, commit first: Source Control → message → Commit.
- Type git switch -c hands-on-line-to-column and press Enter. This creates the branch and moves you onto it.
- Check: git branch –show-current answers hands-on-line-to-column.
Your app on the main branch stays as it is.
Step 2: Find the chart
The charts live in src/queries/sales-forecast. Each chart comes as a set of four files with the same name:
We only edit the .json file. The numbers stay the same; only the look changes. Tip: Ctrl + P and the file name opens any file instantly.
In the spec, mark: line is the chart type, x and y are the axes, color and strokeDash mean „one line per series“, and tooltip is the hover. Exactly like Deneb.
Step 3: Try it in the Vega Editor first
The Vega Editor is a free website where you can try charts instantly, like a Deneb playground outside Power BI. Nothing to install.
You do:
- Open your normal browser (not the browser inside VS Code) and go to vega.github.io/editor.
- Top left: switch the dropdown from Vega to Vega-Lite.
- Click into the code pane, Ctrl + A, Delete, then paste a test version of your spec.
Stumbling block: I pasted the spec from the app and got an empty chart. Look at „data“: {}: in the app, the chart file contains no numbers at all. The app fills them in from the DAX query at runtime. The editor needs a few sample rows instead, and fixed sizes instead of „container“ (the editor has no card to fill):
The Vega Editor: dropdown Vega-Lite at the top left, code on the left, chart on the right. With the app’s spec, the chart stays empty: data {} has no numbers.
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {
"values": [
{"monthStart": "2026-07-01T00:00:00", "series": "Actual", "amount": 2650000},
{"monthStart": "2026-08-01T00:00:00", "series": "Actual", "amount": 2480000},
{"monthStart": "2026-09-01T00:00:00", "series": "Actual", "amount": 2790000},
{"monthStart": "2026-10-01T00:00:00", "series": "FC Base", "amount": 2831720},
{"monthStart": "2026-11-01T00:00:00", "series": "FC Base", "amount": 2982464},
{"monthStart": "2026-12-01T00:00:00", "series": "FC Base", "amount": 3361947},
{"monthStart": "2026-10-01T00:00:00", "series": "FC v2", "amount": 2860000},
{"monthStart": "2026-11-01T00:00:00", "series": "FC v2", "amount": 2955000},
{"monthStart": "2026-12-01T00:00:00", "series": "FC v2", "amount": 3390000}
]
},
"width": 600,
"height": 300,
"mark": {"type": "line", "strokeWidth": 2},
"encoding": {
"x": {"field": "monthStart", "type": "temporal", "axis": {"title": null, "format": "%b %y"}},
"y": {"field": "amount", "type": "quantitative", "axis": {"title": "Sales (EUR)", "format": ",.0f"}},
"color": {"field": "series", "type": "nominal"},
"strokeDash": {"field": "series", "type": "nominal"}
}
}
Three things to notice in the line chart: the two forecasts lie almost on top of each other (the ruler problem), every month label appears twice, and actuals and forecast don’t connect.
Step 4: One word, and why it’s not enough
Change „line“ to „bar“ (and drop strokeWidth). The y-axis suddenly goes up to 7 million. Vega-Lite stacks bars by default, so FC Base and FC v2 were added on top of each other: a number that exists nowhere. Copilot will make exactly this mistake in the IBCS round in Part 8 („20 stacked segments“), and now you already know why.
Fix 1: one slot per month. Make the x-axis categorical instead of a continuous time line:
"x": {"field": "monthStart", "timeUnit": "yearmonth", "type": "ordinal", "axis": {"title": null, "format": "%b %y"}},
Wide bars, one label per month, but still stacked.
Fix 2: side by side. Add one line after x:
"xOffset": {"field": "series"},
That’s „clustered“ instead of „stacked“ in Power BI terms. Now Base and v2 stand next to each other at their real height, and the difference is visible at a glance. Finally, delete strokeDash: dashes are for lines.
Step 5: Carry back only the changed lines
I asked: can’t I just copy the editor code into the app? No. You’d carry the sample data, the fixed size and the missing tooltip into the app. Test in the editor, carry back only the changed lines. The final file for the app:
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"description": "Monthly actuals and scenario forecast comparisons.",
"data": {},
"width": "container",
"height": "container",
"mark": {
"type": "bar"
},
"encoding": {
"x": {
"field": "monthStart",
"timeUnit": "yearmonth",
"type": "ordinal",
"axis": { "title": null, "format": "%b %y" }
},
"xOffset": { "field": "series" },
"y": {
"field": "amount",
"type": "quantitative",
"axis": { "title": "Sales (EUR)", "format": ",.0f" }
},
"color": { "field": "series", "type": "nominal" },
"tooltip": [
{ "field": "monthStart", "type": "temporal", "title": "Month" },
{ "field": "series", "type": "nominal", "title": "Scenario" },
{ "field": "amount", "type": "quantitative", "title": "Sales", "format": ",.0f" }
]
}
}
Save with Ctrl + S. VS Code does not save automatically; the ● in the tab means „unsaved“.
To see what changed: Source Control icon (left bar, the one with the badge) → click the file. Red is old, green is new. The whole design change: 1 file, +7 −8 lines.
Stumbling block: a „problem“ saying „Unable to load schema from vega.github.io“. Harmless: VS Code couldn’t download the Vega-Lite dictionary for autocomplete. Your chart is fine.
Step 6: Test, commit, look
npm test — monthly-sales runs only this chart’s tests. Two surprises:
- The first run took almost a minute and seemed to hang. The template’s tests start in watch mode: when you see „Waiting for file changes“, the run is done. Press q.
- The test passed, although the chart changed. It checks whether the data is prepared correctly, not what the chart looks like. A green test means the numbers are right; whether the chart looks right, you only see in Fabric.
Commit: Source Control → message Hands-on: line to column chart → Commit. Then type npx rayfin up, open the app in the Fabric portal and refresh (F5). Deploying from the practice branch is safe: it differs from main in this one chart file only.
The hand-made column chart in Fabric, normal view and compare view. Colors and „€M“ come from the app’s theme, not from our JSON.
⚠️One more discovery: colors, „€3.5M“ and the round legend dots don’t come from our JSON. The JSON decides what is drawn; the app’s theme decides the look, like a Power BI report theme overriding visual defaults.
Step 7: Back to main
You do: in the terminal, type git switch main.
Your column chart stays saved on the practice branch, so you can come back to it any time. You don’t need it for Part 8: the IBCS round there rebuilds all charts anyway. And at the end of Part 8, you’ll use what you learned here on the live app, polishing the pin chart by hand. When to edit by hand, when to ask the AI.
When to edit by hand, when to ask the AI
Fabric Apps is in preview; menus and commands may change. Built live on 12 October 2026, 13:23–14:17. Co-authored with Claude as co-learner. Previous: Part 6 · Next: Part 8. #HumanAICoProgramming