M365.FM - Modern work, security, and productivity with Microsoft 365

Why Power Apps Charts Are Broken (and How AI Fixes It)


Listen Later

(00:00:00) The Power Apps Chart Conundrum
(00:01:25) The Broken Native Chart Control
(00:04:17) AI to the Rescue: A New Visualization Engine
(00:08:08) Building Your First AI Chart Module
(00:11:46) Dynamic and Context-Aware Charts
(00:16:35) The Future of Power Apps: 3D Visualizations
(00:19:51) The AI-Powered Visualization Revolution

Opening: The Data Visualization ProblemPower Apps charts look like they escaped from a 199s Excel demo—clunky blocks, random colors, and fonts that could make a design intern weep. You drag one onto the canvas, tweak a few properties, and there it sits: a relic. It’s like Microsoft kept the idea of “charting” but amputated everything that made it aesthetic or flexible. Business stakeholders stare at it, nod politely, and go back to their old Power BI dashboards.The issue isn’t cosmetic—it’s structural. The native chart control is rigid. You can’t meaningfully style it. You can’t layer additional data or redesign axes or sync it dynamically with form interactions without contortion-level formulas. Every deviation from the template feels like you’re breaking a sacred rule buried somewhere in the Power Apps source code.Enter the heretical alternative—using AI prompts to generate your charts. Yes, literally asking an AI model to draw the chart image for you, on command, with the style, colors, and proportions you actually want. It’s fast, it’s flexible, and—unlike that built-in chart—it looks like it’s from this decade.Even Power BI fans struggle when they need one little chart directly inside a Power App. Waiting for IT to refresh datasets and publish reports isn’t “real-time”. Business users demand data now. They want visuals that live inside the logic of the app, changing as records change, filtering live across screens.Today, that’s what we’re fixing. You’ll learn how to make Power Apps draw anything—from lollipop charts to area graphs—without touching the dreadful native control. The solution? AI code generation, working as your free in-app visualization engine.Section 1: Why Power Apps Charts Are Fundamentally BrokenLet’s diagnose this politely: Power Apps’ native chart control is an architectural fossil. It’s not broken because of a bug—it’s broken because it was designed before Power Apps learned what modern visualization actually means. It’s built on static configuration—one data source, one type, one style, one color scheme. Everything is fixed. Dynamic adaptation? Optional. Except it isn’t.Developers know the drill. You bind a collection, specify categories and values, and then start bending syntax just to make bars thicker or labels fit. Eventually you realize: the control can’t flex. It’s like trying to teach a vending machine empathy. Want to change gradients dynamically? No. Want to label axes based on runtime data? No. You’re allowed exactly what the template designer considered “reasonable.”Under the hood, the real villain is architectural encapsulation. All the rendering logic—colors, scaling, font families, even antialiasing—is sealed inside the control’s black box. Developers can’t extend it. All you can do is serialize your data manually into pseudo‑JSON strings that the control re-parses, pretending it understands flexibility. Spoiler: it doesn’t.Every property—the color palette, the legend position, the data scaling—is tied to prebuilt templates. Touch one incorrectly, and you’re rewarded with cryptic rendering errors. It’s as if the charting engine expects gratitude for functioning at all.Compare that to modern libraries like D3.js or Chart.js. Those treat charts like living organisms. They respond to data updates, style instructions, even user events. They see data as a stream; Power Apps sees it as laminated cardboard. D3 updates the DOM in real time. Power Apps redraws its chart every time like it’s chiseling it in stone.Then there’s the artistic side—or lack thereof. The font hierarchy is prehistoric, and color handling seems allergic to your organization’s branding. You either live with teal and burnt orange, or you spend hours guessing which property name might control the axis color—spoiler, none of them do.The economic cost? Developers waste hours debugging configuration issues instead of building insights. IT ends up exporting data to Power BI just to visualize it properly, effectively turning Power Apps into a glorified data entry screen.The average user workaround is unintentionally comedic: take a screenshot of a Power BI visual, paste it into an image control, and pretend it’s “live.” To which I say, congratulations—you just invented a JPEG dashboard.All of this happens not because Microsoft hates charts but because their visual rendering model is isolated from the modern web stack. It isn’t using the same HTML5 canvas or scalable vector technologies you find elsewhere; it’s locked inside a sandbox where creativity goes to die.The truth? Power Apps charts aren’t misbehaving; they’re fulfilling their unfortunate destiny—providing only the minimal, most technically feasible version of a chart. They’re obedient, not expressive. Reliable, not dynamic. In practice, that’s a death sentence for any team that depends on responsive, interactive visuals to make decisions.So when someone asks, “Why are Power Apps charts broken?” the answer isn’t “They glitch.” The answer is “They were born obsolete.” Nothing short of tearing out their rendering model will fix them. Which is exactly why we’re bringing AI into this equation—because unlike the resident chart control, AI doesn’t care about 199s design limitations. It will draw what you describe, not what Microsoft believes is aesthetic. It will generate exactly what your app context needs. And that’s where the fun begins.Section 2: The AI Code Generation ShortcutHere’s the twist: the solution doesn’t involve creating a better chart control at all. You sidestep the problem entirely. Instead of begging Power Apps to behave like a modern visualization engine, you let AI do the heavy lifting and feed Power Apps the finished product—as an image. Yes, an image. The chart is rendered elsewhere, encoded as a string, and quietly dropped into your app like a Trojan horse of competency.This is made possible by Power Platform’s new apiprompt.predict function, which lets you write a natural language instruction—“draw a bar chart of employee salaries by department, modern color scheme, clean typography”—and have AI respond with executable code. Specifically, with generated chart code that renders a static visual—exported as a Base64 string. Power Apps simply takes that string, tosses it into an HTML text control, and pretends it created a beautiful modern chart. Spoiler: it didn’t. The AI did.Under the hood, the architecture is surprisingly clean: AI engine → image generation script → encoded Base64 image → HTML text control → displayed chart. The app never draws, it only displays. The AI becomes your remote rendering service. Think of it as outsourcing creativity to a hyper‑literal intern who happens to know code and design trends.To make this work, though, precision is everything. Power Apps hands the AI model your dataset—converted to JSON. Not the entire table, because that’s how you make the AI panic. You trim it surgically to the relevant columns, like “Department” and “Salary.” Minimal payloads aren’t just best practice—they’re the difference between instant visuals and an apologetic timeout message.Why JSON? Because JSON is the Esperanto of modern APIs—the universal dialect machines understand. It carries context cleanly. When you convert a Power Apps collection into JSON, the AI knows exactly which fields matter. You’re effectively giving it the schema and table in the same parcel: “Here’s the structure, here’s the content, paint accordingly.”And that’s where the “Code Interpreter” setting in Power Platform steps in. You enable it, and suddenly the prompt engine understands not just text, but instructions that involve data transformation, code execution, and graphical rendering. Disabled, your AI is just a chatty assistant. Enabled, it’s a script‑writing artist. If you can’t toggle it, your admin can—assuming they understand what “innovation” means.Once in motion, the process feels surreal. You press a button labeled “Generate Chart,” your variable captures something like Set(varChart, apiprompt.predict(”barGraph”, JSON(myFilteredData))), and a few seconds later, your HTML text control blooms into a crisp SVG‑style chart that Power Apps thinks is a picture. No custom connectors, no third‑party packages, no waiting for Power BI integration. It’s self‑contained, fast, and borderline rebellious.Of course, AI has the personality of a freshman intern—eager, literal, and occasionally confused. You say “modern style,” and it might deliver something that belongs in a neon dashboard circa 201. That’s your cue to be explicit: “flat modern design, professional color scheme, no gradients, Helvetica labels.” The clarity of your prompt dictates the professionalism of your output.In practice, this transforms Power Apps into something entirely new—a hybrid UI host rather than a renderer. The app becomes the frame; the AI paints the canvas. Power Apps stops pretending to be Power BI and instead becomes the stage where data and design meet on demand.Now that you understand the mechanism—the AI generating, Power Apps displaying—the question is no longer can it work. The question is: can it scale beyond demos? Because it’s cute to generate a single bar chart with hardcoded data. What matters is making it dynamic, reusable, and context‑aware across your actual apps. And that’s exactly where we’re heading next.Section 3: Building Your First AI Chart ModuleNow, let’s build something that actually works—a basic AI chart module inside Power Apps. Think of this as the first laboratory test: a controlled environment with predictable results. We’ll start with two chart types—bar and line. Yes, the training wheels of visualization. If you can command these two, you can command anything.Step one: architect the prompt. This is the instruction set you send to the AI, and its clarity will decide whether you get a masterpiece or a toddler doodle. Write something unambiguous: “Use the following JSON to create a modern bar chart with clean colors and readable labels. Return only t

Become a supporter of this podcast: https://www.spreaker.com/podcast/m365-fm-modern-work-security-and-productivity-with-microsoft-365--6704921/support.

If this clashes with how you’ve seen it play out, I’m always curious. I use LinkedIn for the back-and-forth.
...more
View all episodesView all episodes
Download on the App Store

M365.FM - Modern work, security, and productivity with Microsoft 365By Mirko Peters (Microsoft 365 consultant and trainer)