extjs - 防止 Extjs 标记圈被切断
问题描述
我是 Extjs 的新手,我正在学习。我还有很长的路要走,但我学到了我需要知道的东西。我的标记圈被切断了。有没有我可以用来防止这种情况的设置/解决方法?见图片:
我查看了 v6.0.0 文档,但不确定要使用什么。代码:
Ext.onReady(() => {
Ext.create({
xtype: 'cartesian',
renderTo: element, // rendered element
height: 200,
insetPadding: 20,
store: {
fields: ['name', 'amount'],
data: [..] // data
},
smooth: true,
axes: [{
type: 'category',
position: 'bottom',
fields: ['name'],
label: {
fill: 'rgba(0,10,30,.75)',
fontSize: 15
},
style : {
strokeStyle : 'rgba(0,10,30,.2)'
}
}],
series: [
{
type: 'line',
fill: true,
style: {
fill: '#a2d5f2',
fillOpacity: .6,
stroke: '#00a1fd',
strokeOpacity: .6,
},
tooltip: {
trackMouse: true,
renderer: (tooltip, model, item) => {
const content = item.record.data.name + ': ' + item.record.data.amount
//tooltip.setHtml(model.get(item.field));
tooltip.setHtml(content)
}
},
xField: 'name',
yField: 'amount',
marker: {
type: 'circle',
radius: 5,
lineWidth: 2,
fill: '#fff',
fillOpacity: 1,
},
renderer: (sprite, config, rendererData, index) => {
let store = rendererData.store,
storeItems = store.getData().items,
previousRecord = storeItems[index],
currentRecord = (index > 0 ? storeItems[index - 1] : previousRecord),
current = currentRecord && parseFloat(currentRecord.data['amount']),
previous = previousRecord && parseFloat(previousRecord.data['amount']),
changes = {};
switch (config.type) {
case 'marker':
if (index == 0) {
return null; // keep the default style for the first marker
}
changes.strokeStyle = (current >= previous ? '#00a1fd' : 'red');
//changes.fillStyle = '#fff';
//changes.fillOpacity = 1;
//changes.lineWidth = 2;
break;
case 'line':
changes.strokeStyle = (current >= previous ? '#00a1fd' : 'red');
changes.lineWidth = 2;
changes.fillStyle = (current >= previous ? '#a2d5f2' : 'red');
changes.fillOpacity = (current >= previous ? 1 : .1);
break;
}
return changes;
}
}]
});
})
我相信 Xero 正在使用 Ext 并且他们的圈子不会被切断:
解决方案
您可以使用 innerPadding 配置属性:
Ext.onReady(() => {
Ext.create({
xtype: 'cartesian',
renderTo: element, // rendered element
height: 200,
innerPadding: 10, // THIS PROPERTY
...
...
推荐阅读
- wordpress - 如何将自动完成建议视为 WordPress 中该帖子的链接?
- php - 谁在数据库级别工作,它们显示在工作台 phpMyAdmin 中?
- c# - 如何在分组的语义缩放 ListView 上显示要显示的文本?
- r - 在 R 中使用 Googleways 计算交通距离时无法使用 Arrival_time
- keycloak - OIDC和SAML可以和keycloak一起工作吗
- python - python - 如何在python的for循环中更新两个变量以获取复利方程
- angular - 使用 Net Core 2.1 和 Angular 2 创建使用 Google 登录选项时出现问题
- html - 页面左右两侧输入表格
- javascript - Discord.js - 我将如何集成 PayPal 发票 API?
- python - 有没有比这更好的从列表中随机选择的方法: