来自 Highfaces 的图表不起作用
Chart from Highfaces dosen't work
为什么上面的代码有效而下面的折线图却不行?
两个示例均来自 bootsfaces.net 站点。
饼图显示正确,但折线图只有标题 shown.Both 共享相同的 bean 属性
<b:row>
<b:column col-md="6" col-xs="6">
<hf:chart type="pie" title="Series with individual lists">
<hf:chartSerie name="Boys" value="#{lineChartBean.boys}"
var="point" point="#{point.amount}" tickLabel="#{point.year}"
dataLabel="{point.name}: {point.percentage:.1f} % ({point.y})" />
</hf:chart>
</b:column>
<b:column col-md="6" col-xs="6">
<hf:chart type="line" value="# {lineChartBean.boys}" var="birth"
xaxisLabel="Years" point="# {birth.amount}"
tickLabel="# {birth.year}" title="List of Pojos" />
</b:column>
</b:row>
原因很简单:您没有去掉下图中#和{之间的空格。空格源自 highfaces 演示中的代码格式化工具,但不应成为您在应用程序中使用的实际代码的一部分。
代码中正确的标记应如下所示:
<hf:chart type="line" value="#{lineChartBean.boys}" var="birth"
xaxisLabel="Years" point="#{birth.amount}"
tickLabel="#{birth.year}" title="List of Pojos" />
为什么上面的代码有效而下面的折线图却不行? 两个示例均来自 bootsfaces.net 站点。 饼图显示正确,但折线图只有标题 shown.Both 共享相同的 bean 属性
<b:row>
<b:column col-md="6" col-xs="6">
<hf:chart type="pie" title="Series with individual lists">
<hf:chartSerie name="Boys" value="#{lineChartBean.boys}"
var="point" point="#{point.amount}" tickLabel="#{point.year}"
dataLabel="{point.name}: {point.percentage:.1f} % ({point.y})" />
</hf:chart>
</b:column>
<b:column col-md="6" col-xs="6">
<hf:chart type="line" value="# {lineChartBean.boys}" var="birth"
xaxisLabel="Years" point="# {birth.amount}"
tickLabel="# {birth.year}" title="List of Pojos" />
</b:column>
</b:row>
原因很简单:您没有去掉下图中#和{之间的空格。空格源自 highfaces 演示中的代码格式化工具,但不应成为您在应用程序中使用的实际代码的一部分。
代码中正确的标记应如下所示:
<hf:chart type="line" value="#{lineChartBean.boys}" var="birth"
xaxisLabel="Years" point="#{birth.amount}"
tickLabel="#{birth.year}" title="List of Pojos" />