问题
I could able to display two scatter lines on the chart. However, I would like to reverse Y axis.
Even though I implemented following line, but it does not work based on the http://www.telerik.com/forums/valueaxis-change-direction-of-y-axis-reverse
valueAxis: {
reverse: true,
},
http://jsfiddle.net/3yhbyy2g/3/
回答1:
Here is the full solution and jsfiddle:http://jsfiddle.net/3yhbyy2g/9/
The key part of the solution is to approach each axis (x and y). and add reverse:true
to the y axis.
function createChart() {
$("#chart").kendoChart({
title: {
text: "Path"
},
tooltip: {
visible: true,
format: "Value: {0:N0}",
},
xAxis: {
max: 8000,
labels: {
format: "{0}m"
},
title: {
text: "Meter"
}
},
yAxis: {
reverse:true,
labels: {
format: "{0}",
padding: {
left: 10
}
},
title: {
text: "Charge"
}
},
seriesDefaults: {
type: "scatterLine",
},
series: [{
name: "Path1",
data: stats,
markers: {
visible: false
}
}, {
name: "Path2",
data: stats2,
markers: {
visible: false
}
}],
});
}
$(document).ready(createChart);
来源:https://stackoverflow.com/questions/29687368/reverse-y-axis-in-scatterline-kendo-ui