Platforms to show: All Mac Windows Linux Cross-Platform

/ChartDirector/pieshading


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

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

Project "pieshading.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open() createChart(0, "pieshading0") createChart(1, "pieshading1") createChart(2, "pieshading2") createChart(3, "pieshading3") createChart(4, "pieshading4") createChart(5, "pieshading5") End EventHandler
Protected Sub CreateChart(img as integer, filename as string) dim w as new PicWindow w.Title=filename // The data for the pie chart dim data(-1) as double = array(18.0, 30, 20, 15) // The colors to use for the sectors dim colors(-1) as integer colors.Append &h66aaee colors.Append &heebb22 colors.Append &hbbbbbb colors.Append &h8844ff // Create a PieChart object of size 200 x 220 pixels. Use a vertical gradient // color from blue (0000cc) to deep blue (000044) as background. Use rounded // corners of 16 pixels radius. dim c as new CDPieChartMBS(200, 220) c.setBackground(c.linearGradientColor(0, 0, 0, c.getHeight, &h0000cc, &h000044)) c.setRoundedFrame(&hffffff, 16) // Set the center of the pie at (100, 120) and the radius to 80 pixels c.setPieSize(100, 120, 80) // Set the pie data c.setData(data) // Set the sector colors c.setColors(c.kDataColor, colors) // Demonstrates various shading modes Select case img case 0 call c.addTitle("Default Shading", "bold", 12, &hffffff) case 1 call c.addTitle("Local Gradient", "bold", 12, &hffffff) c.setSectorStyle(c.kLocalGradientShading) case 2 call c.addTitle("Global Gradient", "bold", 12, &hffffff) c.setSectorStyle(c.kGlobalGradientShading) case 3 call c.addTitle("Concave Shading", "bold", 12, &hffffff) c.setSectorStyle(c.kConcaveShading) case 4 call c.addTitle("Rounded Edge", "bold", 12, &hffffff) c.setSectorStyle(c.kRoundedEdgeShading) case 5 call c.addTitle("Radial Gradient", "bold", 12, &hffffff) c.setSectorStyle(c.kRadialShading) end Select // Disable the sector labels by setting the color to Transparent call c.setLabelStyle("", 8, c.kTransparent) // Output the chart w.Backdrop=c.makeChartPicture w.top=50+220*(img\3) w.left=220*(img mod 3) w.show End Sub
End Class
Class PicWindow Inherits Window
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...