简体   繁体   English

如何在Asp.Net MVC3中创建3D图表

[英]How to create a 3D chart in Asp.Net MVC3

My application displays the result of Students in graphical form.The graph is a column graph which contains the subject names and marks. 我的应用程序以图形形式显示学生的结果。该图是一个包含主题名称和标记的柱状图。 Below is how my graph is created: 以下是我的图形的创建方式:

string zz={ "Subject1", "Subject2", "Subject3", "TOTAL" };

kk contains subject marks. kk包含主题标记。

var mychart= new Chart(width: 1000, height: 800, theme: ChartTheme.Blue)
            .AddSeries(
                chartType: "column",
                legend: "StudentResult",
                xValue: zz,
               yValues: kk)
              .Write();

I want to show graph in 3D. 我想以3D显示图形。 Im aware of MS Chart ,but cant change my application.Can i do the 3D chart without **MS Chart/google chart. 我知道MS Chart ,但无法更改我的应用程序。如果没有** MS Chart / google chart,我可以做3D图吗?

If yes How? 如果是,如何? and if No then what changes should i make to implement MS Chart 如果没有,那么我应该进行哪些更改以实施MS Chart

I tried: 我试过了:

var mychart= new Chart(width: 1000, height: 800, theme: ChartTheme.Vanilla3D)

but its not giving me the desired output.The color is too loud and aswell its truncating names of my subjects. 但是它没有给我想要的输出。颜色太大,而且它的主体名称也很短。

You can do it by using theme of chart 您可以通过使用图表的主题来做到这一点

  @{
        var myChart = new Chart(width: 600, height: 400, theme: ChartTheme.Vanilla3D )
            .AddTitle("Chart Title")
            .AddSeries(
                name: "ChartTitle",
                xValue: new[] {  "Col1", "Col2", "Col3", "Col4", "Col5" },
                yValues: new[] { "2", "6", "4", "5", "3" })
            .Write();
    }

And then change colors. 然后更改颜色。

    axisTitleTop: {     
       fill: '#000',     
       font: '11px Arial' 
    }, axisTitleLeft: { 
           fill: '#000',     
       font: '11px Arial' 
    }, axisTitleRight: { 
           fill: '#000',     
       font: '11px Arial' 
    }, axisTitleBottom: {     
       fill: '#000',     
       font: '11px Arial' 
    },labelTitle:{

      fill:"#B22222"
    }

I suggest using MS Chart, since u are using .net. 我建议使用MS Chart,因为您正在使用.net。 Download http://archive.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=4418 下载http://archive.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=4418

and run, view the example and code to find out what you can achieve and how to setup 3D chart. 并运行,查看示例和代码,以了解您可以实现什么以及如何设置3D图表。 for sure you can define color for each series. 确保您可以为每个系列定义颜色。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM