Jump to content

How To Remove The Decimal Portion From Y-Axis Of TUniChart?


Frederick

Recommended Posts

12 hours ago, Frederick said:

I have a TUniChart with a TUniBar3DSeries. The values assigned to the bar are all integers but the Y-axis shows decimal portions.

How do I remove them?

Note: I have included a testcase.

Hello,

Try this approach for now.

chtTran -> ClientEvents -> ExtEvents -> Ext.chart.CartesianChart [chart] -> function chart.redraw:

function chart.redraw(sender, eOpts) {
    this.axes[0].setRenderer(function(d, b, c, f) {
        if (Ext.isArray(d.cLables)) {
            var a = d.uLastIx;
            if (f === null) {
                a = 0
            }
            d.uLastIx = a + 1;
            if (a < d.cLables.length) {
                return d.cLables[a]
            }
        }
        if (d.hideLabel == true) {
            return ""
        }
        if (Ext.isNumber(b)) {
            return Ext.util.Format.number(b, "#")
        }
        return b
    })
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...