如何设置图表栏的宽度? [英] How to set chart bar's width?

查看:190
本文介绍了如何设置图表栏的宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2010用C#编写Winforms应用程序。我正在使用常规工具箱中的图表控件来查看SQL数据库中的数据。如您所见,该栏非常宽。有一些属性或方法可以缩小它并固定吗?



f1d21b3b>df4bd1d21b3a>dbdf1d21b3a>dbdf1d21b3ea h2_lin>解决方案

我做了一个小例子绑定三个值,并设置了 dataPointCustomProperties的 PixelPointWidth

  int [] liste = new int [] {1,2,3}; //,4 ,5,6,7}; 
chart1.Series [ Series1]。Points.DataBind(liste, sampleData, count, Tooltip = count);
// dataPointCustomProperties
chart1.Series [ Series1] [ PixelPointWidth] = 1;

将在此图表中显示



< img src = https://i.stack.imgur.com/skzeR.png alt =图表栏宽度1px>


I'm using Visual Studio 2010 to write a Winforms application in C#. I'm using the chart control from the regular toolbox to view data from my SQL database. As you see, the bar is very wide. Is there some property or way to make it smaller, and fixed?

解决方案

I did a small example binding three values and set the PixelPointWidth of dataPointCustomProperties.

int[] liste = new int[] { 1, 2, 3 };//, 4, 5, 6, 7 };
chart1.Series["Series1"].Points.DataBind(liste, "sampleData", "count", "Tooltip=count");
// dataPointCustomProperties
chart1.Series["Series1"]["PixelPointWidth"] = "1";

will result in this chart

这篇关于如何设置图表栏的宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆