Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 21.4 ('ChatGPT')
Instant purchase and download via GumRoad!

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):

Download Icon 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 added DesktopChart and MobileChart classes to let you create charts and graphs in those additional platforms. (They work identically, so everything I say here about DesktopChart is true for MobileChart.)

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, its super is DesktopChart.)

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.