开发者

ZedGraph Bar Width

开发者 https://www.devze.com 2023-03-22 01:50 出处:网络
Is there a way to modify the width of a ZedGraph bar?If so, what is the code necessary to do so?Is it possible to make it so the bars scale with the zoom also?I have bars that don\'t show up because o

Is there a way to modify the width of a ZedGraph bar? If so, what is the code necessary to do so? Is it possible to make it so the bars scale with the zoom also? I have bars that don't show up because of the way the scaling works currently (there is a wide x-axis range, which makes all of the bars very skinny). If the bar is too narrow, it won't show up at all. I'd like the bars to be wider 开发者_开发技巧so they will always show up without having to zoom in to see them.


The documentation for ZedGraph has the following to say about bar type graphs (emphasis mine):

Typically, bar charts would be created with XAxis.Type = AxisType.Text or XAxis.Type = AxisType.Ordinal (both types use ordinal values), such that the bars are drawn at integral values along the "base" axis, starting with 1 (e.g., the first bar cluster is at 1.0, the second is at 2.0, etc.). However, the ordinal axis type is not a requirement for bar charts. It is possible to create a bar chart that is not evenly spaced, by providing X values and using AxisType.Linear (in this case, you may need to use the GraphPane.ClusterScaleWidth property to tell ZedGraph how wide the bars should be. See this wiki page for details). For bar charts, the tic marks are typically between the bar clusters, which can be accomplished with the Axis.MajorTic.IsBetweenLabels property. However, this property is only applicable for AxisType.Text axes.

Unfortunately the wiki link goes to the old domain which the authors of ZedGraph seem to have abandoned. However there is an archived version: Wiki Page

Finally you may find it helpful to check the excellent source code reference at sourceforge.

0

精彩评论

暂无评论...
验证码 换一张
取 消