Platforms to show: All Mac Windows Linux Cross-Platform

/ChartDirector/compactline


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/compactline

This example is the version from Sun, 17th Mar 2012.

Project "compactline.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() // // We use a random number generator to simulate the data from 9:30am to 4:30pm // with one data point every 4 minutes. The total number of points during that // period is 106. (7 hours x 15 points/hour + 1) // dim noOfPoints as integer = 106 // Assume we have not reached the end of the day yet, and only 85 points are // available. Create a random table object of 1 col x 85 rows, using 9 as seed. dim rantable as new CDRanTableMBS(9, 1, 85) // Set the 1st column to start with 1800 and with random delta from -5 to 5. rantable.setCol(0, 1800, -5, 5) // Get the data as the 1st column of the random table dim data as CDArrayMBS = rantable.getCol(0) // The x-axis labels for the chart dim labels(-1) as string = array("-", "10am", "-", " ", "-", "12am", "-", " ", "-", "2pm", "-", " ", "-", "4pm", "-") // // Now we obtain the data into arrays, we can start to draw the chart using // ChartDirector // // Create a XYChart object of size 180 x 180 pixels with a blue background // (0x9c9cce) dim c as new CDXYChartMBS(180, 180, &h9c9cce) // Add titles to the top and bottom of the chart using 7.5pt Arial font. The text // is white 0xffffff on a deep blue 0x31319C background. call c.addTitle(C.kTop, "STAR TECH INDEX 2003-01-28", "arial.ttf", 7.5, &Hffffff, &H31319c) call c.addTitle(c.kBottom, "LATEST STI:1809.41 (+14.51)", "arial.ttf", 7.5, &hffffff, &H31319c) // Set the plotarea at (31, 21) and of size 145 x 124 pixels, with a pale yellow // (0xffffc8) background. call c.setPlotArea(31, 21, 145, 124, &hffffc8) // Add custom text at (176, 21) (top right corner of plotarea) using 11pt Times // Bold Italic font/red (0xc09090) color dim t as CDTextBoxMBS t=c.addText(176, 21, "Chart Demo", "timesbi.ttf", 11, &hc09090) t.setAlignment(c.kTopRight) // Use 7.5 pts Arial as the y axis label font call c.yAxis.setLabelStyle("", 7.5) // Set the labels on the x axis by spreading the labels evenly between the first // point (index = 0) and the last point (index = noOfPoints - 1) c.xAxis().setLinearScale(0, noOfPoints - 1, labels) // Use 7.5 pts Arial as the x axis label font call c.xAxis.setLabelStyle("", 7.5) // Add a deep blue (0x000080) line layer to the chart call c.addLineLayer(data, &h000080) // 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.


The biggest plugin in space...