高图分组类别中的折线图和柱形图 [英] line and column chart in grouped categories in highcharts

查看:57
本文介绍了高图分组类别中的折线图和柱形图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要用分组的category.js绘制柱形图和折线图 下面是我的代码的链接

I am to plot column and line chart with grouped categories.js below is the link of my code

  $(function () {
var chart = new Highcharts.Chart({
    chart: {
        renderTo: "container",
        type: "column"
    },
    title: {
        text: null
    },
    series: [{"name":"market1","data":[1,3,3,0]},{"name":"market2","data":[0,0,0,0,3,2,3,0]},{"name":"market3","data":[3,1,3,0], type: 'line'}],
    xAxis: {
        categories:[{"name":"newyork","categories":["p1","p2","p3","p4"]},{"name":"washington","categories":["p1","p2","p3","p4"]}]
    },
     yAxis: [{ // Primary yAxis
            labels: {
                format: '{value}°C',
                style: {
                    color: '#89A54E'
                }
            },
            title: {
                text: 'Temperature',
                style: {
                    color: '#89A54E'
                }
            }
        }, { // Secondary yAxis
            title: {
                text: 'Rainfall',
                style: {
                    color: '#4572A7'
                }
            },
            labels: {
                format: '{value} mm',
                style: {
                    color: '#4572A7'
                }
            },
            opposite: true
        }],
});

});

下面是我的jsfiddle的链接

below is the link of my jsfiddle

http://jsfiddle.net/srikanth_kulkarni/gmrpY/

我正试图使market3(折线图)相对于降雨量(第二个y轴)而不是温度(第一个y轴)进行测量.

i am trying to get market3(line chart) to be measured against rainfall(second y axis) instead of temprature(first y axis).

任何建议都会很有帮助

关于, 斯里坎特·库尔卡尼(Srikanth Kulkarni)

Regards, Srikanth Kulkarni

推荐答案

提琴更新

您需要设置 yAxis:Number | String :

{"name":"market3","data":[3,1,3,0],yAxis:1, type: 'line'}],

索引从零开始;所以这里是yAxis 2的1.

index starts with zero; so 1 here for yAxis 2.

这篇关于高图分组类别中的折线图和柱形图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆