View Issue Details

IDProjectCategoryView StatusLast Update
0037273LazarusTAChartpublic2020-06-28 23:31
Reporterdonovaly Assigned Towp  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
PlatformWindows 64bitOSWindows 
Product Version2.0.8 
Summary0037273: 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.)
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

donovaly

2020-06-27 03:35

reporter  

wp

2020-06-27 13:00

developer   ~0123615

Last edited: 2020-06-27 15:56

View 3 revisions

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.

donovaly

2020-06-28 20:22

reporter   ~0123656

many thanks!

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).

wp

2020-06-28 22:07

developer   ~0123657

Last edited: 2020-06-28 22:07

View 2 revisions

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.

donovaly

2020-06-28 23:31

reporter   ~0123660

> 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.

Issue History

Date Modified Username Field Change
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