can't handle barchart XValueText

i was made a Sample project with fnc chart.(trial)

but i found a one issue about XValueText when  my chart has 

only 1 count of X value. 

If fncchart(bar chart series) x value count is 1, the XValueText is

unconditionally marked as 0. 

how can i handled a XValueText when x values has one count?

Hi, 


Can you provide some sample code that demonstrates this so we can investigate exactly what is going wrong?
i used same function at Month/Year period chart.
monthly chart's XValueText is good.
when year chart's x value count is 1, XValueText shows '0' 
but my functions uses AddPoint(Xvalue, XValueText).

below the sample code

  LYmax := LDayList.result[0].Cnt * 1.1;
  for I := 0 to LDayList.Count - 1 do
  begin
    ChartStat.Series[idx].AddPoint(LDayList.result.Cnt, DateToStr(LDayList.result.Day) + LPeriodStr);
  end;

<Year Chart>
https://s3-ap-northeast-1.amazonaws.com/sdbirnd/year_chart.jpg

<Month Chart>
http://s3-ap-northeast-1.amazonaws.com/sdbirnd/month_chart.jpg

Please provide additional information such as sample code. It's unclear exactly what happens without the full source code.

okay, thank you Mr.Scheldeman.


it's my full function code.

  TYearStat = class(TObject)
    Cnt: Integer;
    Year: Integer;
  end;

  TResultList<T> = class
    result: array of T;
  private
    function GetCount: Integer;
  public
    property Count: Integer read GetCount;
  end;

procedure TMainForm.InitYearChartData(Sender: TObject; idx: Integer);
var
  I: Integer;
  LPeriodStr: string;
  LYearList: TResultList<TYearStat>;
begin
  ChartStat.BeginUpdate;
  ChartStat.Series[idx].Points.Clear;

  LPeriodStr := 'Year';
  LYearList := Sender as TResultList<TYearStat>;
  ChartStat.Series[idx].MaxX := LYearList.Count;

  if LYearLIst.COunt = 1 then
    ChartStat.Series[idx].AddPoint(0, (LYearList.result[0].Year - 1).ToString + LPeriodStr);

  for I := 0 to LYearList.Count - 1 do
  begin
    if idx = 0 then
      ChartStat.Series[idx].MaxY := LYearList.result.Cnt * 1.1;

    ChartStat.Series[idx].AddPoint(LYearList.result.Cnt, (LYearList.result.Year).ToString + LPeriodStr);
  end;

  ChartStat.Series[idx].MaxY := ChartStat.Series[0].MaxY;
  ChartStat.EndUpdate;
end;

Hi, 


Unfortunately we are not able to compile this code. How many times is the InitYearChartData function called and with which parameters? Please prepare a complete working sample and send it to support@tmssoftware.com

thank you, i'm sorry do not have enough explanation. I will send email.