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. Image for the cookie policy date
close icon

Chart not rendering in MVC3 Razor enabled application

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


1 Reply

SD Sivakumar D Syncfusion Team 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


Loader.
Live Chat Icon For mobile
Up arrow icon