We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Chart not rendering in MVC3 Razor enabled application

Thread ID:

Created:

Updated:

Platform:

Replies:

103774 May 30,2012 12:07 PM UTC May 31,2012 05:50 AM UTC ASP.NET MVC (Classic) 1
loading
Tags: Chart
Sanjay
Asked On May 30, 2012 12:07 PM UTC

Hi,
 
In  MVC3 View, I have code copied from sample to render a chart:
 
@(Html.Syncfusion().ChartAdv("ChartAdv")             
              .Series(series =>
              {
                  Random ran = new Random();
                  series.Add().Name("John").Type(SeriesType.Spline).Points(p =>
                  {
                      for (int i = 1; i <= 70; i++)
                      {
                          p.Add(i, ran.Next(10, 60));
                      }
                  }).Style(style =>
                  {
                      style.Border(border => border.Width(0)).Opacity(0);
                  }).DisplayText(false).Symbol(symbol => symbol.Visible(true).Shape(SymbolShape.Circle));
                  series.Add().Name("Peter").Type(SeriesType.Spline).Points(p =>
                  {
                     
                      for (int i = 1; i <= 70; i++)
                      {
                          p.Add(i, ran.Next(10, 60));
                      }
                  }).Style(style =>
                  {
                      style.Border(border => border.Width(0)).Opacity(0);
                  }).DisplayText(false).Symbol(symbol => symbol.Visible(true).Shape(SymbolShape.Circle));
              
              }).Size(new System.Drawing.Size(900, 500)).Text("Monthly Savings").Font(new Syncfusion.Mvc.ChartAdv.ChartFont("Arial", "15px", ChartFontStyle.Bold)).Legend(legend => legend.Visible(true).Shape(LegendShape.Circle)).ElementSpacing(10)
            
  )
 
In _Layout.cshtml i have below code:
Header section

@{ Html.Syncfusion().StyleManager()
        .Register(styleSheet =>
            {
                styleSheet.Add(ComponentType.Chart);

            }).Render();  }

 

After Page Body

 @{ Html.Syncfusion().ScriptManager().Render();}

 

Apart from that I have added all dll and js file references as mentioned in the the documentation.

When i run the app, i get nothing rendered.

Please help


Sivakumar D [Syncfusion]
Replied On May 31, 2012 05:50 AM UTC

 Hi Sanjay,

Thanks for using Syncfusion Products.

We have created simple chart sample in  MVC3 Razor view with your code snippet provided in the last update. The sample can be downloaded from below link.

I95017.zip

Could you please try the above sample and get back to us whether you are able to reproduce the issue? If not, could you please give more information or by reproducing the issue in the above sample so that we could sort out the issue and provide you with solution. The information provided would be of great help in resolving the issue.

Please let us know if any concerns.

Regards,

Siva


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;