Jump to content

Radar Chart Axis A, max value = 7, MajorTickSteps = 1


JohanC

Recommended Posts

Hello,
I need some help please.
I am using theme uni_sencha_classic and ver. 1.90.0.1556 (paid version)
With a Radar chart, I use a table with values = SmallInt (max value of data =7 and min value of data =0)
I need to show a maximum value of 7 on the chart with intervals of 1
I set parameters Axis A, Major TickSteps = 1 and Max = 7
These parameters shows a Radar with value increments = 0.5 and Max = 6.5

image.png.9eea19e45f8f9947edb5bcbd061f103e.png

If I change the parameters Axis A, Major TickSteps = 1 and Max = 9
shows a Radar with value increments = 1

image.png.4dc42c2d1a2f8f36fc41bc2c14f5993a.png

My client insists to see Max = 7 with increments = 1
What settings should I change
Thank you very much
Johan

Link to comment
Share on other sites

1 hour ago, JohanC said:

OK thanks, I can imagine that you have many other Tasks, I have no doubt that you will find some time soon.

Thanks.

You can try this approach for now:

UniChart -> ClientEvents -> UniEvents -> [chart] -> 

function chart.beforeInit(sender, config) 
{    
    config.axes[0].renderer = 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

function chart.beforeInit(sender, config) 
{    
    config.axes[0].maximum = 7;
    config.axes[0].minimum = 1;
    config.axes[0].majorTickSteps = config.axes[0].maximum;
    
    config.axes[0].renderer = 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...