首页 文章

在jQuery中防止条形图重叠categoryAxis?

提问于
浏览
0

enter image description here

这种CategoryAxis在条形图中使用jQuery - 它可能与否?

有谁知道如何在条形图上显示这种方式?请分享 ...

1 回答

  • 0
    categoryAxis: {
    
                field: "PropertyName",
                majorGridLines: {
                    visible: false
                },
                //visible: true,
                labels: {
    
                    visible: true,
                    //rotation: "270"
    
                    visual: function(e) {
    
    
    
                        var html =$('<span  class="unselcteddiv">'+capitalise(e.value) + '</span>').appendTo(document.body));
    
                        // Create an empty group that will hold the rendered label
                        var visual = new kendo.drawing.Group();
    
                        // Store a reference to the target rectangle, see below
                        var rect = e.rect;
                        if(e.dataItem.ShareDiff<0)
                        {
                            // debugger;
    
                            rect.origin.x =rect.origin.x>0?Math.abs(rect.origin.x)+Math.abs(rect.size.width)+20:rect.origin.x;
                        }
                        kendo.drawing.drawDOM(html)
                                      .done(function(group) {
                                          // Clean-up HTML fragment
                                          html.remove();
    
                                          // Center the label using Layout
                                          var layout = new kendo.drawing.Layout(rect, {
                                              justifyContent: "right"
                                          });
                                          layout.append(group);
                                          layout.reflow();
                                          // Render the content
                                          visual.append(layout);
                                      });
    
                        return visual;
    
                    }
    
                }
            },
    

    我可以使用这个代码工作正常 . 我希望在这类问题上对每个人都充分利用......

相关问题