English 中文(简体)
减少第4号综合材料下可见标签的数量
原标题:Decrease the number of visible labels under Ext JS 4 chart

I mpaper Ext JS 4 line图组件。 它工作得很好,但当我贴上标语时,他们太密集。 我赢得了明显标记的数量,以便减少。 如何做到这一点? 我的轴心是:

{
    type:  Category ,
    position:  bottom ,
    fields: [ date ],
    grid: true,
    label: {
        field:  label ,
        rotate: { degrees:315 },
        renderer: function(item) {
            var date = new Date(item);
            /* parseIntToStringWithZeros is a custom method somewhere else */
            var day = parseIntToStringWithZeros(date.getDate());
            var month = parseIntToStringWithZeros(date.getMonth());
            result = day +  -  + month;
            return result;
        }
    }
}
最佳回答

I think you might need to use a "Numeric" axis instead of a "Category" axis a start (not sure what your data looks like, but you might need to convert times to values to get it to work).

With the numeric axis you are supposed to be able to set the number of major tick values (where the grid lines and labels appear), by setting the steps property in the axis config; however this doesn t always work. A more surefire way is to override the applyData function which isn t documented so you need to search through the dev code to see what it s doing.

此外,为了不给某个特定标签,你只能收回标签上的空洞功能。 例如,如果你只想用个人“月”在上述法典中一劳永逸的话,你就可以这样做。

label: {
    ....
    renderer: (function(){
       var lastRenderedMonth =   ;
       return function(item){
           ... //your code above without the return..
           if(month == lastRenderedMonth)
              return "";
           lastRenderedMonth = month;
           return result;
       };
    })(),
    ...
问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签