高图图例显示管道异常

时间:2018-08-09 10:27:56

标签: javascript jquery highcharts

当我启用图例时,它会显示一条使我烦恼的尴尬线条,我进行了很多搜索,但找不到任何包含此线条的示例,第二个问题是图表背景。背景应为白色。 / p>

代码:

var  type = 'column';
    ChartSelectorObj[ChartID] = new Highcharts.Chart(Div,{
        chart: {
            backgroundColor: 'white',
            type: type,
            events: {
                drilldown: function (e) {
                    if (!e.seriesOptions) {
                        var chart = this;

                        setTimeout(function () {
                            if (e.point.drillDownSerieData != null) {
                                debugger;
                                chart.hideLoading();
                                chart.addSeriesAsDrilldown(e.point, e.point.drillDownSerieData[0]);
                            }
                        }, 10);
                    }

                }
            }
        },
        title: {
            text: ''
        },
        credits: {
            enabled: false
        },
        xAxis: {
            type: 'category'
        },
        yAxis: {
            title: {
                text: ''
            }
        },
        legend: {
          enabled:true
        },
        plotOptions: {
            series: {
                //stacking: 'normal',
                borderWidth: 0,
                dataLabels: {
                    enabled: true,
                    format: '{point.y:,.0f}'
                }
            }
        },
        series: [{
            colorByPoint: true,
            dashStyle: 'Solid'
        }]
        ,
        tooltip: {
            headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
            pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:,.0f}</b> of total<br/>'
        }

    });

Screenshot of my chart

1 个答案:

答案 0 :(得分:0)

如果需要禁用色轴,则取决于您在哪里定义它。可以在常规图表配置对象中将其定义为colorAxis或在series内部进行定义,但是在大多数情况下,它是第一个选项,因此您只需要删除colorAxis定义

API参考:https://api.highcharts.com/highcharts/colorAxis

亲切的问候!

相关问题