I attached an image which shows the incorrectly drawn screen capture (left one) and correctly drawn (right one): Here is the code that draws the contour:
Code: Select all
void TForm1::Draw()
{
double seriesDefaultValue = 0.0;
// Remove default/old entries from series
for (int i = 0; i < Series1->Count(); i++) {
Series1->Delete(i);
}
// Fill Series with StringGrid1 data
for (int rowIdx = 0; rowIdx < StringGrid1->RowCount; rowIdx++) {
for (int colIdx = 0; colIdx < StringGrid1->ColCount; colIdx++) {
Series1->AddXYZ(colIdx, verifyDouble(StringGrid1->Cells[colIdx][rowIdx], &seriesDefaultValue), rowIdx);
}
}
}
double TForm1::verifyDouble(UnicodeString input, double* defaultValue) {
if (input == "") {
return *defaultValue;
}
return input.ToDouble();
}