资源简介
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个文件信息
相关资源
- 用VC++实现打开并显示bmp图片
- 多人对战连连看游戏VC++源码
- VC++实现记事本的各种功能
- Microsoft Visual C++ Build Tools 2017
- 简易PC虚拟串口示波器VC++整个工程源
- vc++MFC画彩色五角星
- VC++ Bresenham Midpoint 算法画线圆椭圆
- vc6.0的MFC实现简单的俄罗斯方块小游戏
- 电力行业规约645通信的VC++实现源码
- 记事本自动保存 小程序 vc++ 时间间
- vc++使用libcurl文件,支持断点续传,支
- 自绘按钮的实现,对VC++6.0控件派生学
- vc++收发电子邮件系统
- VC++ 球体 Phong光照模型
- VC6.0--计算器
- 用c++写的曲线拟合程序
- 哈夫曼编码vc++6.0
- VC++6.0 MFC使用ODBC链接MySQL把图片写入
- 家庭财务管理系统85895
- vc++ 动态创建故障树
- 数字水印的(LSB算法)嵌入和提取V
- VC++6.0字符串小游戏扫雷
- VC++ 数字图像处理典型算法及实现 源
- Visual+C++与SQL+Server开发仓库管理系统
- Hermite,Bezier,三次B样条曲线的MFC实现
- 入侵检测系统源码VC++
- 跌倒检测-OPENCV-VC++
- 使用qwtPlot3D实现三维曲线、轨迹绘制
- 用vc++6.0mfc对话框做的钟表
- 工业组态软件VC++简单实现
评论
共有 条评论