Recent

Author Topic: Area Series settings  (Read 868 times)

kapibara

  • Hero Member
  • *****
  • Posts: 649
Area Series settings
« on: April 06, 2025, 12:22:23 pm »
Is it possible to show the Area Series without the black border around?
Lazarus trunk / fpc 3.2.2 / Kubuntu 24.04 - 64 bit

wp

  • Hero Member
  • *****
  • Posts: 12867
Re: Area Series settings
« Reply #1 on: April 06, 2025, 12:51:13 pm »
Code: Pascal  [Select][+][-]
  1. Chart1AreaSeries1.AreaContourPen.Style := psClear;   // outer border
  2. // Maybe also
  3. Chart1AreaSeries1.AreaLinesPen.Style := psClear;  // vertical drop lines
  4.  

kapibara

  • Hero Member
  • *****
  • Posts: 649
Re: Area Series settings
« Reply #2 on: April 06, 2025, 04:34:48 pm »
Thanks for tip. But did you try it? The contour border stays black and same thickness even after changing settings. Removing ChartStyles helped.

I'm on both fpc trunk and laz trunk now.
Lazarus trunk / fpc 3.2.2 / Kubuntu 24.04 - 64 bit

wp

  • Hero Member
  • *****
  • Posts: 12867
Re: Area Series settings
« Reply #3 on: April 06, 2025, 06:50:15 pm »
You did not say that you had a multi-valued series requiring Styles. In this case, the Styles take over the formatting of each sub-series. You must set the Pen.Style of each style item to psClear. This leaves you with the dropdown lines which are not controlled by the Styles, but you can simply set the AreaSeries.AreaLinePen.Style to psClear which handles all sub-series.

kapibara

  • Hero Member
  • *****
  • Posts: 649
Re: Area Series settings
« Reply #4 on: April 09, 2025, 09:47:05 am »
Project is the area series demo from lazarus trunk. (forgot to say) But with Styles enabled, the black outline border doesnt go away whatever setting i try. Only removing Styles does the trick.

Attached a demo,  I dont think i missed anything. Just make sure Styles is selected
« Last Edit: April 09, 2025, 11:01:43 am by kapibara »
Lazarus trunk / fpc 3.2.2 / Kubuntu 24.04 - 64 bit

paweld

  • Hero Member
  • *****
  • Posts: 1420
Re: Area Series settings
« Reply #5 on: April 09, 2025, 10:47:04 am »
Change UpdateStyles procedure in frmGeneral unit to:
Code: Pascal  [Select][+][-]
  1. procedure TGeneralFrame.UpdateStyles(Count: Integer);
  2. const
  3.   COLORS: array[0..4] of TColor = (clRed, clBlue, clYellow, clGreen, clFuchsia);
  4. var
  5.   i: Integer;
  6. begin
  7.   ChartStyles.Styles.Clear;
  8.   for i := 1 to Count do
  9.     with ChartStyles.Add do begin
  10.       Brush.Color := COLORS[i-1];
  11.       Pen.Width := 3;
  12.       Pen.Style := psClear;
  13.       Text := 'Curve ' + IntToStr(i);
  14.     end;
  15. end;
Best regards / Pozdrawiam
paweld

kapibara

  • Hero Member
  • *****
  • Posts: 649
Re: Area Series settings
« Reply #6 on: April 09, 2025, 11:01:00 am »
That works! Thanks.
Lazarus trunk / fpc 3.2.2 / Kubuntu 24.04 - 64 bit

 

TinyPortal © 2005-2018