gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 13:46:49 24 4
gpt4 key购买 nike

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com