资源简介

vc++实现各种曲线类型显示的界面,曲线类型有:饼图、直方图、散点图、折线图等

资源截图

代码片段和文件信息

//Graph.cpp - Version 3.0 (Brian Convery May 2001)

#include “stdafx.h“
#include “afxtempl.h“
#include “GraphSeries.h“
#include “GraphLegend.h“
#include “math.h“
#include “Graph.h“
#include “GraphDataColor.h“
#include “GraphPieLabel.h“ //for pie labels

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CGraph

CGraph::CGraph()
{
graphSeries = new CObList();
seriesSize = 0;
minTick = 0;
maxTick = 100;
numTicks = 10;
tickSpace = 10;

graphHasLegend = FALSE;
legendWidth = 0;
legendMaxText= 0;
graphAlignment = VERTICAL_ALIGN;  

graphType = 0;

xAxisAlign = 0;  //horizontal
xAxisLabelLength = 0;

xTickFontSize = 12;
yTickFontSize = 12;
legendFontSize = 12;

depth = 0;
depthRatio = 0.05;

line3DXbase = 0;
line3DYbase = 0;

SetGridLines(FALSE);

graphQuadType = 1;
quadSetManually = FALSE;
}

CGraph::CGraph(int type)
{
graphSeries = new CObList();
colorList = new CObList();
seriesSize = 0;
minTick = 0;
maxTick = 100;
numTicks = 10;
tickSpace = 10;

graphHasLegend = FALSE;
legendWidth = 0;
legendMaxText= 0;
graphAlignment = VERTICAL_ALIGN;  

graphType = type;

xAxisAlign = 0;  //in degrees == horizontal
xAxisLabelLength = 0;

xTickFontSize = 12;
yTickFontSize = 12;
legendFontSize = 12;

depth = 0;
depthRatio = 0.05;

line3DXbase = 0;
line3DYbase = 0;

SetGridLines(FALSE);

graphQuadType = 1;
if(type != BAR_GRAPH)
quadSetManually = TRUE;
else
quadSetManually = FALSE;
}

CGraph::~CGraph()
{
POSITION pos;
CGraphSeries* pSeries;

for( pos = graphSeries->GetHeadPosition(); pos != NULL; )
{
pSeries = (CGraphSeries*) graphSeries->GetNext( pos );
graphSeries->RemoveAt(pos);
delete pSeries;
}

graphSeries->RemoveAll();
delete graphSeries;

CGraphDataColor* dataColor;
for( pos = colorList->GetHeadPosition(); pos != NULL; )
{
dataColor = (CGraphDataColor*) colorList->GetNext( pos );
colorList->RemoveAt(pos);
delete dataColor;
}

colorList->RemoveAll();
delete colorList;

}


BEGIN_MESSAGE_MAP(CGraph CStatic)
//{{AFX_MSG_MAP(CGraph)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGraph message handlers

void CGraph::SetGraphType(int gType)
{
graphType = gType;
}

void CGraph::SetXAxisAlignment(int alignValue)
{
xAxisAlign = alignValue;
}

int CGraph::GetXAxisAlignment()
{
return xAxisAlign;
}

void CGraph::SetColor(int dataGroup COLORREF groupColor)
{
CGraphDataColor *dataColor = new CGraphDataColor(dataGroup groupColor);
colorList->AddTail(dataColor);
}

COLORREF CGraph::GetColor(int dataGroup)
{
POSITION pos;
if((colorList->GetCount() <= dataGroup) || (colorL

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     509089  2001-07-23 15:55  graphBrian_demo\Graph.chm

     文件     295055  2001-07-26 11:25  graphBrian_demo\Graph.cpp

     文件       6451  2001-07-25 14:26  graphBrian_demo\Graph.h

     文件        970  2001-07-24 09:15  graphBrian_demo\GraphDataColor.cpp

     文件       1416  2001-06-11 11:25  graphBrian_demo\GraphDataColor.h

     文件       1016  2001-07-24 09:23  graphBrian_demo\GraphDataSet.cpp

     文件       1376  2001-05-15 11:46  graphBrian_demo\GraphDataSet.h

     文件       3519  2001-05-15 16:10  graphBrian_demo\GraphDlg.cpp

     文件       1255  1999-10-01 16:52  graphBrian_demo\GraphDlg.h

     文件       2376  2001-07-26 10:34  graphBrian_demo\GraphLegend.cpp

     文件       1489  2001-06-19 10:39  graphBrian_demo\GraphLegend.h

     文件        931  2001-07-24 09:23  graphBrian_demo\GraphLegendSet.cpp

     文件       1452  2001-05-15 13:14  graphBrian_demo\GraphLegendSet.h

     文件       1267  2001-07-24 09:19  graphBrian_demo\GraphPieLabel.cpp

     文件       1837  2001-05-25 10:38  graphBrian_demo\GraphPieLabel.h

     文件       2174  2001-07-26 10:33  graphBrian_demo\GraphSeries.cpp

     文件       1596  2001-05-22 11:48  graphBrian_demo\GraphSeries.h

     文件       1205  1999-09-24 12:01  graphBrian_demo\GraphSettingsDlg.cpp

     文件       1247  1999-09-24 11:56  graphBrian_demo\GraphSettingsDlg.h

     文件       2371  2001-06-18 10:45  graphBrian_demo\MainFrm.cpp

     文件       1440  2001-06-18 10:45  graphBrian_demo\MainFrm.h

     文件       4359  1999-09-22 16:19  graphBrian_demo\ReadMe.txt

     文件      99500  2007-09-13 17:32  graphBrian_demo\Release\testdraw.res

     文件    5699780  2007-07-18 09:27  graphBrian_demo\Release\testdraw.pch

     文件      66560  2007-10-04 22:05  graphBrian_demo\Release\vc60.idb

     文件        804  2007-07-18 09:27  graphBrian_demo\Release\StdAfx.obj

     文件      44998  2007-07-18 09:27  graphBrian_demo\Release\testdrawView.obj

     文件       9307  2007-07-18 09:27  graphBrian_demo\Release\testdrawDoc.obj

     文件      16134  2007-07-18 09:27  graphBrian_demo\Release\testdraw.obj

     文件      12822  2007-07-18 09:27  graphBrian_demo\Release\MainFrm.obj

............此处省略42个文件信息

评论

共有 条评论