在选项卡面板中的下一行中显示图表 [英] Display Chart In Next Row In Tab Panel
问题描述
大家好,
我在标签面板中动态生成了图表。我现在面临的问题是,当生成许多图表时,它会彼此并排生成。如何在每行中只有1个图表,而不是将它们水平并排显示在一起?每个图表应该分别在1行。
这是我执行程序时目前看到的: http://i.stack.imgur.com/2lnIR.png [ ^ ]
这是什么我希望实现: http://i.stack.imgur.com/ CAMUf.png [ ^ ]
这是我的代码:
hi all,
I have generated charts dynamically in tab panel. The problem I faced now is when many charts are generated, it generates side by side each other. How do I only have 1 chart in each row instead of having them being displayed horizontally side by side together? Each chart is supposed to be on 1 row each.
This is what I currently see when I executed my program: http://i.stack.imgur.com/2lnIR.png[^]
This is what I want to achieve: http://i.stack.imgur.com/CAMUf.png[^]
This is my codes:
//Aspx file
<div>
<asp:scriptmanager ID="ScriptManager1" runat="server">
</asp:scriptmanager>
</div>
<asp:updatepanel ID="UpdatePanel1" runat="server" ScrollBars="Horizontal">
<contenttemplate>
<asp:placeholder ID="PlaceHolder1" runat="server"></asp:placeholder>
</contenttemplate>
</asp:updatepanel>
//Cs file
AjaxControlToolkit.TabContainer container = new AjaxControlToolkit.TabContainer();
container.ID = "TabContainer";
container.EnableViewState = false;
container.Tabs.Clear();
foreach (ListItem item in SelectionListBox.Items)
{
if (item.Selected)
{
Label tabContent = new Label();
tabContent.ID = "lbl_tab_";
tabContent.Text += item.Value;
Chart Chart1 = new Chart();
Chart1.DataSource = dt;
Chart1.Width = 715;
Chart1.Height = 450;
Chart1.Series.Add(new Series());
Chart1.Series[0].ChartType = SeriesChartType.BoxPlot;
List<object> List1 = dt_LVL1RISKCHART.AsEnumerable().ToList<object>();
foreach (DataRow row in dt.Rows)
Chart1.Series[0].Points.AddXY(row["STATUS"], new object[] { row["MIN"], row["MAX"], row["25TH_PERCENTILE"], row["75TH_PERCENTILE"], row["AVG"], row["50TH_PERCENTILE"] });
//create chartareas
ChartArea ca = new ChartArea();
ca .AxisX = new Axis();
ca .AxisY = new Axis();
Chart1.ChartAreas.Add(ca);
//databind
Chart1.DataBind();
Chart1.Visible = true;
AjaxControlToolkit.TabPanel panel = new AjaxControlToolkit.TabPanel();
panel.HeaderText += item.Value;
container.Tabs.Add(panel);
panel.Controls.Add(tabContent);
panel.Controls.Add(Chart1);
}
}
PlaceHolder1.Controls.Add(container);
}
public AjaxControlToolkit.TabPanel GetManualTab()
{
AjaxControlToolkit.TabPanel panel = new AjaxControlToolkit.TabPanel();
return panel;
}
问题:如何在标签面板的每一行仅显示 1图表有很多图表一次生成吗?
我需要帮助,感谢有人能为我提供帮助,非常感谢!!
Question: how do I display only 1 chart at each row in tab panel if there are many charts being generated at one go?
I need help on this, appreciate if someone can provide me help on this, thanks a lot!!
推荐答案
使用
use
chart.Legends["Legend1"].Position.Auto = false;
chart.Legends [Legend1]。Position = new ElementPosition(x,y,Height,Width);
chart.Legends["Legend1"].Position = new ElementPosition(x, y, Height, Width);
这篇关于在选项卡面板中的下一行中显示图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!