我是nvd3的新手。 我绘制折线图,其中大多数点位于Y轴范围99到101.只有少数几个值超出此范围。检查此图片:
我希望这个范围一直在扩大。我希望最终用户专注于99到101的范围,无论大小值如何异常值。基本上,重点应放在99到101的范围内,但也应显示其他数据点。
这是我目前的代码:
$scope.setChartType = function(type) {
console.log(type);
$scope.options.chart.type = type;
};
$scope.options = {
chart: {
type: 'lineChart',
height: ClickHandlerService.chartOptions.height,
margin: ClickHandlerService.chartOptions.margin,
x: function (d) {
return parseInt(d.timestamp);
},
y: function (d) {
return d.latency;
},
useInteractiveGuideline: true,
staggerLabels: true,
stacked: false,
transitionDuration: ClickHandlerService.chartOptions.transitionDuration,
transitionEase: ClickHandlerService.chartOptions.transitionEase,
dispatch: {
stateChange: function (e) { /*Placeholder for graph events*/
},
changeState: function (e) { /*Placeholder for graph events*/
},
tooltipShow: function (e) { /*Placeholder for graph events*/
},
tooltipHide: function (e) { /*Placeholder for graph events*/
}
},
xAxis: {
tickFormat: function (d) {
return moment(d * 1000).utcOffset(-8).add(1, 'hours').format('DD-MM-YYYY/HH');
},
showMaxMin: false
},
yAxis: {
axisLabel: 'Data Latency (In minutes)',
tickFormat: function (d) {
return d3.format('.02f')(d);
},
axisLabelDistance: 30,
showMaxMin: false
},
callback: function (chart) {
}
},
title: {
enable: true,
text: graphDetails.name
},
caption: {
enable: true,
html: ClickHandlerService.chartOptions.dataLatencyCaption,
css: ClickHandlerService.chartOptions.captionCss
}
};