primefaces条形图:在条形图上显示数据点 [英] primefaces barchart : displaying data point on bar

查看:142
本文介绍了primefaces条形图:在条形图上显示数据点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在条形图中的条形上显示数据点?

how can I display data point on bar in barchart?

我不想使用datatip或tooltip,它们仅在将鼠标悬停在数据点上时才会突出显示数据点.

I don't want to use datatip or tooltip which will highlight data points only when they are moused over.

我想始终在栏上显示数据点.

I want to display the data point always on the bar.

有什么正确的方法来获得它吗?

is there any right way to get it?

谢谢.

我想要这样

以下是我的代码

<p:barChart id="barChartId" value="#{myBean.myModel}"             
        orientation="horizontal"             
        stacked="true" extender="ext" animate="true" shadow="false" />              
<h:outputScript>         
  function ext() {  
    this.cfg.highlighter = {
             useAxesFormatters: false,
             tooltipAxes: 'x'   
    };      
    this.cfg.legend = {
            show: true,
            location: 'ne',
            placement: 'outside'
    }; 
    this.cfg.seriesDefaults = {
            pointLabels : { show: true },
    };              
  }        
</h:outputScript>

在这里,荧光笔和图例工作正常,但点标签未显示在条形图上

here, highlighter and legend are working fine but point labels are not displaying on bar

推荐答案

不确定是否可以使用...

Not sure if it will work...

使用<p:barChartextender,就像这样:

<p:barChart value="#{myBean.myModel}" widgetVar="myBarChart" extender="my_ext"/>


<script type="text/javascript">
    function my_ext() {
        this.cfg.seriesDefaults = {
            renderer:$.jqplot.BarRenderer,
            pointLabels: {show: true}
        };
        this.cfg.stackSeries: true;
    }
</script>

或这个

<script type="text/javascript">
    function my_ext() {
        this.cfg.seriesDefaults = {
            pointLabels: {show: true}
        };
        this.cfg.stackSeries: true;
    }
</script>


也请看一下jqplot示例:条形图

这篇关于primefaces条形图:在条形图上显示数据点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆