Author |
Topic  |
|
TonyGrayDSI
14 Posts |
Posted - 27 Jul 2005 : 13:11:28
|
I'm drawing histograms using WGBargraph. I find that even though my bar centers and widths defined in WGDefineDataSetVB should make the bars exactly adjacent to one another, when the chart is drawn there are sometimes little gaps between the bars, other times the bars overlap one another. If the user resizes the window and plays with the aspect ratio, it's possible to get both of these conditions out of the same plot, so it isn't the dataset.
Is there any way to control the scaling (pixel based scaling, for example) that would guarantee that adjacent bars always came out just touching each other? |
Edited by - TonyGrayDSI on 27 Jul 2005 13:16:53 |
|
quinncurtis
1164 Posts |
Posted - 27 Jul 2005 : 14:39:41
|
What you are seeing is pixel rounding, which is always going to occur when physical coordinates based on floating point numbers are translated into pixel coordinates using integers. The starting point and width of the bar is going to vary +- one pixel, depending on how it maps into the current pixel coordinate system, which is causing the effect you describe. It is going to be most notable if you try and match up the edges of the bars exactly, as you are doing. There is nothing that we can suggest that will create a perfect fit for every possible window dimension, as you describe. You are better off leaving a larger gap, 5 pixels for example, between the bars, that way changes in the bar width resulting from changes in the window size will be less noticeable. |
 |
|
TonyGrayDSI
14 Posts |
Posted - 27 Jul 2005 : 15:01:28
|
For histograms (as opposed to bar charts) the bars need to be exactly adjacent to be correct since the X axis represents a continuous variable. It sounds like this isn't possible, too bad. |
 |
|
|
Topic  |
|
|
|