最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Highcharts multiple x-Axis without multiple series? - Stack Overflow

programmeradmin0浏览0评论

This fiddle uses multiple series and displays an axis for each of them. Is it possible to use a single series to make several Axes? .9.1/highslide-software/highcharts/tree/master/samples/highcharts/demo/bo-multi-axes/

xAxis:[{
        categories:setup.x_mixed,
        maxZoom:5,
        minPadding: 0.2,
        labels:{
          "enabled":setup.categories_label,
          "y":1,
          "style":{
            "fontSize":13,
            "color":"#999",
            fontFamily:"'helvetica neue',helvetica",
            whiteSpace:"nowrap",
            textOverflow:"clip",
            width:"100%",
            marginTop:legendSpacing
          },
          formatter:function () {
            return this.value.split("|")[0]
          }
        },
        lineColor:"rgba(255,255,255,0)",
        tickWidth:0,
        offset:0
      }, { // Secondary yAxis
        categories:setup.x_mixed,
        maxZoom:5,
        minPadding: 0.2,
        labels:{
          "enabled":setup.categories_label,
          "y":16,
          "style":{
            "fontSize":13,
            "color":"#999",
            fontFamily:"'helvetica neue',helvetica",
            whiteSpace:"nowrap",
            textOverflow:"clip",
            width:"100%",
            marginTop:legendSpacing
          },
          formatter:function () {
            return this.value.split("|")[1]
          }
        },
        lineColor:"rgba(255,255,255,0)",
        tickWidth:0,
        offset:0

        }],

This fiddle uses multiple series and displays an axis for each of them. Is it possible to use a single series to make several Axes? http://jsfiddle/gh/get/jquery/1.9.1/highslide-software/highcharts./tree/master/samples/highcharts/demo/bo-multi-axes/

xAxis:[{
        categories:setup.x_mixed,
        maxZoom:5,
        minPadding: 0.2,
        labels:{
          "enabled":setup.categories_label,
          "y":1,
          "style":{
            "fontSize":13,
            "color":"#999",
            fontFamily:"'helvetica neue',helvetica",
            whiteSpace:"nowrap",
            textOverflow:"clip",
            width:"100%",
            marginTop:legendSpacing
          },
          formatter:function () {
            return this.value.split("|")[0]
          }
        },
        lineColor:"rgba(255,255,255,0)",
        tickWidth:0,
        offset:0
      }, { // Secondary yAxis
        categories:setup.x_mixed,
        maxZoom:5,
        minPadding: 0.2,
        labels:{
          "enabled":setup.categories_label,
          "y":16,
          "style":{
            "fontSize":13,
            "color":"#999",
            fontFamily:"'helvetica neue',helvetica",
            whiteSpace:"nowrap",
            textOverflow:"clip",
            width:"100%",
            marginTop:legendSpacing
          },
          formatter:function () {
            return this.value.split("|")[1]
          }
        },
        lineColor:"rgba(255,255,255,0)",
        tickWidth:0,
        offset:0

        }],
Share Improve this question edited Nov 22, 2013 at 1:35 natecraft1 asked Nov 22, 2013 at 1:14 natecraft1natecraft1 2,8469 gold badges41 silver badges58 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

You can also use linkedTo paramtetr on extra axis http://api.highcharts./highcharts#yAxis.linkedTo

its pretty simple,

declare 2 xAxis same like the yAxis you mentioned in the example with one of them as opposite:true

As you have only one series set the second axis extremes same as the first one using getExtremes() and setExtremes(), as shown in this fiddle here http://jsfiddle/W43Zb/

Hope this will help you

发布评论

评论列表(0)

  1. 暂无评论