I have two arrays, which are to be used as x-axis inputs on a chart using ChartDirector(http://www.advsofteng.com/product.html) in my C#/.NET Windows Forms application.
One of the arrays does not match up in length with the other, resulting in a haphazard display of the shorter array on the chart. I need to create a new array that takes the short one as an input and fill the remaining values as 0 equivalents (Chart.NoValue) here, so that the lengths of both arrays are equal.
Is there a way to do this without copying the short array into a new one and filling the remaining values with 0's, as follows:
double[] newArray = new double[longArray.Length];
for (int i = 0; i < shortArray.Length; i++)
{
newArray[i] = shortArray[i];
}
for (i = shortArray.Length; i < newArray.Length; i++)
{
newArray[i] = Chart.NoValue;
}
//Chart director equivalent of 0, in terms of chart visibility
Essentially, I'm asking if there is a way to just modify shortArray in such a way that new "0" elements are added at the end so that it's length equates to longArray.