echarts 柱状图 上方显示数据问题

一直在路上123 发布于 2013/11/13 14:55
阅读 50K+
收藏 0
@Kener-林峰   我想在柱状图上方显示数据,设置itemStyle 显示不出来,而且同样可以显示上方数据的代码贴过来也不能显示出来,帮忙看下,谢谢。

     require.config({
         packages: [
         {
             name: 'echarts',
             location: 'js/echarts/src',
             main: 'echarts'
         },
         {
             name: 'zrender',
             location: 'js/zrender/src', // zrender与echarts在同一级目录
             main: 'zrender'
         }
     ]
     });


     // Step:4 require echarts and use it in the callback.
     // Step:4 动态加载echarts然后在回调函数中开始使用,注意保持按需加载结构定义图表路径
     require(
         [
             'echarts',
             'echarts/chart/bar',
            'echarts/chart/line'
         ],
         function (ec) {
             var myChart = ec.init(document.getElementById('chartArea'));
             option = {
                 // color:['#0000ff','#ff0000'],
                 title: {
                     text: 'RUNIN/SWDL区'
                     // subtext: '纯属虚构'
                 },

                 tooltip: {
                     trigger: 'axis',

                     textStyle: { fontSize: '30px' }
                 },
                 legend: {
                     data: ['A/P FPY', 'Yield Goal'],

                     textStyle: { color: '#000000',
                         fontSize: '20px'
                     }
                 },
                 toolbox: {
                     orient: 'vertical',
                     show: true,
                     feature: {
                         dataZoom: true,
                         mark: true,
                         dataView: { readOnly: false },
                         magicType: ['line', 'bar'],
                         restore: true,
                         saveAsImage: true
                     }
                 },
                 dataZoom: {
                     backgroundColor: '#eee',
                     dataBackgroundColor: '#ccc',
                     fillerColor: 'rgba(50,205,50,0.4)',
                     handleColor: 'rgba(70,130,180,0.8)',
                     show: true
                 },
                 calculable: true,
                 xAxis: [
         {
             type: 'category',
             data: ['第一节课', '第二节课', '第三节课', '第四节课', '第五节课'],
             axisLabel: {
                 show: true,
                 interval: 'auto',

                 textStyle: {
                     color: '#000000',
                     fontFamily: 'verdana',
                     fontSize: 20,
                     fontStyle: 'normal',
                     fontWeight: 'bold'
                 }
             }
         }

     ],
                 yAxis: [
         {

             splitNumber: '5',
             type: 'value',
             splitArea: { show: true },
             axisLabel: {
                 show: true,
                 interval: 'auto',
                 formatter: '{value} %',
                 textStyle: {
                     color: '#000000',
                     fontFamily: 'verdana',
                     fontSize: 20,
                     fontStyle: 'normal',
                     fontWeight: 'bold'
                 }
             }

         }
     ],
                 series: [
         {
             name: 'A/P FPY',
             type: 'bar',
             itemStyle: {
                 normal: {
                     label: {
                         show: true,
                         textStyle: {
                             color: '#800080'
                         }
                     }
                 }
             },
             data: [80, 80, 80, 80, 80],
             barWidth: 50
         },
         {
             name: 'Yield Goal',
             type: 'bar',
             data: [90, 90, 90, 90, 90],
             barWidth: 30
         }
     ]
             };


             myChart.setOption(option);
         }
     );

加载中
0
Kener-林峰
Kener-林峰

没更新吧?1.3.0才有这个功能,我用你的option直接就出来了

0
一直在路上123
一直在路上123
@Kener-林峰  是版本问题,现在可以了,非常感谢。另外想问一下,模块化导入和单文件引入的知识,两者效果有什么不同?谢谢。
0
Kener-林峰
Kener-林峰
性能优化啊,肯定最后都得压缩合并,就看你自己项目规模,习惯,是你们自己压缩还是用我们压缩好的,功能都一样
返回顶部
顶部