Sparkline


Show simple line or column charts of a vector of numeric values



XAML


∇  xaml←SparklineXAML type
⍝ XAML for the Sparkline 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:sfspark="clr-namespace:Syncfusion.Windows.Chart;assembly=SyncFusion.Chart.WPF"'
 xaml,←⊂'    SizeToContent="WidthandHeight" >'
 xaml,←⊂'    <StackPanel>'
 xaml,←⊂'        <sfspark:SparkLine Name="sfspark" ItemsSource="{Binding}"'
 :Select type
 :Case 'Column'
     xaml,←⊂'        SparkLineType="Column">'
 :Case 'Line'
     xaml,←⊂'        SparkLineType="Line" LineMarkerType="Circle" MarkerColor="Blue" IsMarkerEnabled="True" >'
 :EndSelect
 xaml,←⊂'        </sfspark:SparkLine>'
 xaml,←⊂'    </StackPanel>'
 xaml,←⊂'</Window>' 



Code


∇  z←type Sparkline w;⎕IO;⎕ML;xaml;⎕USING;sparkvalues;vl;al
⍝ Simple Sparkline example
 ⎕IO ⎕ML←0 3
 xaml←SparklineXAML type
 #.window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncChart')
 window_sparkline←#.window.FindName⊂'sfspark'
 window_sparkline.(Height Width)←100 200
 sparkvalues←w
 ⎕USING←#.UTIL.WPF.Using''
 window_sparkline.Background←Brushes.Yellow
 window_sparkline.Interior←Brushes.Red
 ⎕USING←,⊂''
 vl←System.Double(2015⌶)'sparkvalues'
 window_sparkline.ItemsSource←vl
 {}#.window.ShowDialog


Several examples of Syncfusion's inconsistency on display here.

Thanks to John Daintree for his assistance getting these examples to work as advertised.

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


     'Line' #.Sparkline.Sparkline ⌈\?⍳20
     'Column' #.Sparkline.Sparkline ⌈\?⍳20

Unresolved Issues