What is Dyalog's replacement for ⌷CHART ? Suppose I just want a simple line graph like
⌷CHART ?⍳10
How can I do this in Dyalog?
replacement for APLX's ⌷CHART
- Adam|Dyalog
- Posts: 143
- Joined: Thu Jun 25, 2015 1:13 pm
Re: replacement for APLX's ⌷CHART
Try:
Here is a small utility function that lets you give it data as right argument and optionally a chart type as left argument:
SharpPlot has a lot of options. See e.g. here.
⎕CY'sharpplot'
c←⎕NEW SharpPlot
c.DrawLineGraph ?⍳10
3500⌶c.RenderSvg 100
Here is a small utility function that lets you give it data as right argument and optionally a chart type as left argument:
{type}Draw data;Causeway;ref;types
:If 900⌶⍬ ⍝ called monadically
type←'line'
:Else
type←819⌶⍕type
:EndIf
Causeway←⎕NS ⍬
Causeway.⎕CY'sharpplot'
ref←⎕NEW Causeway.SharpPlot
types←'D'ref.⎕NL ¯3
types/⍨←{(3≤≢⍵∩⎕A)∧'Draw'∘≡4↑⍵}¨types
:If 0∊⍴data
:OrIf 0∊⍴type
ref←911 ⎕SIGNAL⍨'VALID TYPES:',∊{' ',¯1↓1↓⍵⊂⍨⍵∊⎕A}¨types
:Else
types/⍨←type∘{∨/⍺⍷4↓⍵}¨819⌶types
:If ×≢types
(ref⍎⊃types)data
:If ¯1=(4↓⊃types)(3500⌶)ref.RenderSvg 100
'RIDE browser not available'⎕SIGNAL 6
:EndIf
:Else
'Invalid type'⎕SIGNAL 11
:EndIf
:EndIf
SharpPlot has a lot of options. See e.g. here.