Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/ChartDirector/softlightbar
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/softlightbar
This example is the version from Sun, 17th Mar 2012.

Screenshot for this example project.

Project "softlightbar.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class PicWindow Inherits Window
EventHandler Sub Open() // The data for the bar chart dim data(-1) as double = array(450.0, 560, 630, 800, 1100, 1350, 1600, 1950, 2300, 2700) // The labels for the bar chart dim labels(-1) as string =array( "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005") // Create a XYChart object of size 600 x 360 pixels dim c as new CDXYChartMBS(600, 360) // Add a title to the chart using 18pts Times Bold Italic font call c.addTitle("Annual Revenue for Star Tech", "timesbi.ttf", 18) // Set the plotarea at (60, 40) and of size 500 x 280 pixels. Use a vertical // gradient color from light blue (eeeeff) to deep blue (0000cc) as background. // Set border and grid lines to white (ffffff). call c.setPlotArea(60, 40, 500, 280, c.linearGradientColor(60, 40, 60, 280, &heeeeff, &h0000cc), -1, &hffffff, &hfffff) // Add a multi-color bar chart layer using the supplied data. Use soft lighting // effect with light direction from left. dim b as CDBarLayerMBS dim colors(-1) as integer b=c.addBarLayer(data,colors) b.setBorderColor(c.kTransparent, c.softLighting(c.kLeft)) // Set x axis labels using the given labels call c.xAxis.setLabels(labels) // Draw the ticks between label positions (instead of at label positions) c.xAxis.setTickOffset(0.5) // Add a title to the y axis with 10pts Arial Bold font call c.yAxis.setTitle("USD (millions)", "arialbd.ttf", 10) // 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) 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 Xojo Plugins