MVC Charts

  1. #1

    MVC Charts

    Hi,

    I'm trying to build a basic working example of some of the charts. Ideally I want to use the razor syntax. In the various examples I am trying to port the chart data source refers to

    store.DataSource = Ext.Net.Examples.ChartData.GenerateData
    I don't have this Examples.dll. What data type is the GenerateData returning and are there any basic chart examples?

    Thanks,
    Last edited by Daniil; Nov 28, 2012 at 9:30 AM. Reason: Please use [CODE] tags
  2. #2
    Hi @Iguion,

    Here is a standalone example. Hope this helps you to start.

    Please feel free to ask further.

    By the way, porting the Chart examples to Razor engine is one of our current goals.

    Example
    <!DOCTYPE html>
    
    <html>
    <head>
        <title>Ext.Net.MVC v2 Example</title>    
    </head>
    <body>
        @Html.X().ResourceManager()
        
        @(Html.X().Chart()
            .ID("Chart1")
            .Width(400)
            .Height(400)
            .Store(Html.X().Store()
                .Model(Html.X().Model()
                    .Fields(
                        new ModelField("x"),
                        new ModelField("y")
                    )
                )
                .Data(new object[]
                {
                    new 
                    {
                        x = 0,
                        y = 0   
                    },
                    new 
                    {
                        x = 50,
                        y = 75   
                    },
                    new 
                    {
                        x = 100,
                        y = 100   
                    }
                })
            )
            .Axes(
                Html.X().NumericAxis().Title("X").Fields("x").Position(Position.Bottom),
                Html.X().NumericAxis().Title("Y").Fields("y").Position(Position.Left)
            )
            .Series(
                Html.X().LineSeries().Title("Chart").XField("x").YField("y")
            )
        )
    </body>
    </html>

Similar Threads

  1. [CLOSED] Possible to use v2 Charts in v1 app?
    By jchau in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 27, 2015, 6:16 AM
  2. [CLOSED] Did Charts break
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Sep 05, 2013, 7:18 PM
  3. Ext.net and Google charts
    By cerqueira81 in forum 2.x Help
    Replies: 0
    Last Post: May 02, 2012, 1:06 PM
  4. Charts with Coolite
    By flaviodamaia in forum 1.x Help
    Replies: 1
    Last Post: Jan 12, 2012, 4:06 PM

Posting Permissions