Categories
- All Categories
- Oracle Analytics and AI Learning Hub
- 53 Oracle Analytics and AI Sharing Center
- 20 Oracle Analytics and AI Lounge
- 293 Oracle Analytics and AI News
- 57 Oracle Analytics and AI Videos
- 16.4K Oracle Analytics and AI Forums
- 6.5K Oracle Analytics and AI Labs
- Oracle Analytics and AI User Groups
- 116 Oracle Analytics and AI Trainings
- 21 Oracle Analytics and AI Challenge
- Find Partners
- For Partners
AI Agent - Using SVG Pie Chart representation for extracted data from an OTBI report
Hello experts,
I need to generate output from an OTBI analysis in the form of a Pie chart, in Oracle Fusion AI Agent Studio.
I'm trying to leverage SVG Charts using LLM Prompts. But its not working as expected.
Ex: (Agent Prompt in LLM)
******************************************************************************************************************************
You are to provide an SVG (no javascript) pie chart, display all Hold Totals as slices of the pie.
chart format:
- Wrap the SVG chart into a div and maximize the real estate available to you
- Title: Hold Totals as h4
- Include a legend with color code below the chart, with each item vertically stacked. Add a margin or padding between with the chart to avoid overlapping
- Ensure the chart is clear and visible (for example size 525 x 525 viewBox="0 0 400 420" and width: -webkit-fill-available;)
- Add the total number of holds at the center of the pie
- Ensure percentages are centered if any are displayed
********************************************************************************************************
But the Agent is not able to convert the SVG components into chart, where as Legend comes up fine as you see below.
The LLM generated tags are as below: (Tried giving an Example as below in the custom LLM Prompt as well - instead of instructions in plain text/along with it)
<div style="width: 100%; max-width: 600px; box-sizing: border-box; padding: 12px; text-align: center;">
<h4 style="margin: 6px 0 12px 0; font-family: sans-serif;">Hold Totals</h4>
<svg viewBox="0 0 400 400" width="100%" xmlns="http://www.w3.org/2000/svg" style="max-width:100%; display:block; margin:0 auto 12px;">
<!-- Pie center at (200,200), radius 140 -->
<!-- Slices (using three paths) -->
<!-- ABC Supplies: value 22 (88%) — large slice -->
<path d="M200 200 L340 200 A140 140 0 1 1 116.655 84.387 Z" fill="#4CAF50" stroke="#ffffff" stroke-width="1"/>
<!-- Windsor Inc Ltd: value 2 (8%) -->
<path d="M200 200 L116.655 84.387 A140 140 0 0 1 161.524 266.582 Z" fill="#2196F3" stroke="#ffffff" stroke-width="1"/>
<!-- Dell Inc.: value 1 (4%) -->
<path d="M200 200 L161.524 266.582 A140 140 0 0 1 340 200 Z" fill="#FF9800" stroke="#ffffff" stroke-width="1"/>
<!-- Percentage labels (approx. centered within each slice) --> <text x="106" y="150" font-family="sans-serif" font-size="12" fill="#ffffff" font-weight="700" text-anchor="middle">88.0%</text> <text x="146" y="236" font-family="sans-serif" font-size="10" fill="#ffffff" font-weight="700" text-anchor="middle">8.0%</text> <text x="267" y="236" font-family="sans-serif" font-size="10" fill="#ffffff" font-weight="700" text-anchor="middle">4.0%</text> <!-- Outer circle border for clarity --> <circle cx="200" cy="200" r="140" fill="none" stroke="#e0e0e0" stroke-width="1"/>
</svg> <!-- Legend: vertically stacked, spaced from chart --> <div style="display: inline-block; text-align: left; padding-top: 8px; font-family: sans-serif;">
<div style="display:flex; align-items:center; margin-bottom:8px;">
<div style="width:18px; height:14px; background:#4CAF50; margin-right:10px; border:1px solid rgba(0,0,0,0.06)"></div>
<div style="font-size:14px;">ABC Supplies — 22</div>
</div>
<div style="display:flex; align-items:center; margin-bottom:8px;">
<div style="width:18px; height:14px; background:#2196F3; margin-right:10px; border:1px solid rgba(0,0,0,0.06)"></div>
<div style="font-size:14px;">Windsor Inc Ltd — 2</div>
</div>
<div style="display:flex; align-items:center;">
<div style="width:18px; height:14px; background:#FF9800; margin-right:10px; border:1px solid rgba(0,0,0,0.06)"></div>
<div style="font-size:14px;">Dell Inc. — 1</div>
</div>
</div>
</div>
Tried using a 3 card approach and it worked. But I wanted to work this out with SVG. Any help is much appreciated!!
Thanks
Answers
-
To add, I tried a simple SVG test code (just a circle) to see if its being picked up by the agent, but no luck. agent shows nothing (just the header)..The same code comes up in the LLM output, just that agent is not converting them
<div style="width: -webkit-fill-available; display:flex; flex-direction:column; align-items:center;">
<h4 style="margin:8px 0 12px 0;">Top 5 Suppliers (preview)</h4>
<svg width="200" height="200"
xmlns="http://www.w3.org/2000/svg">
<circle cx="100" cy="100" r="80" />
</svg>
</div>0 -
Hi,
Oracle AI Fusion Agent Studio is more a Fusion product than an Oracle Analytics or AI product.
Fusion and all the related products are covered in a parallel, but independent, forum:
0 -
@Rima Nair-Oracle , Welcome to the Oracle AI Service Forum. I have gone thru your post and extensive explanation and understood that there is a need to create pie chart.
Have you considered, building the pie chart directly in OTBI and somehow export it as image and ask agent to return that image.
Hope it helps!
0



