Article Preview
Buy Now
COLUMN
Charting Xojo
Using the New DesktopChart Class
Issue: 21.4 (July/August 2023)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 10,080
Starting Page Number: 54
Article Number: 21406
Resource File(s):
project21406.zip Updated: 2023-07-03 09:54:37
Related Link(s): None
Excerpt of article text...
While Xojo has had a
WebChart
class for web apps for a while, in Xojo 2023r1 they addedDesktopChart
andMobileChart
classes to let you create charts and graphs in those additional platforms. (They work identically, so everything I say here aboutDesktopChart
is true forMobileChart
.)
DesktopChart
lets you create a nice variety of charts: Bar, Bubble, Doughnut, Line, Pie, PolarArea, Radar, and Scatter.To use it, drag a
Chart
instance from the Library onto a window. (Once it's placed, you'll see in the Inspector that it's the proper type for your project. In this case, itssuper
isDesktopChart
.)With the object selected, in the
Inspector
you can choose the chart type you want (see Figure 1). You can also set the type via code.The way Xojo has chosen to implement adding data is interesting. You first have to populate an appropriate data class. There are three, depending on the type of chart you are creating:
ChartCircularDataset
: for circular charts, like pie, doughnut, polarArea, and radar.
...End of Excerpt. Please purchase the magazine to read the full article.