Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/ChartDirector/symbolline2
Function:
Required plugins for this example: MBS ChartDirector Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /ChartDirector/symbolline2
This example is the version from Sun, 17th Mar 2012.
Project "symbolline2.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
EventHandler Sub Open() // The data for the line chart dim data0(-1) as double = array(42, 49, 33, 38, 64, 56, 29, 41, 44, 57, 59, 42.0) dim data1(-1) as double = array(65, 75, 47, 34, 42, 49, 73, 62, 90, 69, 66, 78.0) dim data2(-1) as double = array(36, 28, 25, 28, 38, 20, 22, 30, 25, 33, 30, 24.0) dim labels(-1) as string = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec") // Create a XYChart object of size 600 x 375 pixels dim c as new CDXYChartMBS(600, 375) // Add a title to the chart using 18 pts Times Bold Italic font call c.addTitle("Product Line Global Revenue", "timesbi.ttf", 18) // Set the plotarea at (50, 55) and of 500 x 280 pixels in size. Use a vertical // gradient color from light blue (f9f9ff) to sky blue (aaccff) as background. // Set border to transparent and grid lines to white (ffffff). call c.setPlotArea(50, 55, 500, 280, c.linearGradientColor(0, 55, 0, 335, &hf9fcff, &haaccff), -1, c.kTransparent, &hffffff) // Add a legend box at (50, 28) using horizontal layout. Use 10pts Arial Bold as // font, with transparent background. c.addLegend(50, 28, false, "arialbd.ttf", 10).setBackground(c.kTransparent) // Set the x axis labels call c.xAxis.setLabels(labels) // Set y-axis tick density to 30 pixels. ChartDirector auto-scaling will use this // as the guideline when putting ticks on the y-axis. c.yAxis.setTickDensity(30) // Set axis label style to 8pts Arial Bold call c.xAxis.setLabelStyle("arialbd.ttf", 8) call c.yAxis.setLabelStyle("arialbd.ttf", 8) // Set axis line width to 2 pixels c.xAxis.setWidth(2) c.yAxis.setWidth(2) // Add axis title using 10pts Arial Bold Italic font call c.yAxis.setTitle("Revenue in US millions", "arialbi.ttf", 10) // Add a line layer to the chart dim layer as CDLineLayerMBS layer = c.addLineLayer // Set the line width to 3 pixels layer.setLineWidth(3) // Add the three data sets to the line layer, using circles, diamands and X // shapes as symbols layer.addDataSet(data0, &hff0000, "Quantum Computer").setDataSymbol(c.kCircleSymbol, 9) layer.addDataSet(data1, &h00ff00, "Atom Synthesizer").setDataSymbol(c.kDiamondSymbol, 11) layer.addDataSet(data2, &hff6600, "Proton Cannon").setDataSymbol(c.Cross2Shape, 11) // Output the chart Backdrop=c.makechartPicture End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS ChartDirector Plugin.




Links
MBS FileMaker Plugins