我现在有一个Sencha折线图,看起来像这样:
xtype: 'chart',
height: '100%',
store: 'ExperimentDataStore',
axes: [
{
type: 'numeric',
fields: [
'pmc1Value'
],
grid: true,
minimum: 0,
position: 'left',
title: 'PMC1Value'
},
{
type: 'numeric',
fields: [
'temperature'
],
position: 'left',
title: 'test'
},
{
type: 'numeric',
fields: [
'temperature'
],
position: 'left',
title: 'pmc6Value'
},
{
type: 'category',
fields: [
'timestamp'
],
title: 'Name'
}
],
series: [
{
type: 'line',
colors: [
'rgba(0,0,0,0.1)'
],
style: {
smooth: false,
stroke: '#000'
},
xField: 'timestamp',
yField: 'temperature'
},
{
type: 'line',
colors: 'rgba(0,200,0,0.3)',
style: {
smooth: true,
stroke: 'rgb(0,200,0)',
},
xField: 'timestamp',
yField: 'pmc1Value'
}
],
interactions: [
{
type: 'panzoom',
zoomOnPanGesture: true,
axes: {
top: false,
right: false,
bottom: false,
left: true
}
}
]
}
目前,缩放操作会缩放我所有图表系列左侧的y轴。但我想实现的是只放大一个特定的系列,而不是全部。这能做到吗?
否,您不能在单个系列上使用PanZoom。PanZoom交互只能在轴级别上配置,而不能在系列级别上配置。不支持开箱即用地缩放单个系列。
但假设这是可以做到的,你能通过放大一个特定的系列来描述你想要的行为吗?比如你想如何将其他系列形象化?你会有扭曲的天平。