Recent

Author Topic: horizontal lines between stacked bars  (Read 465 times)

mtanner

  • Sr. Member
  • ****
  • Posts: 279
horizontal lines between stacked bars
« on: January 08, 2021, 11:03:18 am »
I have a stacked bar chart with 4 or 5 bars. Sometimes some of the bars represent very small values, and the horizontal boundary line between bars, black, is too prominent. Is there a way of either removing the horizontal boundary line, or making if the same as the fill color (while keeping the vertical boundary lines black)? I hope and suspect there is a way, but I can't find it among all the various options.

wp

  • Hero Member
  • *****
  • Posts: 8367
Re: horizontal lines between stacked bars
« Reply #1 on: January 08, 2021, 11:11:19 am »
There is a BarPen which defines how the border lines of the bars are drawn. You can give it the same or a similar color as the fill (BarBrush) to make is less prominent. However, the BarSeries does not distinguish between horizontal and vertical border -- they are drawn with the same pen.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

mtanner

  • Sr. Member
  • ****
  • Posts: 279
Re: horizontal lines between stacked bars
« Reply #2 on: January 08, 2021, 11:32:23 am »
Thanks, I think I will have to put up with the prominent boundary lines. Barpen seems to be associated with the TBarSeries, which is then subdivided by the TChartStyles, so it would not be possible to set a different barpen color for each of the componets of the TBarSeries. What I may try is to not have a boundary line (I assume I can set that somehow), and overlay another TBarSeries with bounadry line and transparent fill. I will post here to report how I get on.Let

wp

  • Hero Member
  • *****
  • Posts: 8367
Re: horizontal lines between stacked bars
« Reply #3 on: January 08, 2021, 11:47:17 am »
You mean that the horizontal lines between stacked bars as so thick? This could be a bug, it looks to me as if the lower hor line of the upper bar is drawn 1 pixel too high so that the upper line of the lower bar and the lower line of the upper bar are touching rather than being coincident (which might be a problem, though, when both bars have different border colors).

In the new trunk revision I just moved the upper bar end by 1 pixel. Looks better (see screenshot "stacked_barseries_new.png")
« Last Edit: January 08, 2021, 11:57:30 am by wp »
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

mtanner

  • Sr. Member
  • ****
  • Posts: 279
Re: horizontal lines between stacked bars
« Reply #4 on: January 08, 2021, 01:38:01 pm »
Thanks, I will take a look at that. Whenever I have to draw somw special shape in a TPaintBox I allways find that getting the fine detail to look good is difficult.

 

TinyPortal © 2005-2018