Example: /ChartDirector/threeddonutshading

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/ChartDirector/threeddonutshading


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

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

Project "threeddonutshading.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open() createChart(0, "threeddonutshading0") createChart(1, "threeddonutshading1") createChart(2, "threeddonutshading2") createChart(3, "threeddonutshading3") createChart(4, "threeddonutshading4") createChart(5, "threeddonutshading5") createChart(6, "threeddonutshading6") createChart(7, "threeddonutshading7") 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 200 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, 200) c.setBackground(c.linearGradientColor(0, 0, 0, c.getHeight(), &h0000cc, &h000044)) c.setRoundedFrame(&hffffff, 16) // Set donut center at (100, 100), and outer/inner radii as 80/40 pixels c.setDonutSize(100, 100, 80, 40) // Set the pie data c.setData(data) // Set the sector colors c.setColors(c.kDataColor, colors) // Draw the pie in 3D with a pie thickness of 20 pixels c.set3D(20) // Demonstrates various shading modes select case img case 0 call c.addTitle("Default Shading", "bold", 12, &hffffff) case 1 call c.addTitle("Flat Gradient", "bold", 12, &hffffff) c.setSectorStyle(c.kFlatShading) case 2 call c.addTitle("Local Gradient", "bold", 12, &hffffff) c.setSectorStyle(c.kLocalGradientShading) case 3 call c.addTitle("Global Gradient", "bold", 12, &hffffff) c.setSectorStyle(c.kGlobalGradientShading) case 4 call c.addTitle("Concave Shading", "bold", 12, &hffffff) c.setSectorStyle(c.kConcaveShading) case 5 call c.addTitle("Rounded Edge", "bold", 12, &hffffff) c.setSectorStyle(c.kRoundedEdgeShading) case 6 call c.addTitle("Radial Gradient", "bold", 12, &hffffff) c.setSectorStyle(c.kRadialShading) case 7 call c.addTitle("Ring Shading", "bold", 12, &hffffff) c.setSectorStyle(c.kRingShading) 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\4) w.left=220*(img mod 4) 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.


💬 Ask a question or report a problem