专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > VB Dotnet

用zedGraph画图表,请教,怎么设置图例框的高度

发布时间:2011-06-23 15:56:00 文章来源:www.iduyao.cn 采编人员:星星草
用zedGraph画图表,请问,如何设置图例框的高度.
图例框里的文字稍微出了点边框,
我想调整一下图例框的高度,让文字完全在框内,
请问如何设置?

------解决方案--------------------
找到解决方法了
private float GetMaxHeight( PaneList paneList, Graphics g, float scaleFactor )
{
// Set up some scaled dimensions for calculating sizes and locations
float defaultCharHeight = this.FontSpec.GetHeight( scaleFactor );
float maxCharHeight = defaultCharHeight;

// Find the largest charHeight, just in case the curves have individual fonts defined
foreach (GraphPane tmpPane in paneList )
{
foreach ( CurveItem curve in tmpPane.CurveList )
{
if ( curve._label._text != string.Empty && curve._label._isVisible )
{
float tmpHeight = defaultCharHeight;
if ( curve._label._fontSpec != null )
tmpHeight = curve._label._fontSpec.GetHeight( scaleFactor );

// Account for multiline legend entries
tmpHeight *= curve._label._text.Split( '\n' ).Length;

if ( tmpHeight > maxCharHeight )
maxCharHeight = tmpHeight;
}
}
}
//图例加5防止文字离线太近
return maxCharHeight+5;
}
legend.cs文件中
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: