c# - 添加其他数据集以显示组合图

标签 c# .net dataset chartfx

Chart chart1 = new Chart();  //ChartFX
chart1.DataSourceSettings.DataSource = dset.Tables[0];
chart1.Data.Series = 2;
DataSetDataValuesTableAdapters.DataValuesTableAdapter adapter = 
    new DataSetDataValuesTableAdapters.DataValuesTableAdapter();
DataSetDataValuesTableAdapters.DataValuesTableAdapter adapter2 = 
    new DataSetDataValuesTableAdapters.DataValuesTableAdapter();
DataSet dset = new DataSet();
DataTable datos1 = adapter.GetDataCaudal();
DataTable datos2 = adapter2.GetDataByPluvio();

dset.Tables.Add(datos1);
dset.Tables[0].TableName = "Table1";
dset.Tables.Add(datos2);
dset.Tables[1].TableName = "Table2";

我只能在 chartFX 中显示一个数据系列图表。我需要将另一个数据源连接到图表,以便我可以显示两个系列的组合数据。

这是一个 what I want to get 的例子:

有没有人可以帮助我?

最佳答案

我没有这个模块,所以我无法测试任何代码。但似乎你应该制作一个组合图: http://community.softwarefx.com/forums/p/8501/19692.aspx

First you need to create a crosstab to pass the data to this chart so that a series is created for each distinct value in the Product Column (Column Header). Check the programmer's guide on the Cross Tab provider for more details. You can also do this using the Chart FX Wizard.

After the data is setup, all you need to do is set the gallry for each series. You can do this in code or using the property grid at desing-time. In code it's something like:

chart.AllSeries.Gallery = Gallery.Bar;

chart.Series[2].Gallery = Gallery.Lines; // Third series is the Line

关于c# - 添加其他数据集以显示组合图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15073168/

相关文章:

c# - 存储过程的返回值仅在 ASP.NET 中获取第一个字符

c# - Math.Round() - LINQ 查询

database - Visual Studio 数据集设计器刷新表

c# - 为什么未装箱的类型有方法?

C# - 从 Google Place Api 中提取营业时间

c# - 如何添加对动态程序集的引用以编译另一个动态程序集?

c# - 在 C# 中更改系统图标

c# - 使用 OleDB 读取 CSV 数据的文件访问错误

database - 我如何对数百万个地址进行地理编码(获取纬度和经度)?

machine-learning - (查询、文档、相关性)用于构建信息检索系统的免费数据集