问题描述:

Hello all: I would like to have the option of charting two database fields together. Right now this charts just Cash for multiple years. I would like to also chart "OfficeSupplies" on the same graph. Does anyone know how to do that? I tried:

yValues: chartData, yFields: "Cash","OfficeSupplies");

... but that doesn't work. I'm getting the message: "named argument specifications must appear after all fixed arguments have been specified." Any ideas on charting multiple things at once?

Thanks,

Ruben

var chartData = db.FinancialPeriods.SqlQuery("SELECT * FROM FinancialPeriods");

var myChart = new Chart(width: 600, height: 400)

.AddTitle("Cash Chart")

.AddSeries(

chartType: "Line",

//chartType: "Bubble",

//name: "Employee",

xValue: chartData, xField: "Year",

yValues: chartData, yFields: "Cash",

);

网友答案:

You can do like this way

var myChart = new Chart(width: 600, height: 400)

          .AddTitle("Cash Chart")
          .AddSeries(
              chartType: "Line",
              //chartType: "Bubble",
              //name: "Employee",
              xValue: chartData, xField: "Year",
              yValues: chartData, yFields: "Cash",
          );

          .AddSeries(
              chartType: "Line",
              //chartType: "Bubble",
              //name: "Employee",
              xValue: chartData, xField: "Year",
              yValues: chartData, yFields: "OfficeSupplies",
          );
相关阅读:
Top