无法使用razer在asp.net MVC中创建包含大量数据的图表 [英] unable to create chart with huge data in asp.net MVC with razer

查看:76
本文介绍了无法使用razer在asp.net MVC中创建包含大量数据的图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用razer在asp.net MVC中创建一个图表
如果我尝试使用以下数据,那就很好了

i am trying to create a chart in asp.net MVC with razer
if i try with the following data it will be fine

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;

      }




但是,如果我尝试使用xValues和yValues中的巨大数据(如下图所示),但X轴值不能正确显示.





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.


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..

推荐答案

要表示数据的图表类型决定了图表绘制的速度. 快速折线图(图表控件) [
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.


似乎您的值有些重复.
It appears you have some duplication in your values. Is that perhaps causing an issue?


我也在下面的代码中尝试过,但是图表无法正常显示

公共ActionResult Index()
{
图表图表=新图表(宽度:1080,高度: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"}

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" }

).Write();

          return null;

      }


这篇关于无法使用razer在asp.net MVC中创建包含大量数据的图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆