【问题标题】:Highcharts logarithmic chart not displaying series on webpageHighcharts 对数图表不在网页上显示系列
【发布时间】:2013-07-25 17:52:23
【问题描述】:

我正在尝试使用带有对数轴的 highcharts 柱形图在我的网页上显示一些数据。虽然它适用于某些数据,但在某些情况下,它会绘制图表而不显示系列。

在 JSfiddle 中,图表显示正确。这是一些示例代码:http://jsfiddle.net/3rcRh/1/

$(function () {
var mychart;
var ser1=[{"name":"Series1","data":
    [{"groupName":"Group1","low":1.0,"high":16.0,"x":27},{"groupName":"Group2","low":16.0,"high":17.0,"x":27},{"groupName":"Group3","low":17.0,"high":18.0,"x":27}] }];
 mychart = new Highcharts.Chart({

    chart: {
        renderTo: 'container',
        type: 'columnrange',
        inverted: true
    },

    title: {
        text: 'Selected Data'
    },

    subtitle: {
        text: 'Groups'
    },

    xAxis: {

        title: {
            text: 'Number of ELements'
        }
    },

    yAxis: {
        type: 'logarithmic',
        title: {
            text: 'Value Range'
        }
    },

    tooltip: {
        crosshairs: [true]

    },

    plotOptions: {
        series: {
            cursor: 'pointer',
            point: {
                events: {
                    click: function() {             

                        alert('clicked');
                    }
                }
            }
        },
        columnrange: {

        }
    },

    legend: {
        enabled: true
    },

    series: ser1

});

});

但是,即使在这里当我选择“共享全屏结果”时,我也会遇到同样的问题,数据不显示:http://jsfiddle.net/3rcRh/1/embedded/result/

当我从图表上下文菜单中以图像或 pdf 格式下载图表时,下载的文件包含正确的图表图像。

我已经在我的网页上包含了所有必要的脚本,但我不知道出了什么问题。任何帮助将不胜感激!

【问题讨论】:

  • 您的 jsFiddle 代码页面和 jsFiddle 共享页面都为我展示了该系列。你是在什么浏览器中遇到这个问题的。我在 FF 上。
  • 在 FF、Chrome 和 IE 上试过...

标签: highcharts highstock


【解决方案1】:

这很奇怪,报告here - 谢谢!

您可以解决此问题:

  • columnrange 更改为column
  • 数据从high更改为y
  • yAxis: 1 设置最小值

工作示例:http://jsfiddle.net/3rcRh/2/

【讨论】:

    猜你喜欢
    • 2013-02-12
    • 1970-01-01
    • 2018-02-09
    • 2016-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多