View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0037273||Lazarus||TAChart||public||2020-06-27 03:35||2020-06-28 23:31|
|Status||resolved||Resolution||no change required|
|Summary||0037273: TDataPointCrosshairTool ignores color|
|Description||- add to a chart a toolset and in this toolset add a TDataPointCrosshairTool |
- set the property to CrosshairPen.Color:= clRed
result: the crosshair is still black. I attached a screenshot of the definition in the IDE and the resulting crosshair.
(I need a chart with black background and therefore the crosshair is not visible.)
|Tags||No tags attached.|
|Fixed in Revision|
Read the documentation: https://wiki.lazarus.freepascal.org/TAChart_documentation#Drawing_mode. Set DrawingMode to tdmNormal to activate CrosshairPen where you can set the color.
But in the other drawing mode, xor, the background color is always inverted. Therefore, I think that the crosshair cursor should always be visible (unless you have DrawinMode=tdmNormal and CrosshairPen.Color = clBlack on black background).
Please close the report.
However i read the docs and there I find:
"tdmDefault -- use XOR method on widgetsets where it is known to work (Windows and Gtk) and full redraw on others."
And I had tdmDefault and I use the LCL under Windows. So why does tdmDefault not work? (I have CrosshairPen.Color = clWhite, and for the chart BackColor:= clGray).
In TAChart's XOR mode the color of the background is inverted at the places where the crosshair is drawn. The RGB value of clGray is $808080 which inverts to $7F7F7F which is almost the same shade- therefore, you don't see it. Make the BackColor a bit darker (or brighter) and you will see the cursor in the opposite shade of gray. The color of the crosshair cursor itself is ignored in XOR mode. (my "unless" statement in above note was not correct).
To give the crosshair a specific color, such as clRed that you mention in the introduction, you must set the DrawingMode to tdmNormal.
> The RGB value of clGray is $808080 which inverts to $7F7F7F which is almost the same shade- therefore, you don't see it
Thanks. I see now.
|2020-06-27 03:35||donovaly||New Issue|
|2020-06-27 03:35||donovaly||File Added: Crosshair-is-black-instead-red.png|
|2020-06-27 12:56||wp||Assigned To||=> wp|
|2020-06-27 12:56||wp||Status||new => assigned|
|2020-06-27 13:00||wp||Status||assigned => resolved|
|2020-06-27 13:00||wp||Resolution||open => no change required|
|2020-06-27 13:00||wp||LazTarget||=> -|
|2020-06-27 13:00||wp||Widgetset||Win32/Win64 => Win32/Win64|
|2020-06-27 13:00||wp||Note Added: 0123615|
|2020-06-27 13:16||wp||Note Edited: 0123615||View Revisions|
|2020-06-27 15:56||wp||Note Edited: 0123615||View Revisions|
|2020-06-28 20:22||donovaly||Note Added: 0123656|
|2020-06-28 22:07||wp||Note Added: 0123657|
|2020-06-28 22:07||wp||Note Edited: 0123657||View Revisions|
|2020-06-28 23:31||donovaly||Note Added: 0123660|