jauchriw 0 Posted October 23 (edited) Hello, I've upgraded a Delphi 10.0 application, which displays a TChart, to Delphi 12.2. I did not have to change any code, the upgrade worked seamlessly except the chart. Strangely, the chart is missing the dotted line on one data line and also the label is missing. Delphi 10 (works as expected): Delphi 12.2: I've already played around with the options of the chart but I didn't manage to fix the issue. The bars are added with multiple calls to Series3.AddGanttColor(startDate, endDate, row, lbl, color); Does someone have an idea what I could try? I also tried Delphi 11.3 first, but there the chart looks like the one in Delphi 12.2. Edited October 23 by jauchriw Share this post Link to post
zed 14 Posted October 23 {$IF CompilerVersion > 34} // The default font changed from "Tahoma, 8 pt" to "Segoe UI, 9 pt" // starting with Delphi 11. This increased the text size by 2 pixels. Application.DefaultFont.Name := 'Tahoma'; Application.DefaultFont.Size := 8; {$ENDIF} Try this fix (insert code into your .dpr file). Share this post Link to post
jauchriw 0 Posted October 23 That does not seem to make any difference 😕 I also tried to change the font size of the axis (LeftAxis.LabelsFormat.Font.Height = -7) but the label is still missing Share this post Link to post
Gord P 14 Posted October 23 (edited) Was the chart dropped on the form at design time, or was it created at run time? If it was the former, I would be curious as to whether the issue exists if it gets created by code. I am guessing not, but don't know. I have had problems with TCharts that were placed at design time when moving from one version of Rad Studio to another because they use the old TChart files/headers and it screws things up. Edited October 23 by Gord P Share this post Link to post
Marc Meumann 3 Posted October 25 It may be a pixel rounding issue, some variation between versions, thus hiding the Label as it isn't deemed to have enough space. Test of concept would be to run: Chart1.Axes.Left.LabelsSeparation := 0; Share this post Link to post
jauchriw 0 Posted October 30 On 10/25/2024 at 5:15 PM, Marc Meumann said: It may be a pixel rounding issue, some variation between versions, thus hiding the Label as it isn't deemed to have enough space. Test of concept would be to run: Chart1.Axes.Left.LabelsSeparation := 0; That also makes no difference 😕 Share this post Link to post
jauchriw 0 Posted October 30 (edited) I've managed to reproduce the issue in a small demo application (I tried it with Delphi 12.2, but I assume the problem will also show in Delphi 11). As soon as the third "GanttColor" is added, the label "TEST B" disappears: With "Break labels" checkbox checked (just adds a third "GanttColor" to the series): In Delpi 10 both modes work as expected. I've attached the dfm and the pas file the the post 😊 Maybe someone has an idea, what is going on here Unit1.pas Unit1.dfm Edited October 31 by jauchriw Share this post Link to post
Marc Meumann 3 Posted October 31 The example code is useful. It looks, at first glance, like a a bug ...to be investigated. Temporary workaround could be to directly control the Axis Items list after adding the data: Chart2.Axes.Left.Items.Clear; Chart2.Axes.Left.Items.Add(9,seriesC); Chart2.Axes.Left.Items.Add(5,seriesA); Chart2.Axes.Left.Items.Add(8,seriesB); 2 Share this post Link to post
jauchriw 0 Posted October 31 3 hours ago, Marc Meumann said: Chart2.Axes.Left.Items.Clear; Chart2.Axes.Left.Items.Add(9,seriesC); Chart2.Axes.Left.Items.Add(5,seriesA); Chart2.Axes.Left.Items.Add(8,seriesB); Thank you, with this workaround the issue is gone! I assume that a version of TeeChart, where this issue is fixed, will be included in RAD studio 13 at earliest? Share this post Link to post
Marc Meumann 3 Posted November 5 " included in RAD studio 13 at earliest?" Hopefully we'll get there long before that, it shouldn't be too complicated to resolve. 1 Share this post Link to post