0

Ext.draw.Text... を使用して、Ext チャートのカスタム凡例パネルを作成しました。私のアプリケーションでは、凡例に長いカスタム テキストが含まれている場合があります。したがって、固定長を使用してそれらを分割する必要があります。1 つの方法は、Javascript を使用してテキストを 2 つに分割し、テキストの各部分にテキスト スプライトを作成することです。

Ext.draw.Text でテキストを分割する他の方法はありますか?

コード:

Ext.create('Ext.draw.Component', {
    renderTo: Ext.getBody(),
    width: 800,
    height: 200,
    items: [{
        type: 'rect',
        fill: 'red',     
        width: 12,
        height: 12,
        x: 5,
        y: 10
    },{
        type: "text",
        text: "This is a long text.. Can i split this into two tspan",
        fill: "green",
        width: 12,
        height: 12,
        font: "18px monospace",        
        x: 25,
        y: 15
    }]
});

前もって感謝します。

4

1 に答える 1