用下面代码的时候会出现这样的错误
"index give is out of bounds"
最后只能添加4个
但是在显示的时候它还会给我显示八个
只是后面的四个显示的分别是 "C1 C2 C3 C4"
是我哪里需要设置一下吗?
m_Chart.SetShowLegend(TRUE);
m_Chart.SetColumn(1);
m_Chart.SetColumnLabel((LPCTSTR)"1号电池");
m_Chart.SetColumn(2);
m_Chart.SetColumnLabel((LPCTSTR)"2号");
m_Chart.SetColumn(3);
m_Chart.SetColumnLabel((LPCTSTR)"3号");
m_Chart.SetColumn(4);
m_Chart.SetColumnLabel((LPCTSTR)"4号");
m_Chart.SetColumn(5);
m_Chart.SetColumnLabel((LPCTSTR)"5号");
m_Chart.SetColumn(6);
m_Chart.SetColumnLabel((LPCTSTR)"6号");
m_Chart.SetColumn(7);
m_Chart.SetColumnLabel((LPCTSTR)"7号");
m_Chart.SetColumn(8);
m_Chart.SetColumnLabel((LPCTSTR)"8号");
"index give is out of bounds"
最后只能添加4个
但是在显示的时候它还会给我显示八个
只是后面的四个显示的分别是 "C1 C2 C3 C4"
是我哪里需要设置一下吗?
m_Chart.SetShowLegend(TRUE);
m_Chart.SetColumn(1);
m_Chart.SetColumnLabel((LPCTSTR)"1号电池");
m_Chart.SetColumn(2);
m_Chart.SetColumnLabel((LPCTSTR)"2号");
m_Chart.SetColumn(3);
m_Chart.SetColumnLabel((LPCTSTR)"3号");
m_Chart.SetColumn(4);
m_Chart.SetColumnLabel((LPCTSTR)"4号");
m_Chart.SetColumn(5);
m_Chart.SetColumnLabel((LPCTSTR)"5号");
m_Chart.SetColumn(6);
m_Chart.SetColumnLabel((LPCTSTR)"6号");
m_Chart.SetColumn(7);
m_Chart.SetColumnLabel((LPCTSTR)"7号");
m_Chart.SetColumn(8);
m_Chart.SetColumnLabel((LPCTSTR)"8号");
我在m_Chart.SetShowLegend(TRUE);
之前就设置
m_Chart.SetColumnCount(8);
就没这问题了
但是如果设置低于四个
m_Chart.SetColumnCount()函数就不需要
提前设置
不知道什么原因?