Platforms to show: All Mac Windows Linux Cross-Platform
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/floatingbox
This example is the version from Sun, 17th Mar 2012.
Project "floatingbox.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class PicWindow Inherits Window
EventHandler Sub Open()
// Sample data for the Box-Whisker chart. Represents the minimum, 1st quartile,
// medium, 3rd quartile and maximum values of some quantities
dim Q0Data(-1) as double = array(40, 45, 40, 30, 20, 50, 25, 44.0)
dim Q1Data(-1) as double = array(55, 60, 50, 40, 38, 60, 51, 60.0)
dim Q2Data(-1) as double = array(62, 70, 60, 50, 48, 70, 62, 70.0)
dim Q3Data(-1) as double = array(70, 80, 65, 60, 53, 78, 69, 76.0)
dim Q4Data(-1) as double = array(80, 90, 75, 70, 60, 85, 80, 84.0)
// The labels for the chart
dim labels(-1) as string = array("Group A", "Group B", "Group C", "Group D", "Group E", "Group F", "Group G", "Group H")
// Create a XYChart object of size 550 x 250 pixels
dim c as new CDXYChartMBS(550, 275)
// Set the plotarea at (50, 25) and of size 450 x 200 pixels. Enable both
// horizontal and vertical grids by setting their colors to grey (&hc0c0c0)
c.setPlotArea(50, 50, 450, 200).setGridColor(&hc0c0c0, &hc0c0c0)
// Add a title to the chart
call c.addTitle("Computer Vision Test Scores")
// Set the labels on the x axis and the font to Arial Bold
c.xAxis.setLabels(labels).setFontStyle("arialbd.ttf")
// Set the font for the y axis labels to Arial Bold
call c.yAxis.setLabelStyle("arialbd.ttf")
// Add a Box Whisker layer using light blue &h9999ff as the fill color and blue
// (&hcc) as the line color. Set the line width to 2 pixels
call c.addBoxLayer(Q4Data, Q3Data, &h00ff00, "Top 25%")
call c.addBoxLayer(Q3Data, Q2Data, &h9999ff, "25% - 50%")
call c.addBoxLayer(Q2Data, Q1Data, &hffff00, "50% - 75%")
call c.addBoxLayer(Q1Data, Q0Data, &hff0000, "Bottom 25%")
// Add legend box at top center above the plot area using 10 pts Arial Bold Font
dim b as CDLegendBoxMBS
b= c.addLegend(50 + 225, 22, false, "arialbd.ttf", 10)
b.setAlignment(c.kTopCenter)
b.setBackground(c.kTransparent)
// 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
The items on this page are in the following plugins: MBS ChartDirector Plugin.