觉得这个控件好复杂呢
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;
}
最后
以上就是美好黑猫最近收集整理的关于用CMSChart绘制XY轴曲线图坐标的全部内容,更多相关用CMSChart绘制XY轴曲线图坐标内容请搜索靠谱客的其他文章。
发表评论 取消回复