PieChart


Show a simple pie chart



XAML


xaml←PieChartXAML
⍝ XAML for the PieChart example
 xaml←⊂'<Window'
 xaml,←⊂'    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"'
 xaml,←⊂'    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"'
 xaml,←⊂'    xmlns:sfchart="clr-namespace:Syncfusion.Windows.Chart;assembly=SyncFusion.Chart.WPF"'
 xaml,←⊂'    SizeToContent="WidthandHeight" >'
 xaml,←⊂'    <StackPanel>'
 xaml,←⊂'        <sfchart:Chart Name="sfpie" Height="200" Width="200">'
 xaml,←⊂'          <sfchart:ChartArea>'
 xaml,←⊂'            <sfchart:ChartSeries Name="seriespie" Type="Pie" ShowDataLabels="True"/>'
 xaml,←⊂'          </sfchart:ChartArea>'
 xaml,←⊂'        </sfchart:Chart>'
 xaml,←⊂'    </StackPanel>'
 xaml,←⊂'</Window>'


Code


∇  z←PieChart(header values);⎕IO;⎕ML;xaml;⎕USING;pievalues;vl;al;series;chartdata;point
⍝ Simple PieChart example
 ⎕IO ⎕ML←0 3
 xaml←PieChartXAML
 #.window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncChart')
 window_pie window_series←{#.window.FindName⊂⍵}¨'sfpie' 'seriespie'
 ⎕USING←,⊂'Syncfusion.Windows.Chart,Syncfusion/4.5/Syncfusion.Chart.WPF.dll'
 window_pie.Header←header
 chartdata←⎕NEW ChartListData
 :For point :In values
     chartdata.Add ⎕NEW ChartPoint(0,point)
 :EndFor
 window_series.Data←chartdata
 {}#.window.ShowDialog


The 'SyncChart' argument to #.UTIL.LoadXAML has the effect of adding
  'Syncfusion.Windows.Chart,Syncfusion/4.5/Syncfusion.Chart.WPF.dll'
 to the ⎕USING list of LoadXAML

Operation


     #.PieChart.PieChart 'Who ate all the pies' (2+⍳5)    

Unresolved Issues