首页 > 解决方案 > Need help on viewing Chart values

问题描述

Column charts are working fine. But I am facing one issue while viewing the chart values. If two values are having a big difference between them, the lower value is not shown in the charts (which means it is showing there but I am not able to witness it) refer https://jsfiddle.net/g18evj5x/1/:

Highcharts.chart('container', {
    chart: {
        type: 'column'
    },
    title: {
        text: 'Monthly Average Rainfall'
    },
    subtitle: {
        text: 'Source: WorldClimate.com'
    },
    xAxis: {
        categories: [
            'Jan'
        ],
        crosshair: true
    },
    yAxis: {
        min: 0,
        title: {
            text: 'Rainfall (mm)'
        }
    },
    tooltip: {
        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
            '<td style="padding:0"><b>{point.y:.1f} mm</b></td></tr>',
        footerFormat: '</table>',
        shared: true,
        useHTML: true
    },
    plotOptions: {
        column: {
            pointPadding: 0.2,
            borderWidth: 0
        }
    },
    series: [{
        name: 'Tokyo',
        data: [1000]

    }, {
        name: 'New York',
        data: [2]

    }, {
        name: 'London',
        data: [4]

    }, {
        name: 'Berlin',
        data: [6]

    }]
});

thanks.

标签: javascripthighcharts

解决方案


另一种解决方案可能是你使用这样的dataLabels Api 链接

plotOptions: {
  column: {
    // minPointLength: 2, // You could use both solutions
    dataLabels:{
      enabled:true
    }
  }
}

小提琴


推荐阅读