开发者社区> 问答> 正文

Highcharts 的 xAxis 中不定义 categories , 页面会报错?报错

$(function () {
    $('#fuck').highcharts({
        chart: {
            type: 'spline'
        },
        title: {
            text: '两地月平均温度'
        },
        subtitle: {
            text: '数据来源: WorldClimate.com'
        },
        xAxis: {
            type: 'linear'
        },
        yAxis: {
            title: {
                text: '温度'
            },
            labels: {
                formatter: function () {
                    return this.value + '°';
                }
            }
        },
        tooltip: {
            crosshairs: true,
            shared: true
        },
        plotOptions: {
            spline: {
                marker: {
                    radius: 4,
                    lineColor: '#666666',
                    lineWidth: 1
                }
            }
        },
        series: [{
            name: '东京',
            data: [[5, 2], [6, 3], [8, 2]]
        },{
            name: '南京',
            data: [[3, 2], [4, 7], [8, 5]]
        }]
    });
});

一样的代码,我新建一个程序就可以跑出来,但是在我原项目中,就会报错。

展开
收起
爱吃鱼的程序员 2020-06-08 11:30:03 505 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    报错有没有显示,是#多少的错误呢

    这个平台上回答Highcharts问题较少,建议直接在Highcharts中文官网论坛上提问哦

    1、Highcharts中文官网:https://www.hcharts.cn/

    2、Highcharts中文学习教程:https://www.hcharts.cn/docs

    3、Highcharts中文论坛:https://bbs.hcharts.cn/forum.php

    2020-06-08 11:30:23
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载

相关实验场景

更多