我希望将我的 y 轴的最小值设置为10 less than the lowest value in the Y-axis)
。[就像最小值是 83.33(在 Y 轴上),所以我希望将最小值设置为 73.33]
.ValueAxis(axis => axis
.Numeric()
.Labels(labels => labels.Format("{0}"))
.AxisCrossingValue(-10)
.Line(line => line.Visible(false))
.Color("White").Min(MinValueOf Y-axis -10)
或至少 .Min(MinValueOf Y-axis)
我能够解决这个问题......
$("#IndexChart").data("kendoChart").dataSource.read();
//get reference to the chart widget
var chart = $("#IndexChart").data("kendoChart");
chart.bind("dataBound", function (e) {
var data = e.sender.dataSource.view();
//alert(JSON.stringify(data));
var allVals = [];//get all Y Axis data...
for (var i = 0; i < data.length; i++) {
allVals.push(data[i].DuplicatePrice);
allVals.push(data[i].OriginalPrice);
}
var least = Math.min.apply(Math, allVals); //get the least value
e.sender.options.valueAxis.min = least - 10; //set the least-10 as min
});