簡體   English   中英

需要加入x軸和y軸標簽高圖

[英]Need to join x axis and y axis label highcharts

我正在嘗試連接區域樣條圖的x軸和y軸的節點。 這是我的小提琴 ,我還需要在左上角移動標題和副標題,並需要集成下拉菜單。 基本上我需要這樣的圖 在此處輸入圖片說明

Highcharts.chart('container', {
    chart: {
        type: 'areaspline'
    },
    title: {
        text: 'Total Visitors',
        x: 0,
    },
    subtitle: {
      text: 'This is all users that visited your site',
        x: 0,
    },
    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
    },
    yAxis: {
        title: {
            text: ''
        }
    },
    tooltip: {
        shared: true,
        valueSuffix: ' units'
    },
    credits: {
        enabled: false
    },
    plotOptions: {
        areaspline: {
            fillOpacity: 0.5
        },
        series: {
          marker: {
            enabled: false
          },
          lineWidth: 2,
          states: {
            hover: {
              enabled: false
            }
          }
        }
    },
    series: [{
      lineColor: '#8b8bff',
            color: '#c5c6ff',
            showInLegend: false,
            lineWidth: '4px',
        name: 'John',
        data: [37, 25, 50, 20, 37, 28, 50, 42, 70, 46, 55, 26]
    }]
})

請幫忙,謝謝!!!

要在同一位置啟動坐標軸刻度,請將tickmarkPlacement設置為on ,同時還要設置minmax

要將標題和字幕移動到左上角,請使用align屬性:

title: {
    ...,
    align: 'left'
},
subtitle: {
    ...,
    align: 'left'
},
xAxis: {
    tickmarkPlacement: 'on',
    min: 0.5,
    max: 10.5,
    ...
}

現場演示: https : //jsfiddle.net/BlackLabel/w7p6rL8o/

API參考: https//api.highcharts.com/highcharts/title.align

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM