2015-04-22 45 views
4

我一直在使用(http://nicolas.kruchten.com/pivottable)pivottable.js在我的应用程序之一。该表已被罚款,但我面临的问题,同时添加响应我的用户界面。该表不会缩小到使用媒体查询为小视图端口定义的div大小。不管视角如何,表格总是绘制成相同的尺寸。 此外,表的列的宽度似乎是不可更改的。我试图改变pivot.css中col的定义类,但似乎没有办法。增加对枢轴表的响应

table.pvtTable .pvtColLabel {text-align: center; width:50px;} 
table.pvtTable .pvtTotalLabel {text-align: right; width: 50px;} 

而且下面是如何我已经使用上所在的表被绘制在“图表”类的DIV媒体查询:

@media (min-width: 320px) and (max-width: 640px) { 

    /*Making gray box span across the screen*/ 
    body { 
     padding-left: 0px; /*changed to avoid hz scroll on mobile device*/ 
     padding-right: 0px; /*changed to avoid hz scroll on mobile device*/ 
     padding-top: 0px; 
    } 
    #console { 
     /* Negative indent footer by it's height */ 
    margin: 0px auto -40px; 
} 
.graph { 
    width:250px; 
    height:270px; 
} 
.wrapper-gray{ 
    background-color: #ebebeb; 
    padding: 5px; 
} 


.section-box{ 
    background-color: #fff; 
    padding: 5px; 
} 
} 

请指引我,如果我错了地方。

回答

1

图表的尺寸被固定在创建时间和经PivotUI的renderOptions参数控制。例如:

rendererOptions: { 
    c3: { 
     size: { height:200, width:200} 
    } 
} 

来源:Issue 487