Example Code

Pie Chart using LabVIEW picture control

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This example generates a pie chart with legend using the LabVIEW picture control.

 

Description 

This example generates a pie chart using the LabVIEW picture control.  Given an array of clusters containing a label and a value, a pie chart with legend is generated and displayed.

 

Pie Chart 2012.vi is the VI that actually creates the chart.  Create Chart 2012.vi is a test VI used to show what the chart looks like.

 

Requirements:

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Download the attached ZIP file and open the project file.
  2. Open Create Chart 2012.vi and specify the Labels and Values in Test Value cluster array.
  3. Run the VI and a pie chart with legend is generated and displayed.
  4. If you want to view how the pie chart is created, open the Pie Chart 2012.vi to show the details.  

 

Additional Information or References

 

Front Panel of Create Chart 2012.vi
1.PNG

 

VI Snippet of Pie Chart 2012.vi

2.png

 

 

**This document has been updated to meet the current required format for the NI Code Exchange.** 

Donovan

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
JLMommy
Member Member
Member
on

Awesome example - especially if you can't get the ActiveX controls to properly load for the other pie chart examples!  😃


Becky Linton
LabVIEW Champion
Certified LabVIEW Architect
Senior Systems Engineer, Konrad Technologies
GCentral
gfa
Member
Member
on

Congratulations,

a very nice example. It work fine and it is easy to merge inside other applications. Just a note: due to array that set slice colors, the maximum number of slices is limited to 10. But it is rather easy to workaround this problem...

Aht22
Member
Member
on

very nice example but i have some query i integrate it in my program but the chart legend is change our position sometime in very time or after  2 to 3  values update...
kindly help in this regards...