Forum > TAChart

Chart left axis labelled differently with latest trunk

(1/2) > >>

Wilko500:
After testing out the canvas memory leak with trunk I see a difference in how the chart left axis is labelled
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Lazarus version: 4.99Lazarus revision: main_4_99-2615-gcccedc5bf0Lazarus build date: 2025/09/21 22:14:23Lazarus was compiled for x86_64-darwinLazarus was compiled with FPC 3.3.1The code for this chart is all default values plus
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  //Set up Chart  Chart1.LeftAxis.Range.Min:=0;  Chart1.LeftAxis.Range.Max:=4200;  Chart1.LeftAxis.Range.UseMax:=True;  Chart1.LeftAxis.Range.UseMin:=True;  Chart1.LeftAxis.Grid.Color:=clTeal;  Chart1.LeftAxis.Minors.Axes[0].Grid.Color:=clTeal;  Chart1.LeftAxis.ZPosition:=0;  Chart1.LeftAxis.Visible:=True;   Chart1.BottomAxis.Range.Min:=GetChartDate(Now, '00:00:00');  Chart1.BottomAxis.Range.Max:=GetChartDate(IncDay(Now), '00:00:00');  Chart1.BottomAxis.Range.UseMin:=True;  Chart1.BottomAxis.Range.UseMax:=True;  Chart1.BottomAxis.Grid.Color:=clTeal;  Chart1.BottomAxis.Minors.Axes[0].Grid.Color:=clTeal;  Chart1.BottomAxis.Title.Caption:='Time on ' + FormatDateTime('dd mmm yyyy', Now);  Chart1.BottomAxis.ZPosition:=1;  Chart1.BottomAxis.Marks.Style:=smslabel;  Chart1.BottomAxis.Marks.Source:=ListChartSource1;   PopulateTimeLabels(Chart1.BottomAxis.Range, ListChartSource1);  Chart1.BackColor:=ClBlack;  Power.SeriesColor:=clYellow;  Chart1.Margins.Left:=0;  Chart1.Margins.Right:=0;  Chart1.Margins.Top:=0;  Chart1.Margins.Bottom:=1;   Power.LinePen.Width:=2;  Power.ZPosition:=2; The PopulateTimeLabels procedure draws the bottom axis only. 

wp:
Cannot reproduce the irregularly space labels. Using a chart, 500 px high, I set Chart.LeftAxis.Range.Max = 4200, .Min = 0, .UseMax = true, .UseMin = true - and I get evenly spaced label with steps 200. This is on Mac and on Windows. When I increase the Chart.LeftAxis.Intervals.MaxLength to 100 I get label steps of 500.

Are you sure that you did not make any changes to the chart while the memory leak was existing?

Wilko500:
I created a new project, added a single chart, make no changes to properties and what is displayed in the IDE is incorrect.  The left axis should run from -1 to 1.  Pic shows what I actually see.  The version info is
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---This version failsLazarus version: 4.99Lazarus revision: main_4_99-2615-gcccedc5bf0Lazarus build date: 2025/09/21 22:14:23Lazarus was compiled for x86_64-darwinLazarus was compiled with FPC 3.3.1If I load the same project into my earlier version the chart displays as it should
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---This version worksLazarus version: 4.3Lazarus revision: lazarus_4_2-40-g95f1de5805Lazarus build date: 2025/09/11 23:02:36Lazarus was compiled for x86_64-darwinLazarus was compiled with FPC 3.2.3My IDE was built with FpcUpDeluxe today selecting trunk for both FPC and Lazarus and created in an empty folder.  My latest build, 4.99 fails in the same manner with two other projects all of which work correctly with my 4.3 build (memory leaks excepted).
Perhaps I should try a new build? 

Wilko500:
Started again.  New FpcUpDeluxe build using FPC 3.3.1 Laz Trunk into new folder.
Create new project, add one chart,  set Chart.LeftAxis.Range.Max = 4200, .Min = 0, .UseMax = true, .UseMin = true in Object Inspector and incorrect labelling is repeated.
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Lazarus version: 4.99Lazarus revision: main_4_99-2615-gcccedc5bf0Lazarus build date: 2025/09/22 08:36:13Lazarus was compiled for x86_64-darwinLazarus was compiled with FPC 3.3.1 

wp:
I re-tested myself, and still cannot reproduce. To make sure that your issues are related to the memory leak fix:

* Open file (lazarus-dir)/lcl/interfaces/cocoa/cocoagdiobjects.pas in the IDE
* Find the implementation of constructor TCocaContext.Create(...)
* Comment out the line "FFont := DefaultFont" - this was the only change made to fix the memory leak
* Recompile your test application to see the effect of this change at runtime. If you want to see it at designtime, you must rebuild the IDE.
* Are the axis labels correct?

Navigation

[0] Message Index

[#] Next page

Go to full version