Saw
Saw

Reputation: 6416

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:

Chart

Upvotes: 0

Views: 1947

Answers (3)

Michal Franc
Michal Franc

Reputation: 1056

Google has a Flash application for this chart. You can add Silverlight application with a chart.

Check out the guide Styling a Silverlight Chart. It shows step by step how to style a Silverlight chart to have a "Googlish" style.

Upvotes: 1

Nicky Waites
Nicky Waites

Reputation: 2428

It is not 100% identical but this is as close as I can get it

<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

Upvotes: 4

Michael Jasper
Michael Jasper

Reputation: 8058

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.

Upvotes: 2

Related Questions