设计图表时出现问题 [英] Problem in designing a chart

查看:88
本文介绍了设计图表时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家,



我想生成动态图表报告。
此图表中的
列未固定

它可以动态增长...

低于图表描述应该以表格格式添加为alegend到图表是否有任何免费工具来绘制此图表



任何人都可以帮我解决这个问题吗?



提前谢谢

(Keerthi Kumar)

Hi experts,

I want to generate a dynamic chart report.
in this chart columns are not fixed
it can grow dynamically...
below the chart description should be added in the table format as alegend to the chart is there any free tools to draw this chart

can any one please help me to solve this issue?

thanks in advance
(Keerthi Kumar)

推荐答案

如果你在标记中声明这样的普通asp.net图表......

If you declare a normal asp.net Chart like this in your markup...
<asp:Chart ID="Chart1" runat="server" Height="600px" Width="900px">
                <Series>
                    <asp:Series Name="Series1" IsValueShownAsLabel="true"></asp:Series>
                </Series>
                <ChartAreas>
                    <asp:ChartArea Name="caMain">
                        <Area3DStyle IsClustered="true" Enable3D="True" />
                        <AxisX>
                            <LabelStyle Interval="1" />
                        </AxisX>
                    </asp:ChartArea>
                </ChartAreas>
            </asp:Chart>





那么你可以通过从数据库中获取DataTable来直接添加任意数量的列,其中第一列是您的x轴标签,第二列是您的数据点,因此您的表将会看起来像这样...



A栏B栏

Dave 65

John 13


然后当你绑定图表时,你可以做这样的事情...





then you could dymanically add as many columns as you wish by just getting a DataTable from your database where the first column is your x-axis labels and your second column is your data points, so your table will look something like this...

Column A Column B
Dave 65
John 13

Then when you bind the chart you could just do something like this...

Chart1.Titles.Add("Your Chart Description");
        Chart1.Series["Series1"].Points.Clear();
        foreach (DataRow r in dtReport.Rows)
                Chart1.Series["Series1"].Points.AddXY(r[0].ToString(), r[1].ToString());





希望这有帮助......



Hope this helps....


这篇关于设计图表时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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