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

Message ListMessage List     Post MessagePost Message

  Bars in Bar chart gets Overlap
Posted by Dilip Agarwal on Aug-07-2013 19:56
Attachments:
Hi Peter, I am drawing bar chart and I watch that bars in this gets overlap a in this image.
Code use for setting bar chart is as below. Please tell me where is the issue


Set layer = c.addBarLayer2(cd.Stack, 8)


Thanks For your help
BARChartOverlap.JPG

  Re: Bars in Bar chart gets Overlap
Posted by Peter Kwan on Aug-08-2013 00:47
Hi Dilip,

There are several possibilities:

(a) There may be other lines in your code that cause the bars to overlap (eg. code that calls BarLayer.setBarGap or BarLayer.setBarWidth).

(b) It seems you are using setXData to provide x-coordinates for the bar positions (instead of using Axis.setLabels). In this case, ChartDirector may not be able to guess the bar width you would like to use. For example, in the simplest example, suppose the x-coordinates are { 0, 2, 4, 9, 7, 7.5 }, what should be the bar width? It is hard to infer from the data. So for bar charts (or any chart that use regular width symbols), it is suggested Axis.setLabels be used instead of Layer.setXData. In this case, the bars will be assumed to be equally spaced regardless of what are the labels. If you must use BarLayer.setXData, you may need to use BarLayer.setDataWidth to tell ChartDirector the bar width you would like to use.

If you need further help, is it possible to provide me with the charting part of the code, and also the data. I think you just need to provide the x-data, and the data for one of the data sets. This should be sufficient to reproduce the problem.

Regards
Peter Kwan