简体   繁体   English

如何在全屏显示图表图像?

[英]How to show the chart image in full width to screen?

图表生成得太小了。我正在使用asp.net图表控件。如何显示图表图像大小而不进行缩放。如何根据asp.net中的数据使图表高度和宽度动态变化?

It depends on how you are using it exactly, but System.Web.UI.DataVisualization.Charting.Chart has a Width and a Height property: 这取决于您究竟如何使用它,但是System.Web.UI.DataVisualization.Charting.Chart具有WidthHeight属性:

System.Web.UI.DataVisualization.Charting.Chart Chart1 = new System.Web.UI.DataVisualization.Charting.Chart();
Chart1.Width = 412;
Chart1.Height = 296;
Chart1.RenderType = RenderType.ImageTag;
//....
// Render chart control
Chart1.Page = this;
HtmlTextWriter writer = new HtmlTextWriter(Page.Response.Output);
Chart1.RenderControl(writer);

or 要么

<asp:chart id="Chart1" runat="server" Height="296px" Width="412px" ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)" Palette="BrightPastel" imagetype="Png" BorderDashStyle="Solid" ...

For more details, I suggest checking the samples at https://code.msdn.microsoft.com/Samples-Environments-for-b01e9c61 . 有关更多详细信息,建议您访问https://code.msdn.microsoft.com/Samples-Environments-for-b01e9c61检查示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM