Well first you're going to call or compose an email to any former math teachers (specifically a calculus teacher) and apologize for ever thinking "when will I ever use this math!"
About a year ago we were exploring the uses of the Draw API (heavy scripting) for something like this. I developed a very dirty pie chart, but eventually ran into plenty of walls as we talked about how many features we'd want to include. Ultimately, we decided that for what we were doing, Pie Charts didn't really serve our needs any better than a bar chart. Also, we are fortunate to have graphic artists on hand for production operations, so infographics go to them.
There's a lot of stuff to script in it from determining the slices based on the available datapoints, the math to break them into a proportional value (based on a 360 degree circle), the color to assign the slices, and then of course in your case the midpoint of the arc you need to place a numerical value on screen based on the circle's origin. Excel really makes it look simple eh?
To give you a fighting chance, I have an early version of that script before I optimized it with some For loops and arrays but I don't have access to that file with a more elegant script (this only goes to 5 values). If you go into the SDK documentation that came with Xpression you can look for the APITexture Shader section and glean some info from there on how this is being made. If you provide me your email I can provide a lightweight Xpression file for you to poke around in. Good luck!
dim Material as xpMaterial
Engine.GetMaterialByName("PieMat",Material)
dim APIPie as xpAPITextureShader
Material.GetShaderByName("APIPie", APIPie)
dim Pen as xpPen
Pen = Engine.CreatePen
Pen.Size = 20
Pen.SetColor(0,0,255,255)
dim Brush as xpBaseBrush
Engine.CreateBrush(0, Brush)
Brush.SetColor(20,170,204,255)
dim EntryField as xpTextObject
Self.GetObjectByName("Slices",EntryField)
APIPie.Clear
Engine.DebugMessage("Begin Execute",0)
dim TextField1 as xpTextObject
Self.GetObjectByName("Val1",TextField1)
dim TextField2 as xpTextObject
Self.GetObjectByName("Val2",TextField2)
dim TextField3 as xpTextObject
Self.GetObjectByName("Val3",TextField3)
dim TextField4 as xpTextObject
Self.GetObjectByName("Val4",TextField4)
dim TextField5 as xpTextObject
Self.GetObjectByName("Val5",TextField5)
dim Outputs() as Double = {Cdbl(TextField1.Text),Cdbl(TextField2.Text),Cdbl(TextField3.Text),Cdbl(TextField4.Text),Cdbl(TextField5.Text)}
dim HighestIndex as Integer = Outputs.Length-1
For index as Integer = 0 to Outputs.Length-1
If Outputs(index) = Nothing Then
HighestIndex = HighestIndex-1
End If
Next
dim TotalPie as double
' Individual Slice Values
For index as Integer = 0 to HighestIndex
TotalPie += Outputs(index)
Next
'Individual Slice Angles
dim PieAngles(HighestIndex) as Double
For index as Integer = 0 to HighestIndex
PieAngles(index) = Math.Round((Outputs(index) / TotalPie)*360,2)
Next
Engine.DebugMessage("Highest Index Before Start Angle Math = " & HighestIndex,0)
dim StartAngleVal as double = 0
dim StartAngles(HighestIndex) as Double
StartAngles(0) = StartAngleVal
For index as Integer = 1 to HighestIndex
StartAngles(index) = StartAngleVal + PieAngles(index-1)
StartAngleVal += PieAngles(index-1)
Next
'=======================================
'Individual Slice Math
'=======================================
if (HighestIndex = 1) then
Engine.DebugMessage("Two",0)
APIPie.FillPie(Brush, 810,390,300,300,0,PieAngles(0))
Brush.SetColor(61,136,153,255)
APIPie.FillPie(Brush, 810,390,300,300,StartAngles(1),PieAngles(1))
else if (HighestIndex = 2) then
Engine.DebugMessage("Three",0)
APIPie.FillPie(Brush, 810,390,300,300,0,PieAngles(0))
Brush.SetColor(61,136,153,255)
APIPie.FillPie(Brush, 810,390,300,300,StartAngles(1),PieAngles(1))
Brush.SetColor(0,255,162,255)
APIPie.FillPie(Brush, 810,390,300,300,StartAngles(2),PieAngles(2))
else if (HighestIndex = 3) then
Engine.DebugMessage("Four",0)
APIPie.FillPie(Brush, 810,390,300,300,0,PieAngles(0))
Brush.SetColor(61,136,153,255)
APIPie.FillPie(Brush, 810,390,300,300,StartAngles(1),PieAngles(1))
Brush.SetColor(0,255,162,255)
APIPie.FillPie(Brush, 810,390,300,300,StartAngles(2),PieAngles(2))
Brush.SetColor(204,20,90,255)
APIPie.FillPie(Brush, 810,390,300,300,StartAngles(3),PieAngles(3))
else if (HighestIndex = 4) then
Engine.DebugMessage("Five",0)
APIPie.FillPie(Brush, 810,390,300,300,0,PieAngles(0))
Brush.SetColor(61,136,153,255)
APIPie.FillPie(Brush, 810,390,300,300,StartAngles(1),PieAngles(1))
Brush.SetColor(0,255,162,255)
APIPie.FillPie(Brush, 810,390,300,300,StartAngles(2),PieAngles(2))
Brush.SetColor(204,20,90,255)
APIPie.FillPie(Brush, 810,390,300,300,StartAngles(3),PieAngles(3))
Brush.SetColor(255,91,51,255)
APIPie.FillPie(Brush, 810,390,300,300,StartAngles(4),PieAngles(4))
end if
APIPie.DrawEllipse(Pen, 760, 340, 400, 400)
Array.Clear(Outputs,0,Outputs.Length)
Array.Clear(PieAngles,0,PieAngles.Length)
Array.Clear(StartAngles,0,StartAngles.Length)
Engine.DebugMessage("OutputsLength = " & Outputs(0),0)
Engine.DebugMessage("PieAngle Degrees = " & PieAngles(3),0)
#XPression