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

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

VK Vijayabharathi K Syncfusion Team May 31, 2012 07:14 AM UTC

Hi Sanjay,

 

Thanks for using Syncfusion products.

 

We have attached a simple razor HTML5 chart sample in v10.2. Also, the following browser versions are supporting HTML5 Chart control.


1.Internet Explorer 9
2. Mozilla 3.5+
3. Safari 5+
4. Opera 10.53+
5. Chrome 10+
We can run the Chart HTML5 sample and online samples in the above browser versions.

 

We have provided same sample in Forum:103773 for HTML5 chart .

 

Please let us know if you have any concerns.

 

Regards,

Vijayabharathi            



MvcRazorApplication_9c9cf105.zip

Loader.
Live Chat Icon For mobile
Up arrow icon