2
我無法獲得軸作爲貨幣格式,任何想法?如何在代碼AxisLabel中爲DependentRangeAxis設置格式?
我在做什麼錯?我需要能夠隨時更改格式,並且爲了進行此測試,我希望將其設置爲值的範圍內的Y軸貨幣。
有人嗎?
謝謝...
var columnSeries = new ColumnSeries
{ Title = reportProcedureNode.Value,
IndependentValuePath = "PrimaryKey",
DependentValuePath = "Value",
IndependentAxis = new CategoryAxis { Orientation = AxisOrientation.X, ShowGridLines = false, Location = AxisLocation.Bottom},
DependentRangeAxis = new LinearAxis(){Orientation = AxisOrientation.Y, ShowGridLines = false}
};
var labelStyle = new Style(typeof(AxisLabel));
labelStyle.Setters.Add(new Setter(AxisLabel.StringFormatProperty, "{}{0:C0}"));
var axis = (LinearAxis)columnSeries.DependentRangeAxis;
axis.AxisLabelStyle = labelStyle;
非常感謝。那就是訣竅。 – nitefrog