SharpPlot tables
Posted: Tue Jan 19, 2021 2:36 pm
Hello APL and SharpPlot users,
I am in the process of creating a SharpPlot file, which will serve as a template for creating SharpPlot tables.
On the basis of the attached file (which is running) I ask you for help to clarify the following questions:
1. How do remove I the first column with the terms "North" "South" "East" "West" ...?
2. What must the command be so that the term "Coordinates" appears as a heading above the left margin of the right table?
1. What is the command so that the numbers in the tables appear in different colors?
Thank you for your help!
many Greetings
Leo
I am in the process of creating a SharpPlot file, which will serve as a template for creating SharpPlot tables.
On the basis of the attached file (which is running) I ask you for help to clarify the following questions:
1. How do remove I the first column with the terms "North" "South" "East" "West" ...?
2. What must the command be so that the term "Coordinates" appears as a heading above the left margin of the right table?
1. What is the command so that the numbers in the tables appear in different colors?
Thank you for your help!
many Greetings
Leo
∇MyTable[⎕]∇
[0] sp←MyTable;Causeway;System;Column1;Column2;Column3;XLabel;YLabel;XLab;LN;X;Y1;Y2
[1] ⍝ MyTable2: Erstellen einer Tabelle 15.01.2021 Ju
[2] ⍝ Daten für Tabelle1: ================================================================
[3] Column1←18 27 31 1 1
[4] Column2←120 34 27 18 8
[5] Column3←69 30 9 4 8
[6] YLabel←'North' 'South' 'East' 'West' 'Other'
[7] XLabel←2004 2005 2006
[8] ⍝
[9] ⍝ Daten für Tabelle 2: ==============================================================
[10] X←0 0.01 0.02 0.05 0.1 0.25 0.5 0.6 0.7 0.8 0.9 1
[11] Y1←0 0.0307 0.0411 0.0579 0.0699 0.074 0.0552 0.0456 0.0367 0.0292 0.0229 0.0176
[12] Y2←0 ¯0.0307 ¯0.0411 ¯0.0579 ¯0.0699 ¯0.074 ¯0.0552 ¯0.0456 ¯0.0367 ¯0.0292 ¯0.0229 ¯0.0176
[13] LN←⍳⍴X
[14] ⍝
[15] ⍝ ======================================================================================
[16] ⎕USING←'System.Drawing,system.drawing.dll' 'System.Drawing.Imaging' 'Causeway,sharpplot.dll'
[17] ⎕USING,←('Causeway,sharpplot.dll')('CausewayViewer,sharpplot.dll')
[18] ⎕USING,←'System.Windows.Forms,System.Windows.Forms.dll' 'System.Drawing,System.Drawing.dll' ''
[19] ⍝ ======================================================================================
[20] sp←⎕NEW Causeway.SharpPlot(740 520) ⍝ PaperSize in Pixel
[21] sp.Gutter←10 ⍝ Abstand des äußeren Rahmens vom Blattrand in Pixel
[22] ⍝
[23] ⍝ Heading =========================================================================
[24] sp.Heading←'MyTable' ⍝ Überschrift des Diagrammes
[25] sp.SetHeadingNudge(0,-30) ⍝ Position der Überschrift (horizont. 0=Mitte, Diagramm ,vertikal)
[26] sp.SetHeadingFont'Calibri' 30 System.Drawing.FontStyle.Regular System.Drawing.Color.Black
[27] ⍝
[28] ⍝ Subheating ====================================================================
[29] sp.Subheading←'Beispiele zur Erstellung von Tabellen mit SharpPlot' ⍝ Unter-Überschrift
[30] sp.SetSubheadingFont'Arial' 20 System.Drawing.FontStyle.Regular System.Drawing.Color.Black
[31] ⍝
[32] ⍝ Hintergrund ====================================================================
[33] sp.SetBackground System.Drawing.Color.Yellow Causeway.FillStyle.Solid ⍝ Hintergrundfarbe (außerhalb Tabelle)
[34] ⍝
[35] ⍝ Table 1 =======================================================================
[36] sp.TableStyle←Causeway.TableStyles.(Shadowed+GridLines+Right+Rounded) ⍝ Stil und Position der Tabelle
[37] sp.SetTablePosition(300)(260)(300)(0) ⍝ Position der Tabelle 2 X-Y Breite Höhe
[38] sp.YCaption←'Regional\Totals' ⍝ Überschrift in Zeile1 und Spalte 1
[39] sp.SetLabelFont'Times' 7 System.Drawing.FontStyle.Regular System.Drawing.Color.Black ⍝ Schriftstil von farm und ye
ar
[40] sp.SetCaptionFont'Arial' 6 System.Drawing.FontStyle.Bold System.Drawing.Color.Red ⍝ Schriftstil von 'Mean Yield'
[41] sp.SetXLabels⊂XLabel
[42] sp.SetYLabels⊂YLabel
[43] sp.DrawTable⊂2 3 3⍕¨¨Column1 Column2 Column3 ⍝ Formatierung der Zahlenwerte in den Spalten
[44] ⍝
[45] ⍝ Table 2 =======================================================================
[46] sp.TableStyle←Causeway.TableStyles.(Shadowed+GridLines+Right) ⍝ Stil und Position der Tabelle
[47] sp.SetTablePosition(400)(260)(200)(0) ⍝ Position der Tabelle 2 X, Y, Breite, Höhe
[48] sp.SetHeadingFont'Calibri' 10 System.Drawing.FontStyle.Regular System.Drawing.Color.Navy
[49] sp.SetColors System.Drawing.Color.Black
[50] ⍝ sp.(HeadingStyle TableStyle)←Causeway.(HeadingStyles.NoWrap TableStyles.(Shadowed+UseHeaders))
[51] sp.(XAxisStyle YAxisStyle)←Causeway.(XAxisStyles YAxisStyles).GridLines
[52] sp.(Heading YCaption)←'Coordinates' '' ⍝ Unterdrückt die "Geisterspalte"
[53] sp.(HeadingStyle TableStyle)←Causeway.(HeadingStyles.NoWrap TableStyles.(Shadowed))
[54] sp.SetXLabels⊂,¨('LN' 'X[ - ]' 'Y1[ - ]' 'Y2[ - ]') ⍝ Spaltenüberschrift
[55] sp.DrawTable⊂0 3 3 3⍕¨¨LN X Y1 Y2 ⍝ Formatierung der Tabellen-Werte
[56] ⍝
[57] ⍝ Output =============================================================================
[58] sp.SavePdf⊂'C:\Users\Admin\Desktop\MyTable.pdf' ⍝ pdf-Graphik
[59] ⍝ -Graphic on screen show-------------------------------------------------------------
[60] viewer←⎕NEW SharpPlotViewer ⋄ viewer.SharpPlot←sp ⋄ viewer.Show ⍬ ⍝ Screen-Graphik
[61] ⍝ ======================================================================================
[62] 'MyTable'