[ANSWERED] Can TChart be TGraphicControl instead of TCustomControl? lazarus / 55-TAChart ---------------------------------------------------------------------- CM630 · 2026-03-24 10:42 Recently I was struggling unsuccessfully with transparency of custom components. That is how I found out that there are TGraphicControl and TCustomControl. And now I wonder can TChart be TGraphicControl instead of TCustomControl? I tried to change   Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i TCustomChart = class(TGraphicControl)  to   Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i TCustomChart = class(CustomControl)in TATypes.pas but it does no build. If I am not wrong, if TChart is TGraphicControl, it can be placed on a TPanel and it will behave as a TCustomControl. ---------------------------------------------------------------------- wp · 2026-03-24 12:16 Quote from: CM630 on March 24, 2026, 11:42:42 amI tried to change   Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i TCustomChart = class(TGraphicControl)  to   Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i TCustomChart = class(CustomControl)in TATypes.pas but it does no build. You probably mean the reverse: change TCustomChart = class(TCustomControl) to TCustomChart = class(TGraphicControl) (and forget to type the "T" before "CustomControl")? Anyway, maybe very old Lazarus versions had TCustomChart as a descendant of TGraphicControl, but the oldest one that I am still having on disk (v1.4.4) already has is as TCustomControl. Basically, I think it should work as TGraphicControl, but you certainly will have difficulties with some ChartTools which require the chart to be focusable which is not possible with TGraphicControl. If you want parts of the chart to be transparent to the chart background you could experiment with the BGRADrawer which fully supports an alpha-channel. ---------------------------------------------------------------------- CM630 · 2026-03-24 13:51 Quote from: wp on March 24, 2026, 01:16:14 pmYou probably mean the reverse: change TCustomChart = class(TCustomControl) to TCustomChart = class(TGraphicControl) (and forget to type the "T" before "CustomControl")? Exactly. Quote from: wp on March 24, 2026, 01:16:14 pmBasically, I think it should work as TGraphicControl, but you certainly will have difficulties with some ChartTools which require the chart to be focusable which is not possible with TGraphicControl. Sounds like “TChart cannot be TGraphicControl”. Quote from: wp on March 24, 2026, 01:16:14 pmIf you want parts of the chart to be transparent to the chart background you could experiment with the BGRADrawer which fully supports an alpha-channel. Google finds BGRADrawer exactly once in the entire internet. But I do not expect to get so far that I will need transparency in an year or two, I was rather curious.