Hello Rajiv,
Thanks for your answer.
I have tested the example. At a first glance (with their randomly generated graph), it seems to work correctly without the default for the first bar. But I have opened this project and I have replaced their random function by a simple i*i function. And then the problem appears, the same as I am having in my program. I show you a screen shot of NI example with my little modification on the attached bmp. The corresponding code is:
void CHistogramDlg::OnGenerateData()
{
CNiReal64Vector data(1000), axis(20);
CNiIntVector histogram(20);
for(int i=0; i<1000; i++)
{
double x = (double)rand() / RAND_MAX;
data[i] = i*i; //This line has been changed ((double)rand() / RAND_MAX) * (((double)rand() / RAND_MAX) * 10 - 5);
}
// create histogram
double min, max;
unsigned int minIndex, maxIndex;
data.MinMax(min, minIndex, max, maxIndex);
CNiMath::Histogram(data, min, max, 20, histogram, axis);
//Plot Data and Histogram
m_data.PlotY(data);
m_histogram.PlotXvsY(axis, histogram);
}
Concerning your advice of workaround, I don't really understand what you mean. I don't understand what is this value on the top right of the bar you are talking about... I will try to understand but if you have a few minutes to explain me better I would be pleased of it.
Thanks for your help,
ALia