Primefaces折线图始终使用最小宽度和高度

时间:2015-11-13 16:13:43

标签: css jsf primefaces

我有两个使用Primefaces控制的折线图(JSF 2.0,JavaEE 7和Glassfish 4.1上的Primefaces 5.2)。我希望他们根据窗口大小调整其大小(适合窗口)。但是,即使窗口尺寸大得多,它们似乎也使用最小尺寸。这会在屏幕上留下很多空白区域。

相关的JSF代码:

      <p:layout>
    <p:layoutUnit styleClass="north-layout" position="north">
      <h:outputLink value="someLink" target="_blank"><p:graphicImage name="img/myLogo.jpeg" alt="default"/></h:outputLink>
     </p:layoutUnit>

    <p:layoutUnit position="center" class="my-center-layout" size="auto" resizable="true">    
      <p:panelGrid columns="2" class="chart-panel-grid">
        <p:panel class="my-chart-panel">
          <p:chart type="line" model="#{myController.newModel}" responsive="true"  id="newChart" class="my-line-chart"/>
        </p:panel>
        <p:panel class="my-chart-panel">
          <p:chart type="line" model="#{myController.usedModel}" responsive="true"  id="usedChart" class="my-line-chart"/>
        </p:panel>
      </p:panelGrid>
    </p:layoutUnit>
  </p:layout>

CSS代码:

.my-center-layout {
  height: auto;
  width: auto;
  float: left;
}

.my-chart-panel {
  height: auto;
  width:  auto; 
  border: none;  
}

.my-line-chart {
  height: auto; 
  min-height: 200px;
  width:  auto;
  min-width: 200px;
  border: none;  
}

0 个答案:

没有答案
相关问题