简体   繁体   English

Shopware 5、extjs条形图Y轴问题

[英]Shopware 5, extjs bar chart Y axis issue

In Shopware 5.7, I plot a chart through ext.js where y and x axis values come from db table.在 Shopware 5.7 中,我 plot 通过 ext.js 绘制了一个图表,其中 y 和 x 轴值来自 db 表。 The chart show random behaviors on the Y axis.该图表在 Y 轴上显示随机行为。

Please check the images to understand.请检查图像以了解。 It works perfectly until a certain value of y (ex 80) but after that bars value are not aligned with y-axis它可以完美运行,直到某个 y 值(例如 80),但之后条形值未与 y 轴对齐

I don't have any clue about this random behavior.我对这种随机行为一无所知。 Can I get a help from here?.我可以从这里得到帮助吗? enter image description here在此处输入图像描述

A function which fetch the maximum value available in the data object and assign it to the maximum property of y-axis solve my problem.一个 function 获取数据 object 中可用的最大值并将其分配给 y 轴的最大属性解决我的问题。

function getYMaximum()
    {
        var dataArray = me.getStore().data.items;
        var yMaximum = 100;
        for(var i=0; i<dataArray.length; i++)
        {
            if(parseInt(dataArray[i].data.amount, 10) > yMaximum)
            {
                yMaximum = dataArray[i].data.amount;
            }
        }
        return yMaximum;
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM