Click here to Skip to main content
15,886,716 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to create a chart in asp.net MVC with razer
if i try with the following data it will be fine
C#
public ActionResult Index()
      {
          var key = new Chart(width: 600, height: 400)
             .AddSeries(
                 chartType: "bar",
                 legend: "Rainfall",
                  xValue: new[] { "Jan", "Feb", "Mar", "Apr", "May" },
                  yValues: new[] { "20", "20", "40", "10", "10"}

                  ).Write();

          return null;

      }



but if i tried with huge data in xValues and yValues like below the chart is comming but the X-axis values are not dispalying correctly.


C#
public ActionResult Index()
      {
          var key = new Chart(width: 600, height: 400)
             .AddSeries(
                 chartType: "bar",
                 legend: "Rainfall",
        xValue: new[] { "Y4C", "T4C", "VOYAGER3", "Y41", "T41", "VOYAGER1", "Y42", "T42", "VOYAGER2","Y33", "T43", "VOYAGER13", "Y4C", "T4C",               "VOYAGER3" , "Y4C", "T4C", "VOYAGER3", "Y4C", "T4C", "VOYAGER3" },
            yValues: new[] { "200", "400", "600",      "200", "400", "600",      "200", "400", "600", "200", "400", "600",  "200", "400", "600"  ,                      "200", "400", "600",      "200", "400", "600" }
         ).Write();

          return null;

      }


if any correction or answer will be appreciated..
Posted

The type of chart that is going to represent the data determines the speed of the chart drawing. FastLine Chart (Chart Controls)[^] works with large number of dataset with high drawing speed to display the data. So for such case it is better to work with such kind of chart type.
 
Share this answer
 
It appears you have some duplication in your values. Is that perhaps causing an issue?
 
Share this answer
 
Comments
ganesan2510 19-Dec-11 9:06am    
i also tried with different values but its not comming properly
i also tried with this code below but chart is not coming properly

public ActionResult Index()
{
Chart chart = new Chart(width: 1080, height: 1280);
chart.AddSeries(
chartType: "stackedbar",
xValue: new[] { "a", "b", "c", "d", "e", "f", "g", "h", "i" , "j", "k", "l", "m", "n", "o" , "p", "q", "r", "s", "t", "u" },
yValues: new[] { "200", "400", "600", "200", "400", "600", "200", "400", "600" , "200", "400", "600", "200", "400", "600" , "200", "400", "600", "200", "400", "600" }

C#
).Write();

          return null;

      }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900