2014-10-17 86 views
0

帮助,如何获取饼图标题三角形而不是百分比。 本示例的文档非常快速,没有使用文本而不是数字。我无法在JQChart中显示标签?

我有一个代码:

   $('#jqChart').jqChart({ 
        legend: { visible: false }, 
        animation: { duration: 1 }, 
        series: [ 
         { 
          type: 'pie', 
          fillStyles: ['#418CF0', '#FCB441', '#E0400A', '#056492', '#BFBFBF'], 
          labels: { 
           stringFormat: '%s', 
           valueType: 'dataValue', 
           font: '15px sans-serif', 
           fillStyle: 'white' 
          }, 
          data: [['N', 65], ['A', 58], ['B', 30], 
           ['F', 60], ['C', 65]] 
         } 
        ] 
       }); 

我有形象,有足够的显示,我要改变。 http://i57.tinypic.com/158babt.jpg

我已经尝试了很多选项,更改stringFormat,但不幸的是它不起作用。我做错了什么,谢谢你的帮助。

回答

0
$('#jqChart').bind('dataPointLabelCreating', function (event, data) { 
       data.text = data.context.dataItem[0]; 
      }); 


      $('#jqChart').jqChart({ 
       legend: { visible: false }, 
       animation: { duration: 1 }, 
       series: [ 
        { 
         type: 'pie', 
         fillStyles: ['#418CF0', '#FCB441', '#E0400A', '#056492', '#BFBFBF'], 
         labels: { 
          stringFormat: '%s', 
          valueType: 'dataValue', 
          font: '15px sans-serif', 
          fillStyle: 'white' 
         }, 
         data: [['N', 65], ['A', 58], ['B', 30], 
         ['F', 60], ['C', 65]] 
        } 
       ] 
      });