silverlight chart Axis
void dataServiceClient_GetEmployeeListCompleted(object sender, GetEmployeeListCompletedEventArgs e)
{
ObservableCollection<EmployeeInfo> employeeList = e.Result;
Action<Chart> chartModifier = (chart) =>
{
Axis dateAxis = new Axis{ Orientation = AxisOrientation.Horizontal, Title = "雇员名称", FontStyle = FontStyles.Normal, FontSize = 12f, ShowGridLines = true };
EmployeeChart.Axes.Add(dateAxis);
Axis valueAxis = new Axis { Orientation = AxisOrientation.Vertical, Title = "薪水", Minimum = -1000, Maximum = 3000, ShowGridLines = true };
EmployeeChart.Axes.Add(valueAxis);
};
chartModifier(EmployeeChart);
我在vs2010复制了着段代码,但是编译器总说不能创建一个抽象的类或接口 “system.windows.....charting.axis”这是什么原因,这个还是我在网上看到高人写的代码。
还有,上面那个是Action<Chart> chartModifier = (chart) => {};是什么意思,看不懂,望高人指点;
[解决办法]
你也看到了,不只你一个人有这个问题,也可能是因为Toolkit的版本不一样,但是最新的版本Axis肯定是抽象类,不能直接New,Axis的版本有很多个,你选择一个适合自己的就可以了啊