X和Y值应该用什么? [英] What Should I Use For X And Y Value?

查看:68
本文介绍了X和Y值应该用什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  foreach (DataRow row  in  dt.Rows)
{
lstData.Add( new Tablelist(){FileName = csv,process = row [ process] + ,Event = row [ 事件] + ,status = row [ status ] + });

}
}
DataTable dtoutput = new DataTable();
var columnNames = lstData.Select(k = > k.FileName).Distinct( );
foreach 字符串 columnName in columnNames)
dtoutput.Columns.Add(columnName, typeof string ));
DataRow newrowPassCount = dtoutput.NewRow();
foreach 字符串 columnName in columnNames){
int count = lstData.Where(k = > k.FileName == columnName).Count(k = > k.status == );
newrowPassCount [columnName] = count;
}
dtoutput.Rows.Add(newrowPassCount);

DataRow newrowFailCount = dtoutput.NewRow();
foreach 字符串 columnName in columnNames)
{
int count = lstData.Where(k = > k.FileName == columnName).Count(k = > k.status == < span class =code-string>失败
);
newrowFailCount [columnName] = count;
}
dtoutput.Rows.Add(newrowFailCount);

gridview.datasource = dtoutput;
gridview.databind();





i在这里获得此代码,而不是使用gridview显示,我可以在chart..i一直试图把价值放在x和y ..但我不能得到......我应该为x和y值做什么?

解决方案

HI,



请指定您要使用的图表?比如google图表,excel文件中的图表等。



如果你想使用谷歌图表,你必须打电话给Ajax。



请参阅此链接以获取更多帮助:https://code.google.com/p/googlechartsharp/



希望它能运作。


HI ...



请参考此链接



http://www.rgraph.net/docs/csv-file-reader.html [ ^ ]



使用此代码:



 row = getRow(index [,start])
此函数从CSV中获取一行数据并将其返回(作为数组)。您可以选择从列索引开始(列编号从0开始)。例如row = csv.getRow(3,1);

col = getCol(index [,start])
此函数从CSV中获取一列数据并将其返回(作为数组)。您可以选择将行索引设置为开始(行编号从0开始)。例如col = csv.getCol(3,1);


foreach (DataRow row in dt.Rows)
        {
            lstData.Add(new Tablelist() { FileName=csv,  process = row["process"] + "", Event = row["Event"] + "", status = row["status"] + "" });
 
        }
    }
        DataTable dtoutput = new DataTable();
       var columnNames =  lstData.Select(k => k.FileName).Distinct();
       foreach (string columnName in columnNames)       
           dtoutput.Columns.Add(columnName, typeof(string));
       DataRow newrowPassCount = dtoutput.NewRow();
         foreach (string columnName in columnNames) {
            int count = lstData.Where(k=> k.FileName == columnName).Count(k => k.status == "Pass");
            newrowPassCount[columnName] = count; 
        }
         dtoutput.Rows.Add(newrowPassCount);
 
         DataRow newrowFailCount = dtoutput.NewRow();
         foreach (string columnName in columnNames)
         {
             int count = lstData.Where(k => k.FileName == columnName).Count(k => k.status == "Fail");
             newrowFailCount[columnName] = count;
         }
         dtoutput.Rows.Add(newrowFailCount);
 
         gridview.datasource = dtoutput;
         gridview.databind();



i got this code here, instead of using gridview to display, can i display it in chart..i have been trying putting value in x and y..but i just cant get..what should i put for x and y value??

解决方案

HI,

Pls specify which chart you want to use? like google chart,Chart in excel file etc.

If you want to use google chart, you have to call Ajax call.

Pls refer this link for more help : https://code.google.com/p/googlechartsharp/

Hope it will work.


HI...

Pls refer this link

http://www.rgraph.net/docs/csv-file-reader.html[^]

Use this code :

 row = getRow(index[, start])
This function fetchs a row of data from the CSV and returns it (as an array). You can optionally give the column index to start at (the column numbering starts from 0). eg row = csv.getRow(3, 1);

col = getCol(index[, start])
This function fetchs a column of data from the CSV and returns it (as an array). You can optionally give the row index to start at (the row numbering starts from 0). eg col = csv.getCol(3, 1); 


这篇关于X和Y值应该用什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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