Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Tiles of DataChart in ASP.NET MVC
posted

Hello am working on an asp.net mvc project. I need to presente dinamicly some datacharts on a tile.

How can i create a tile with a datachart in each item?
I am using infragisctics 2018.1.

THX

  • 280
    Offline posted

    Hello David,

    Thank you for your patience!

    I am attaching a sample, based on your requirement.

    To create a tile manager with data charts as elements you need to do following configurations:

    - Each chart should be in a separate cshtml file 

    - Create a datasource, which will contain information for every chart, like this example:

            public IActionResult Index()
            {
                ChartModel[] charts = {
                    new ChartModel { Name="Column",Control="ColumnChart" },
                    new ChartModel { Name="Bar",Control="BarChart" }
                };
    
                return View(charts);
            }

    - After adding the data source to the tileManager you have to set its states and if you want the chart to be visible in MaximizedState, you have to add an iframe to point to the route of the chart, like :

    Html.Infragistics()
                    .TileManager(Model.AsQueryable())
                    .ID("dashboard")
                    .ColumnWidth(240)
                    .ShowSplitter(true)
                    .MinimizedState("<h3>${Name}</h3>")
                    .MaximizedState("<iframe src = " + "/Home/${Control} " + "width=" + 800 + " height=" + 800 + "></iframe>")
                    .DataBind()
                    .Render()
      

    In a nutshell you have to reference the chart through iframes in order to render them.
    TileManagerIssue.zip
    Please, let me know if you have any further questions.

    Best Regards,
    Hristo Popov

  • 280
    Offline posted

    Hello David,

    Thank you for contacting us!

    I will provide you with a sample, based on your requirement as soon as possible.

    Thank you for you patience!

    Best Regards,
    Hristo Popov