Creating Charts and Pie Graphs using Data with Holes



Click here for larger image



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


Comments

  • Debug Assertion Failed

    Posted by Legacy on 01/20/2003 12:00am

    Originally posted by: Allen.WeiHao

    When you resize the chart view to a comparable small size, the program corrupt.

    Reply
  • Detected memory leaks!

    Posted by Legacy on 05/11/2002 12:00am

    Originally posted by: Chile

    Detected memory leaks!
    Dumping objects ->
    F:\MyProject\VC\ChartnPie\DataChart.cpp(1433) : {267} normal block at 0x00347CD0, 28 bytes long.
    Data: < > 02 00 00 00 02 00 00 00 02 00 00 00 01 00 00 00
    Object dump complete.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Protecting business operations means shifting the priorities around availability from disaster recovery to business continuity. Enterprises are shifting their focus from recovery from a disaster to preventing the disaster in the first place. With this change in mindset, disaster recovery is no longer the first line of defense; the organizations with a smarter business continuity practice are less impacted when disasters strike. This SmartSelect will provide insight to help guide your enterprise toward better …

  • Live Event Date: August 14, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT Data protection has long been considered "overhead" by many organizations in the past, many chalking it up to an insurance policy or an extended warranty you may never use. The realities of today makes data protection a must-have, as we live in a data-driven society -- the digital assets we create, share, and collaborate with others on must be managed and protected for many purposes. Check out this upcoming eSeminar and join Seagate Cloud …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds