ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Problemen with touchbar/bargap
Posted by Maurice van der Zwaan on Mar-26-2014 22:48
I have a problem with an XYChart with transpararent bars.

If I set the bargap to 0, I sometime get white lines between the bars.

If I set the bargap to TouchBar I sometimes get overlapping bars (due to the transparency
this is visible as a dark line).

How could I solve this problem ?

  Re: Problemen with touchbar/bargap
Posted by Peter Kwan on Mar-27-2014 12:21
Hi Maurice,

As according to the ChartDirector documentation, TouchBar means the bars are touched so
that their borders overlap. (If the borders do not overlap, then it would appear there is a
doubly thick border between the two bars.)

If you are using semi-transaprent border colors, you can see that the shared border will be
painted twice with the two border colors of the two bars. Even if the two border colors are
the same, painting the border twice will result in the border being less transparent than if
the border is only painted once. This may appear as a darker border if you are using a
border color darker than the background color.

The setBarGap(0) means the bar gap will be as close to 0 as possible, subjected to the
constraint that all bars must be of equal width in pixels. If you have 10 bars, and the plot
area width is 185 pixels, it is not possible for the bars to be of equal width and will zero
gaps at the same time. In this case, the bars will be set to 18 pixels in width, and there will
be 5 extra pixels unused, and distributed as gaps among the bars. To avoid the gaps, one
method is to set the plot area width to a multiple of the number of bars. In C#, the code is
like:

int plotAreaWidth = 434;  //just an example
int barCount = 9;

//adjust plotAreaWidth to a mulitple of barCount
plotAreaWidth = plotAreaWidth / barCount * barCount;

Regards
Peter Kwan

  Re: Problemen with touchbar/bargap
Posted by Maurice van der Zwaan on Mar-28-2014 16:20
Thanks, that worked like a charm...

Had to compensate for the xAxis.setMargin values (for anyone with the same problem) but
after that it worked.