Creating Charts and Pie Graphs using Data with Holes | CodeGuru

Creating Charts and Pie Graphs using Data with Holes

Click here for larger image Environment: VC 6, SP 4, Windows 2000 Introduction In my work, I always want to display several data series with holes together. Massimo Colurcio has developed a control to display data with a hole, but it is not easy to use, especially when the data is very sparse, so I […]

Written By
CodeGuru Staff
CodeGuru Staff
May 8, 2002
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More





Click here for larger image

Environment: VC 6, SP 4, Windows 2000

Introduction

In my work, I always want to display several data series with holes together.
Massimo Colurcio
has developed a control to display data with a hole, but it is not easy to use, especially when the data is very sparse, so I decided to develop my own control based on his work. At the same time, I also want to show this data series in a pie chart fashion.

How to Use the Application

Follow these steps to set up and use the Chart and Pie project:


  1. Add the files in the source package to your project.
  2. Do initilization. See CChartView::OnInitialUpdate().
  3. Call Add of CDataChart to add datasets to the control.

Use the following code as shown below:

void Add(int nDatasetID, int nIndex, double nData);
SetStyle(STYLE_LINE)

to display a line chart, or


SetStyle(STYLE_PIE)

to display a pie chart.


And that’s all.

Downloads

Download demo project – 62 Kb

Download source – 17 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.