您的位置:首页 > 其它

用CMSChart绘制XY轴曲线图坐标

2008-03-03 10:39 155 查看
觉得这个控件好复杂呢

void VIEWRESULT::DrawPicInitial() //这个函数用于重画新的图形的坐标范围

 VARIANT var;
 m_Chart.SetRowCount(limitshow);////一屏显示limitshow个数据,可设定并修改
 m_Chart.SetTitleText(m_chart_title); // 设置表名字
 m_Chart.SetColumnCount(1); //设置曲线条数 
 //设置X轴
 m_Chart.GetPlot().GetAxis(0,var).GetAxisTitle().SetText(m_chart_Hzuobiao);//X轴名称
 m_Chart.GetPlot().GetAxis(0,var).GetCategoryScale().SetAuto(false); // 不自动标注X轴刻度
 m_Chart.GetPlot().GetAxis(0,var).GetCategoryScale().SetDivisionsPerLabel(limitshow/10);// 一共10个标注
 m_Chart.GetPlot().GetAxis(0,var).GetCategoryScale().SetDivisionsPerTick(limitshow/20); // 20个刻度标线
 //设置Y轴
 m_Chart.GetPlot().GetAxis(1,var).GetAxisTitle().SetText(m_chart_Zzuobiao); // Y轴名称
 m_Chart.GetPlot().GetAxis(1,var).GetAxisTitle().GetTextLayout().SetOrientation(0);//Y轴名称排列方式
 m_Chart.GetPlot().GetAxis(1,var).GetValueScale().SetAuto(false); // 不自动标注Y轴刻度
 m_Chart.GetPlot().GetAxis(1,var).GetValueScale().SetMaximum(900);//Y轴最大刻度
 m_Chart.GetPlot().GetAxis(1,var).GetValueScale().SetMinimum(-900);//Y轴最小刻度
 m_Chart.GetPlot().GetAxis(1,var).GetValueScale().SetMajorDivision(10); // Y轴刻度10等分
// m_Chart.GetPlot().GetAxis(1,var).GetValueScale().SetMinorDivision(200); // 每刻度一个刻度线 
    m_Chart.Refresh();
 return; 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  图形