簡體   English   中英

在ExtJS 6條形圖中設置標簽格式

[英]Format labels in an ExtJS 6 bar-chart

我使用了標簽的renderer屬性(分配給條形圖中的軸)來格式化值。 例如

axes = [{
    type: 'numeric',
    position: 'left',
    label: {
        renderer: function(v) {
            return String(v) + 'KB';
        }
    }
    ...

根據Ext.chart.label.Label手冊,此配置屬性已在較新版本中刪除。 如何在ExtJS版本6中實現此目的?

根據文檔,它在軸上而不是標簽本身,因此您的配置可能看起來像:

var axes = [
    {
        type: 'numeric',
        position: 'left',
        renderer: function(axis, data){
            return data.label + 'KB';
        },
        label: {
            // optional label style config.
        }
    }
    // ...
];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM