[Solved] Marks color in TaChart not consistents in Cocoa lazarus / 55-TAChart ---------------------------------------------------------------------- AL · 2020-03-09 23:11 I am using Toolset to show Data point labels in a tachart. This works fine in Windows. There is a little bug or mis-use on my side. Also I am runing this on a VM machine running Mojave, this might be the problem, I do not know. The first mark shown is the right color.  The second, third, et.  are black on white. The funny thing is that if you remove the first one then the second one turns of the right color!  It is like the color is applied only to the first point of the curve. If somebody with a real Mac could confirm this, that would be great. I have modified the demo project supplied with TaChart to demonstrate. A second problem: Also on this same form I have added a ttogglebox.  In windows it works fine and write its status in the label at the bottom of the form.  In Darwin it does not. ---------------------------------------------------------------------- nsl · 2020-03-10 13:15 Not sure what to expect for point colours. Screenshot included. I had to change the control alignments to alNone so that the tabs were not hidden by the chart. With a breakpoint on the TMainForm.ToggleBox1Change function this did not get called when the togglebox was clicked. An OnClick handler was also not called. Looks like could be a bug. ---------------------------------------------------------------------- AL · 2020-03-10 13:32 if you alt-click on a point it shows the marks.  The first is yellow as it should the others are white. Thanks for confirming the togglebox problem ---------------------------------------------------------------------- nsl · 2020-03-10 14:28 Yes, I can confirm that the marks are not drawn correctly. See screenshot. ---------------------------------------------------------------------- wp · 2020-03-10 14:44 It took me some time until I understood what the problem is. Here is a simpler demo. It just draws a random line series with data point labels. On Windows all the labels have a yellow background color - that's how it should be. On macOS only the left-most label is yellow, the others have a transparent background, the brush style seems to be bsClear. The demo also contains a checkbox to activate the background of the axis labels which are drawn by a similar routine. When this is active the series labels take the color of the y axis label background. And when the y axis is hidden (use the other checkbox) the series labels have the background color of the x axis labels! So, Cocoa draws the series marks with the previously used brush (the axes Marks.LabelBrush has Style bsClear by default) Smells like a bug in TAChart... [EDIT] I added debugging output to TAChart and found that the brush properties have values as expected. Smells like a bug in Cocoa now... ---------------------------------------------------------------------- wp · 2020-03-10 19:31 Cocoa seems to have an issue with polygons. TAChart paints the label background as a polygon, but when I replace it by a rectangle (Canvas.Rectangle) everything works fine. ---------------------------------------------------------------------- AL · 2020-03-18 21:18 I found a workaround way to the TtoggleBox bug. The onchange and onclick events do not work. But the OnmouseUp and OnMouseDown do work. The Property Checked is also updated. SO instead of using OnChange I use onMouseUp and verify the checked property or the cbstate property. ---------------------------------------------------------------------- trev · 2020-03-19 22:23 Please log a bug in the bug tracker so it can be fixed and add a link to this thread. ---------------------------------------------------------------------- AL · 2020-03-19 22:42 Done for ttoglebox:  0036812 I assume WP will take care of the TaChart color bug/problem. ---------------------------------------------------------------------- wp · 2020-03-19 23:08 Quote from: AL on March 19, 2020, 11:42:31 pmI assume WP will take care of the TaChart color bug/problem. Yes. But I am sure that this is not related to TAChart, but is a consequence of a deeper problem within the Cocoa widgetset, and I don't find a simple way to reproduce it outside TAChart... ---------------------------------------------------------------------- AL · 2020-03-23 13:33 Quote from: AL on March 19, 2020, 11:42:31 pmDone for ttoglebox:  0036812 The bug is reported as fixed in 62776 How do I easily get the revision without disturbing my setup. I have FPCupDeluxe installed. ---------------------------------------------------------------------- wp · 2020-03-23 15:58 Since you already have FPCUpdate, use it to install the current Laz- trunk to a different directory? This leaves your first installation alone. ---------------------------------------------------------------------- AL · 2020-03-23 18:36 I did not follow you advice.  Too bad for me!| I update my Darwin version of lazarus trunk only and kept my fpc 3.3.1. At least I have my Win10 Lazarus which is OK. Got the error: fpcupdeluxe: Start of compile error summary. Error: (lazbuild) Broken dependency: IDEIntf 1.0->BuildIntf fpcupdeluxe: Start of compile error summary. fpcupdeluxe: ERROR: LazarusNativeInstaller (BuildModuleCustom: UserIDE): make returned error code #512 fpcupdeluxe: Done !! Any idea what can cause this? Edit:  Reverting to ver 2.1.0 give the same error! ---------------------------------------------------------------------- AL · 2020-04-15 02:47 Quote from: wp on March 20, 2020, 12:08:20 amQuote from: AL on March 19, 2020, 11:42:31 pmI assume WP will take care of the TaChart color bug/problem. Yes. But I am sure that this is not related to TAChart, but is a consequence of a deeper problem within the Cocoa widgetset, and I don't find a simple way to reproduce it outside TAChart... FYI To solve my problem I did the following in form create: {$ IFDEF DARWIN}    // windows version keep original color. Set the mark.frame to yellow Set the brush.color to None Set the brush.style to BSclear Set the mark.labelfont to white  (my chart background is black) This produce a  consistent label (mark) that does not change color. So it seems that only the brush color and/or background is affected by the problem. ---------------------------------------------------------------------- wp · 2020-08-09 13:11 Returning to this old thread I want to tell you that the root cause in the cocoa canvas has been fixed by Dmitry (r63702). According to my own tests, your issue should be fixed now. Please test yourself. ---------------------------------------------------------------------- AL · 2020-08-09 13:19 Will do thank you! ---------------------------------------------------------------------- AL · 2020-08-26 15:32 Tested with 63734.  Problem solved, All if fine. Thanks Dmitry and WP!