dougong9987 2013-04-10 04:36
浏览 39

jqplot条形图中最后一个条形的标签未显示

I am having a strange issue in jqplot bar chart. THe bar chart label in last bar is displaying sometimes and disappearing other times. I have added a screen shot and my script.!

Here is the script i have used.

  plot1 = $.jqplot('chart1', [s1], {
                    // Only animate if we're not using excanvas (not in IE 7 or IE 8)..
                    animate: !$.jqplot.use_excanvas,
                    seriesColors:<?php echo json_encode($barColor ); ?>,
                    <?php if(isset($_POST['additionalSubmit'])){ ?>
                    negativeSeriesColors: ["#792A86"],
                    <?php } else { ?>
                    negativeSeriesColors: <?php echo json_encode($barColornegative ); ?>,
                    <?php } ?>
                    seriesDefaults:{
                        renderer:$.jqplot.BarRenderer,
                        rendererOptions: { 
                            fillToZero: true,
                            barWidth: 30,
                            varyBarColor :true
                        },
                        pointLabels: { 
                            show: true,
                            formatString :"&#8364; %'s",
                            escapeHTML: false
                            }
                    },
                    canvasOverlay: {
                        show: true,
                        objects: [
                           {horizontalLine: {
                                name: 'zeroline',
                                y: 0,
                                lineWidth: 2,
                                xOffset: 0,
                                color: '#BBCCDD',
                                shadow: false
                            }}
                        ]
                        },
                    axes: {
                        xaxis: {
                            autoscale:true,
                            renderer: $.jqplot.CategoryAxisRenderer,
                            ticks: ticks,
                            tickRenderer: $.jqplot.CanvasAxisTickRenderer,
                            tickOptions: {
                                fontSize: '8pt',
                                fontWeight: 'normal',
                                angle:-20,

                            },  
                            borderColor: "#BBCCDD",
                            borderWidth:5
                        },
                        yaxis: {
                            autoscale:true,
                            tickOptions:{ prefix: '&#8364;' , formatString: "%'d",} ,
                            borderColor: "#BBCCDD",
                            borderWidth:5,
                            label: 'resultant in EURO',
                            labelRenderer: $.jqplot.CanvasAxisLabelRenderer
                        }
                    },
                    legend: {
                        show: true,
                        placement: 'outside',
                        noColumns: 1
                    },
                    series: [
                             {
                                 fill: true,
                                 label: '<?php echo $_POST['scenario']; ?>'
                             }
                         ],
                    highlighter: { show: false }
                });

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • duanqian3953 2013-08-15 13:13
    关注

    The labels will not show when they 'hit' the edges. To avoid this detection, set the edgeTolerance for your pointLabels like this:

    pointLabels: { 
        show: true,
        formatString :"&#8364; %'s",
        escapeHTML: false,
        edgeTolerance: -100
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?