• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
黄洪波写点东西的地方
博客园    首页    新随笔    联系   管理    订阅  订阅
HCharts随笔之简单入门

此处可以对比我的另一个Echars简单入门

直接上源码

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
    <title>HCharts</title>
    <script src="https://cdn.hcharts.cn/highcharts/highcharts.js"></script>
</head>
<body>
    <!-- 为HCharts准备一个具备大小(宽高)的Dom -->
    <!--<div id="container" style="width: 400px;height:400px;"></div>-->
    <div id="container" style="width: 600px;min-width:400px;height:400px"></div>
    <script type="text/javascript">
        // 基于准备好的dom,初始化echarts实例
        var chart = Highcharts.chart('container',{
            chart: {
                type: 'column'
            },
            credits: {                
                //去除highcharts的水印链接
                enabled:false
            },
            title: {
                text: 'HCharts 入门示例'
            },
            xAxis: {
                categories: [
                    '衬衫','羊毛衫','雪纺衫','裤子','高跟鞋','袜子'
                ],
            },
            yAxis: {
                min: 0,
                title: {
                    text: '销量'
                }
            },
            series: [{
                name: '销量',
                data: [5, 20, 36, 10, 10, 20]
            }]
        });
    </script>
</body>
</html>

显示效果:

 

 

posted on 2018-09-19 12:53  红无酒伤  阅读(366)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3