Javascript Highstock当多条线共享y轴时,在偏移处绘制一条线
我使用的是Highstock/Highchart,如果我在一个图形上画两条线,它们共享一个Y轴,其中一条线在Y轴上不会正确显示。它被偏移到更高的值。例如,值为120,但点显示在200行上。我会贴一张照片,但我还不能 我曾尝试将Y轴最大值设置为最大值,但该线偏离图表,因为它仍以偏移量渲染 以下是我的图表配置:Javascript Highstock当多条线共享y轴时,在偏移处绘制一条线,javascript,angularjs,highcharts,highstock,Javascript,Angularjs,Highcharts,Highstock,我使用的是Highstock/Highchart,如果我在一个图形上画两条线,它们共享一个Y轴,其中一条线在Y轴上不会正确显示。它被偏移到更高的值。例如,值为120,但点显示在200行上。我会贴一张照片,但我还不能 我曾尝试将Y轴最大值设置为最大值,但该线偏离图表,因为它仍以偏移量渲染 以下是我的图表配置: $scope.chartConfig = { options: { style: { fontSize: '12px' }, chart: {
$scope.chartConfig = {
options: {
style: {
fontSize: '12px'
},
chart: {
alignTicks: true,
type: 'spline'
},
rangeSelector: {
inputEnabled: true, //$('#container').width() > 480,
selected: 0,
buttons: [{
type: 'week',
count: 1,
text: '1w'
},
{
type: 'month',
count: 1,
text: '1m'
},
{
type: 'month',
count: 3,
text: '3m'
}, {
type: 'month',
count: 6,
text: '6m'
}, {
type: 'ytd',
text: 'YTD'
}, {
type: 'year',
count: 1,
text: '1y'
}, {
type: 'all',
text: 'All'
}]
},
navigator: {
enabled: true
},
tooltip: {
animation: true,
enabled: true,
shadow: true,
shared: false,
useHTML: false,
xDateFormat: '%m/%d/%Y'
},
colors: ['#51324e', '#6e6e6e', '#3d2b3b', '#515151', '#342d3d', '#3e3e3e', '#413451', '#4f4b4b', '#351032', '#3e3e3e'],
plotOptions: {
pointStart: 0,
'line': {
'cursor': 'pointer',
'marker': {
'lineWidth': 1.5,
},
'lineWidth': 1
},
column: {
grouping: true
},
series: {
stacking: 'normal',
}
}
},
xAxis: {
title: {
text: ''
},
},
yAxis: {
//min: 10,
max: null,
title: {
text: ''
}
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
}
},
useHighStocks: true,
series: [{
//type: 'column',
marker : {
enabled : true,
radius : 4,
fillColor: {},
lineColor: {},
lineWidth: 3,
symbol: 'diamond'
},
name: '',
data: [[
0,0
]],
dataGrouping: {
units: [[
'week', // unit name
[1] // allowed multiples
], [
'month',
[1, 2, 3, 4, 6]
]]
}
},
{
//type: 'column',
marker : {
enabled : true,
radius : 4,
fillColor: {},
lineColor: {},
lineWidth: 3,
symbol: 'diamond'
},
name: '',
data: [[
0,0
]],
dataGrouping: { // TODO: delete me?
units: [[
'week', // unit name
[1]
], [
'month',
[1, 2, 3, 4, 6]
]]
}
}
],
title: {
style: {
color: '#51324e'
}
},
credits: {
enabled: false
}
};
在HTML中:
<highchart id="chart" class="hiChart-container" config="chartConfig"></highchart>
我只需要更改数据和序列名称来更新图表。。。
我只导入Highstock并使用Highchart ng。
我无法执行var chart=new chart$scope.chartConfig,因为我的javascript框架是AngularJS,因此我们使用的是Highchart ng
如何调整要缩放到Y轴的线 你现场演示过吗?