Platforms to show: All Mac Windows Linux Cross-Platform
/ChartDirector/threedpieshading
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/threedpieshading
This example is the version from Sun, 17th Mar 2012.
Project "threedpieshading.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
createChart(0, "threedpieshading0")
createChart(1, "threedpieshading1")
createChart(2, "threedpieshading2")
createChart(3, "threedpieshading3")
createChart(4, "threedpieshading4")
createChart(5, "threedpieshading5")
createChart(6, "threedpieshading6")
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 the center of the pie at (100, 100) and the radius to 80 pixels
c.setPieSize(100, 100, 80)
// 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)
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.