我尝试在数字轴的特殊刻度中添加一些文本。我成功完成了以下操作,但是当数字范围较大时,该操作将无效。
var chart = Ext.create('Ext.chart.CartesianChart', {
itemId:'productionLineProductChart',
store: this.chartStore,
animation: !Ext.isIE9m && Ext.os.is.Desktop,
background: 'rgba(255, 255, 255, 1)',
insetPadding: {
top: 10,
left: 10,
right: 10,
bottom: 10
},
width: 850,
height: 300,
axes: [
{
type: 'category',
position: 'bottom',
grid: true
},
{
type: 'numeric',
maximum: this.maxChartValue,
minimum: 0,
position: 'left'
},
{
type: 'numeric',
maximum: this.maxChartValue,
minimum: 0,
adjustByMajorUnit:false,
renderer: function (axis, label, layoutContext, lastLabel ) {
var recordData = ...
if (label == recordData.get('shiftProduction8'))
return '8 hour'
else if (label == recordData.get('shiftProduction10'))
return '10 hour'
else if (label == recordData.get('shiftProduction12'))
return '12 hour'
else if (label == recordData.get('shiftProduction16'))
return '16 hour'
else if (label == recordData.get('shiftProduction20'))
return '20 hour'
else if (label == recordData.get('shiftProduction24'))
return '24 hour'
return ''
},
position: 'right'
}
],
...
})
我如何禁用默认刻度并添加新刻度?