简体   繁体   English

如何在ASP.NET图表控件中获取此图表?

[英]How do I get this chart in a ASP.NET chart control?

What type of chart or what properties should I set in ASP.NET 4.0 chart control to get something like this: 我应该在ASP.NET 4.0图表控件中设置哪种类型的图表或哪些属性,以实现如下所示:

图表

It is not 100% identical but this is as close as I can get it 它不是100%相同,但是我所能接近的

<asp:Chart ID="Chart1" runat="server" Height="250px" Width="650px">
        <Series>
            <asp:Series Name="Series1" BorderColor="0, 119, 204" BorderDashStyle="Dash" BorderWidth="3"
                ChartType="Area" Color="230, 242, 250" MarkerColor="0, 119, 204" MarkerStyle="Circle"
                XValueType="Date">
            </asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1">
                <AxisY LineColor="LightGray">
                    <MajorGrid LineColor="LightGray" />
                    <MajorTickMark Enabled="False" />
                    <LabelStyle ForeColor="LightGray" />
                </AxisY>
                <AxisX Interval="7" IsLabelAutoFit="False" LineColor="LightGray" Title="Week" TitleFont="Microsoft Sans Serif, 8pt, style=Bold"
                    IsMarginVisible="false">
                    <MajorGrid LineColor="LightGray" />
                    <MajorTickMark Enabled="False" />
                    <LabelStyle ForeColor="85, 162, 215" Format="{0:dd MMM}" />
                </AxisX>
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>

Some dummy data 一些虚拟数据

    Dim random = New Random()
    For index = 1 To 50
        Chart1.Series("Series1").Points.AddY(random.Next(5, 10))
    Next

If you're looking for a line graph, there are a few examples of in the demo "Chart Types->Advanced Financial Charts" 如果要查找折线图,请在演示“图表类型->高级财务图表”中找到一些示例 http://www.scottgu.com/blogposts/chart/step3.png This blog has a lot of information on the asp chart control, as well as links to downloading the documentation. 该博客包含有关ASP图表控件的大量信息,以及有关下载文档的链接。

Google has a Flash application for this chart. Google为该图表提供了Flash应用程序。 You can add Silverlight application with a chart. 您可以使用图表添加Silverlight应用程序。

Check out the guide Styling a Silverlight Chart . 请查看指南“ 样式化Silverlight图表” It shows step by step how to style a Silverlight chart to have a "Googlish" style. 它逐步介绍了如何设置Silverlight图表的样式,使其具有“ Googlish”样式。

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

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