Wrong Time value on X axis

Hello,

I'm trying to draw a curve on the AdvChartView Component, but I'm facing some issue.
The value of the Timedate in X Axis is wrong. Here is what I'm trying to do:

    AdvChartViewComponent->BeginUpdate();
    this->iRange = 0;
    //int rangeValues = 0;
    TChartSerie* serie = pane->Series->Add();
    serie->ClearPoints();
    serie->Name = ptCurveData->szName;
    serie->ChartType = ctLine;
    // utHour, utMinute, utSecond
    pane->XAxis->UnitType = utSecond;
    serie->YAxis->AutoUnits = true;
        int iCurveSize = ptCurveData->vctPointDataList.size();
    for ( int iListIndex = 0; iListIndex < iCurveSize; iListIndex++ )
    {
        TPointData * ptPointData = ptCurveData->vctPointDataList.at(iListIndex);

        try
        {
            double YValue = ptPointData->szYCoordinate.ToDouble();
            double Value = ptPointData->szXCoordinate.ToDouble();
            TDateTime XValue(Value);
            double dYValue = TConfValhal::get()->getFormattedTemp(YValue);
            serie->AddSinglePoint(XValue, dYValue);
            if ( iListIndex == 0 )
            {
                pane->Range->StartDate = XValue;
            }
        }
        catch (Exception & e)
        {
            // Log Error while converting tdateTime
        }
        this->iRange++;
    }

    serie->Marker->MarkerType = mCircle;
//    pane->Range->RangeFrom = 0;
//    pane->Range->RangeTo = this->iRange;
    serie->XAxis->MajorUnitTimeFormat = "dd/mm/yy hh:mm:ss";
    serie->XAxis->MinorUnitTimeFormat = "dd/mm/yy hh:mm:ss";
    pane->YAxis->Text = ptCurveData->szUnitY;

And Here is what I'm getting:



The Start Time is Correct, but for the other point the second just get incremented by "1" and they are not matching what's in vctPointDataList.

Can you please tell me what is wrong ?
Thanks

It looks like you are at least using the wrong overload of AddSinglePoint().

You need to use an overload where either you pass as first parameter the Y value and the 2nd parameter can be a string holding the formatted time value you want to see on the X-axis.

I already tried. But it didn't seems to works.

Drop a default TAdvChartView on the form and add the code:


begin
  advchartview1.BeginUpdate;
  advchartview1.Panes[0].Series.Clear;
  advchartview1.Panes[0].Series.Add;
  advchartview1.Panes[0].Series[0].ChartType := ctLine;
  advchartview1.Panes[0].Series[0].AddSinglePoint(15,'x');
  advchartview1.Panes[0].Series[0].AddSinglePoint(25,'y');
  advchartview1.Panes[0].Series[0].AddSinglePoint(35,'z');
  advchartview1.EndUpdate;
end;

and you see that the text you set for the X-axis ('X','Y','Z') is being displayed on the X-axis.