1
我是因爲看了這樣的一個表:創建二級x軸
Date | 1/1/13 | 1/8/13 | ...
| Group1 | Group2 | Group3 | Group1 | Group2 | Group3 | ...
Type1 | 1 | 2 | 3 | 5 | 6 | 7 | ...
Type2 | 6 | 5 | 4 | 4 | 8 | 0 | ...
Type3 | 7 | 8 | 9 | 9 | 3 | 2 | ...
我的任務是創建使用MS圖表來表示這個數據的圖表。該表格表示在顯示日期結束的一週內某個組已完成的任務(類型1/2/3)。我的想法是先創建一個條形圖,然後由該組按日期分組。我希望我的x軸看起來像上面的表格標題。
我查了一下第二軸主題,所有我能找到的都是第二Y軸。這與我所期望的不同,因爲它代表了每個y軸上的不同系列。我希望能夠代表一個系列,但有兩個x軸標籤。這甚至有可能嗎?我不相信它是,因爲數據點CA只有兩個值
var chart = new Chart();
chart.ChartAreas.Add(new ChartArea());
var series= new Series("series");
series.ChartType = SeriesChartType.Column;
series.XAxisType = AxisType.Primary;
//Magic secondary axis code
//Add data points
chart.Series.Add(series);
而且僅作參考,這裏是我計劃使用的類。
類
public class ChartGroup
{
public string GroupName
public int Type1
public int Type2
public int Type3
}
public class ChartDate
{
public DateTime Date
public List<ChartGroup> GroupData
}
public class Chart
{
public List<ChartDate> ChartData
}
編輯:我相信,可以通過進行一系列對於每種類型的,並且繪圖它的Date
x軸來創建這樣的圖表。這是唯一的方法嗎?