描述:
如何在XY坐标系的 图中画出数据值对应的点!比如,X轴和Y轴的范围都是200~1600,如何将一点
(234,564)对应到坐标系中。
解决方案1:
m_chart.SetChartType(16);
m_chart.SetTitleText("散点图分析");
m_chart.SetShowLegend(FALSE);
m_chart.SetStacking(FALSE);
VARIANT var;
m_chart.GetPlot().GetAxis(0, var).GetValueScale().SetAuto(FALSE);
m_chart.GetPlot().GetAxis(0, var).GetValueScale().SetMaximum(0);
m_chart.GetPlot().GetAxis(0, var).GetValueScale().SetMinimum(-100);
m_chart.GetPlot().GetAxis(0, var).GetValueScale().SetMajorDivision(20);
m_chart.GetPlot().GetAxis(0, var).GetValueScale().SetMinorDivision(1);
m_chart.GetPlot().GetAxis(0, var).GetAxisTitle().SetText("P-CCPCH RSCP");
m_chart.GetPlot().GetAxis(1, var).GetValueScale().SetAuto(FALSE);
m_chart.GetPlot().GetAxis(1, var).GetValueScale().SetMaximum(00);
m_chart.GetPlot().GetAxis(1, var).GetValueScale().SetMinimum(-100);
m_chart.GetPlot().GetAxis(1, var).GetValueScale().SetMajorDivision(20);
m_chart.GetPlot().GetAxis(1, var).GetValueScale().SetMinorDivision(1);
m_chart.GetPlot().GetAxis(1, var).GetAxisTitle().SetText("ISCP");
m_chart.SetColumnCount(2);
m_chart.GetPlot().GetSeriesCollection().GetItem(1).GetSeriesMarker().SetShow(TRUE);
m_chart.GetPlot().GetSeriesCollection().GetItem(2).GetSeriesMarker().SetShow(TRUE);
m_chart.GetPlot().GetSeriesCollection().GetItem(1).GetPen().SetStyle(0);
m_chart.GetPlot().GetSeriesCollection().GetItem(2).GetPen().SetStyle(0);
m_chart.GetPlot().GetSeriesCollection().GetItem(1).GetPen().GetVtColor().Set(0, 255, 0);
m_chart.GetPlot().GetSeriesCollection().GetItem(2).GetPen().GetVtColor().Set(0, 0, 255);
m_chart.GetPlot().GetSeriesCollection().GetItem(1).GetPen().SetWidth(10);
m_chart.GetPlot().GetSeriesCollection().GetItem(2).GetPen().SetWidth(10);
int nRowCount = 50;
m_chart.SetRowCount(nRowCount);
srand( (unsigned)time( NULL ) );
for(int row = 1; row <= nRowCount; ++row)
{
m_chart.SetRow(row);
m_chart.GetDataGrid().SetData(row, 1, 0 - rand() * 100 / RAND_MAX, 0);
m_chart.GetDataGrid().SetData(row, 2, 0 - rand() * 100 / RAND_MAX, 0);
}
m_chart.Refresh();
http://www.vckbase.com/document/viewdoc/?id=959