Jump to content

Yeray

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

2 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Yeray

    TChart bottom axis label issue

    The chart by default draws the labels for the first series in the chart. You could add the labels of the second series as "custom labels". Ie: Chart1.Draw; for i:=0 to Chart1.Series[1].Count-1 do Chart1.Axes.Bottom.Items.Add(Chart1.Axes.Bottom.Items.Count, Chart1.Series[1].Labels[i]); Chart1.Draw; You can use OnGetMarkText event to intercept the marks drawing and empty them according to any condition you define. In this example I've set the threshold to 7000 because I don't see any 0 value in your test project: procedure TForm2.FormCreate(Sender: TObject); begin Chart1.Series[0].OnGetMarkText:=SeriesGetMarkText; end; procedure TForm2.SeriesGetMarkText(Sender:TChartSeries; ValueIndex:Integer; var MarkText:String); const threshold = 7000; begin if Assigned(Sender) and (ValueIndex > -1) and (Sender.YValue[ValueIndex] < threshold) then MarkText := ''; end; Steema Software support forums are publicly readable but only writeable to customers with active commercial subscriptions. The contact form should work fine. If it doesn't, you can always write at "info at steema.com" or "sales at steema.com". --- Yeray Alonso Steema Software
  2. Yeray

    TChart in Delphi 10.0 vs Delphi 12.2

    Hello, The issue appears when all the gantt bars added have a label. If you add at least one gantt bar with an empty label this issue shouldn't appear. The problem is, when the all the points have a label, TChart assumes all of them are in different and regular Y positions and tries to calculate a step to skip some points and optimize the calculation of the labels to be drawn.
  3. I use to recommend adding a dummy series with ShowInLegend set to False. In this case this should do it: Chart1.Draw; Chart1.Axes.Left.Automatic:=False; Chart1.Axes.Right.Automatic:=False; with Chart1.AddSeries(TLineSeries) do begin ShowInLegend:=False; VertAxis:=aBothVertAxis; end;
×