Site icon Learn C++

Learn How To Draw Charts With Simple TeeChart (TChart) Examples in C++

Learn How To Draw Charts With Simple TeeChart TChart Examples in C++

The RAD Studio, C++ Builder 11 and C++ Builder CE Community Editions have a lot of amazing visual and nonvisual components that you can use in your modern applications for Windows and mobile. One of these is the free chart component for the VCL and FMX frameworks called TeeChart (TChart). TChart comes with RAD Studio including RAD Studio 10.x,11.x and the CE versions.

How To Install and Use TeeChart (TChart) in C++ Builder CE?

When you install RAD Studio on the second page of the “platforms” choices are some optional modules and components. One of those is “TeeChart Standard”. This is the free version of TChart which you can use in your applications.

If you want more detailed professional charts in your applications, there is also TeeChart Pro by Steema. The TeeChart Pro charting component library offers hundreds of Graph styles in 2D and 3D for data visualization, 56 mathematical, statistical, and financial functions for you to choose from together with an unlimited number of axes and 30 Palette components. Please visit their official Steema web page for more details.

How To Develop Apps With TeeChart (TChart) in C++?

If you installed TChart in C++ Builder, you can use this component in your VCL or FMX applications. To do this:

C++ Builder 11 CE Form Design with TChart component

Now you can modify its default settings and you can add your custom charts, Pie, Bars, y=f(x) series, etc.

How To Draw y = f(x) Series With TeeChart (TChart) in C++?

[crayon-6762e2f01d3aa038195249/]

How To Draw Bar Series With TeeChart (TChart) in C++?

If you want you can add a new Bar Chart,

[crayon-6762e2f01d3b4752738254/]

that’s all! Now you can press F9 to run you application.

Is There A Full Example of how to use TeeChart (TChart) in C++?

Here is a full example that has Two TCharts (Chart1, Chart2), first chart has Series1 which is y=fx series, the second chart has Series2 has bar series, and there are two buttons (Button1, Button2), if you click both of them, you can modify your code like we show below.

[crayon-6762e2f01d3b6065140894/]

Here is a simple example of our design and its outputs when we click Button1 and Button2,

Note that, you can create a for loop for a specific function, or you can read data and set them here as above too. You can also visually bind database tables directly into teecharts, you don’t need to code as above.

C++ Builder is the easiest and fastest C and C++ IDE for building simple or professional applications on the Windows, MacOS, iOS & Android operating systems. It is also easy for beginners to learn with its wide range of samples, tutorials, help files, and LSP support for code. RAD Studio’s C++ Builder version comes with the award-winning VCL framework for high-performance native Windows apps and the powerful FireMonkey (FMX) framework for cross-platform UIs.

There is a free C++ Builder Community Edition for students, beginners, and startups; it can be downloaded from here. For professional developers, there are Professional, Architect, or Enterprise version.

Exit mobile version