TColorGridSeries
Posted: Fri Jan 07, 2005 9:02 pm
Hello, I am trying to use a color Grid series on a form and the behavior isnt what I expect or desire. It would seem that it is impossible to have negative X or Z values. I have a function which populates the chart with points starting at the point -11, -11 and ending at point 11, 11. After it is done, the chart displays the axes correctly, running from -11 to 11, but the data appears only in the region of the graph between 0 and 11 for each axis.
Here is the source for the function:
the values of the parameters are:
minPoint = -11,-11
maxPoint = 11,11
spacing = 0.1,0.1
numPoints = 221,221
void TfrmPlanningSystemImport::LoadChartSeriesFromTP(_SNCPointDouble &minPoint,
_SNCPointDouble &maxPoint,_SNCPointDouble &spacing,_SNCPointInt &numPoints,
vector<float> &Dose,double maxDose)
{/*
*/
double xPos=minPoint.x,yPos=minPoint.y;
int i,j,singleIndex=0;
// determine colors from normalized data
singleIndex=0;
Series1->Clear();
Series1->NumXValues = numPoints.x;
Series1->NumZValues = numPoints.y;
for(i=0;i<numPoints.y;i++)
{
for(j=0;j<numPoints.x;j++)
{
Series1->AddXYZ(xPos,Dose[singleIndex++]/maxDose,yPos);
xPos+=spacing.x;
}
yPos+=spacing.y;
xPos=minPoint.x;
}
}
Any assistance would be greatly appreciated. I cant seem to get this to work at all.
Henry Bragg
www.sunnuclear.com
Here is the source for the function:
the values of the parameters are:
minPoint = -11,-11
maxPoint = 11,11
spacing = 0.1,0.1
numPoints = 221,221
void TfrmPlanningSystemImport::LoadChartSeriesFromTP(_SNCPointDouble &minPoint,
_SNCPointDouble &maxPoint,_SNCPointDouble &spacing,_SNCPointInt &numPoints,
vector<float> &Dose,double maxDose)
{/*
*/
double xPos=minPoint.x,yPos=minPoint.y;
int i,j,singleIndex=0;
// determine colors from normalized data
singleIndex=0;
Series1->Clear();
Series1->NumXValues = numPoints.x;
Series1->NumZValues = numPoints.y;
for(i=0;i<numPoints.y;i++)
{
for(j=0;j<numPoints.x;j++)
{
Series1->AddXYZ(xPos,Dose[singleIndex++]/maxDose,yPos);
xPos+=spacing.x;
}
yPos+=spacing.y;
xPos=minPoint.x;
}
}
Any assistance would be greatly appreciated. I cant seem to get this to work at all.
Henry Bragg
www.sunnuclear.com