backcolor subdivision lazarus / 55-TAChart ---------------------------------------------------------------------- frederic · 2016-03-22 20:57 dear specialists when one defines the backcolor of a chart the whole chart area is meant. i wondered ,if it is possible to subdivide the canvas of the chart in different backcolors colors  in stead of one color f.i.       0 "Add item"). Select the new axis, it is a y axis by default, but by setting "Alignment" to alBottom it becomes an x axis. Select both x axes, set their "Group" to any non-zero number (e.g. 1), this causes both x axes to be drawn on the same line. Select Marks of the new x axis, hide the labels by setting "Visible" = false. Set "Source" to the ListChartSource added above. Set "Stripes" to the TChartStyles. You need two stripes, the first one blue, the second one yellow. The first stripe reaches from "neg inifinity" up to the point defined in the list chource, the second one from this point up to "pos infinity". ---------------------------------------------------------------------- frederic · 2016-03-23 15:51 wp,  interesting ,that gives me a kick in the right direction never thought of using a separate listchartsource  for that . that gives indeed great flexibilty better than in delphi thanks ---------------------------------------------------------------------- frederic · 2016-03-24 10:51 wp i need to set the colors of the stripes by code . how do you do that? thanks for the hint ,in advance frederic ---------------------------------------------------------------------- wp · 2016-03-24 11:04 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   ChartStyles1.Styles[0].Brush.Color := Color1;  ChartStyles1.Styles[1].Brush.Color := Color2;  Chart1.Invalidate; ---------------------------------------------------------------------- frederic · 2016-03-31 08:48 little question when i want to delete an object from the chart i click on the icon on the chart and delete. when i do this with the chartstyles icon ,i get acces violation why is that? frederic ---------------------------------------------------------------------- wp · 2016-03-31 09:40 Seems to be a bug. Let me see... ---------------------------------------------------------------------- wp · 2016-03-31 10:03 Should be fixed in r52090. Please test and report back. If you don't use Lazarus trunk you can probably apply this temporary patch manually to older versions: Go to folder (lazarus)/components/tachartMake a backup copy of TAGraph.pasOpen TAGraph.pas in Lazarus or any other editorFind the "uses" line after "implementation", add "TAStyles"Find the procedure "TChart.Notification", replace it by the following code. Then rebuild the IDE.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 procedure TChart.Notification(AComponent: TComponent; AOperation: TOperation);var  ax: TChartAxis;begin  if (AOperation = opRemove) and (AComponent = Toolset) then    FToolset := nil  else if (AOperation = opRemove) and (AComponent = GUIConnector) then    GUIConnector := nil  else if (AOperation = opRemove) and (AComponent is TChartStyles) then begin  // <-- added from here ...    for ax in FAxisList do      if ax.Marks.Stripes = AComponent then        ax.Marks.Stripes := nil;  end;                                                                       // <-- ... to here   inherited Notification(AComponent, AOperation);end; ---------------------------------------------------------------------- frederic · 2016-03-31 11:20 i use now 1.6 svn 51630    2016-2-14; i will update my version first frederic ---------------------------------------------------------------------- frederic · 2016-03-31 12:41 i used the latest official lazarus release, i changed the code in the notification procedure and ran your project from above, i got an error that the class tastyles was missing before i even deleted it. i may have done something else wronge due to my unexperience , ( i never changed lazarus code before ,one bridge to far). so i leave  this item here frederic ---------------------------------------------------------------------- wp · 2016-03-31 15:36 Before you compile any chart project you MUST rebuild the IDE because you want to delete the ChartStyles in designmode, and the new code must be contained in the IDE. The easiest way to recompile Lazarus is to open the menu "Tools" and select "Build Lazarus with profile...". The compilation process takes some time, be patient. At the end Lazarus closes and restarts automatically with the new IDE. Then you can begin with a new project, add a TChart and TChartStyles, and link the ChartStyles to the Marks.Stripes of one of the axes. If you now delete the TChartStyles from the IDE it must not crash any more. If the compilation of Lazarus fails or the newly started Lazarus hangs you have a backup of the old lazarus.exe named as lazarus.old.exe - rename it to lazarus.exe and your can use the old Lazarus again. I tested the patching and recompilation procedure with a new installation of Laz 1.6 - it works, for sure. ---------------------------------------------------------------------- frederic · 2016-03-31 19:22 oke , wp ,  it works frederic ---------------------------------------------------------------------- wp · 2016-03-31 19:33 I put it onto the merge list for Lazarus 1.6.2. So, when the new version will be released and you update you will have the fix included.