TeeChart:轴和系列间距

TeeChart: axis and series spacing

我正在使用 C++Builder 10.2(东京)通过 TeeChart 创建面积图。然而,创建图表不是问题。我要解决的问题是

  1. 我似乎找不到阻止底轴递增的方法。通过这个,我的意思是我有我想要绘制的确切日期,而不是日期范围。例如,点 1 可能是 04/01/2017,点 2 可能是 06/01/2017,但 TeeChart 会自动为 05/01/2017 创建一个点——这是我不想要的。此外,它不会为 06/01/2017 放置标签。

  2. 有没有办法在area系列之间加空space?

I cannot seem to find a way to stop the bottom axis from incrementing. By this, I mean that I have EXACT dates that I want to plot, not a range of dates. For example, point 1 might be 04/01/2017 and point 2 might be 06/01/2017, but the TeeChart automatically creates a point for 05/01/2017 - which I don't want. Also, it doesn't place a label for 06/01/2017.

您可以尝试将底轴 LabelStyle 设置为 talPointValue:

  Chart1->Axes->Bottom->LabelStyle = talPointValue;

Is there a way to add empty space between the area series?

您可以在两个系列之间添加一个虚拟(空)TAreaSeries,以在深度轴上创建分隔。即,在 Delphi:

procedure TForm1.FormCreate(Sender: TObject);
var i, j, n: Integer;
    tmpSeries: TChartSeries;
begin
  for i:=0 to 4 do
    with Chart1.AddSeries(TAreaSeries) do
    begin
      Title:='Series' + IntToStr(i+1);
      FillSampleValues;
    end;

  n:=Chart1.SeriesCount-1;
  j:=1;
  for i:=0 to n-1 do
  begin
    tmpSeries:=Chart1.AddSeries(TAreaSeries);
    tmpSeries.ShowInLegend:=False;

    while Chart1.SeriesList.IndexOf(tmpSeries) > j do
      Chart1.SeriesUp(tmpSeries);

    Inc(j, 2);
  end;
end;