Echarts可视化教程

  1. 网站首页
  2. 百度ECharts
  3. ECharts实例
  4. ECharts入门
  5. 地图大全
  6. ECharts官网

如何利用Highcharts创建温度计图表

var options = {
  chart: {
    renderTo: 'container',
    type: 'gauge',
    plotBackgroundColor: null,
    plotBackgroundImage: null,
    plotBorderWidth: 0,
    plotShadow: false
  },
  title: {
    text: 'Temperature'
  },
  pane: {
    startAngle: -150,
    endAngle: 150,
    background: [{
      backgroundColor: {
        linearGradient: {
          x1: 0,
          y1: 0,
          x2: 0,
          y2: 1
        },
        stops: [
        [0, '#FFF'],
        [1, '#333']
        ]
      },
      borderWidth: 0,
      outerRadius: '109%'
    },
    {
      backgroundColor: {
        linearGradient: {
          x1: 0,
          y1: 0,
          x2: 0,
          y2: 1
        },
        stops: [
        [0, '#333'],
        [1, '#FFF']
        ]
      },
      borderWidth: 1,
      outerRadius: '107%'
    },
    {
      // default background
    },
    {
      backgroundColor: '#DDD',
      borderWidth: 0,
      outerRadius: '105%',
      innerRadius: '103%'
    }
    ]
  },
  // the value axis
  yAxis: {
    min: -20,
    max: 40,
    minorTickInterval: 'auto',
    minorTickWidth: 1,
    minorTickLength: 10,
    minorTickPosition: 'inside',
    minorTickColor: '#666',
    tickInterval: 10,
    tickWidth: 2,
    tickPosition: 'inside',
    tickLength: 12,
    tickColor: '#666',
    labels: {
      step: 2,
      rotation: 'auto'
    },
    title: {
      text: '°C'
    },
    plotBands: [{
      from: -20,
      to: 0,
      color: '#9CCC65' // green
     },
     {
      from: 0,
      to: 10,
      color: '#FFEB3B' // yellow
     },
     {
      from: 10,
      to: 20,
      color: '#FFC107' // orange
     },
     {
      from: 20,
      to: 30,
      color: '#FF5722' // red
     },
     {
      from: 30,
      to: 40,
      color: '#F44336' // dark red
     }]
  },
  series: [{
    name: 'Temperature',
    data: [20],
    tooltip: {
      valueSuffix: ' °C'
     }
  }]
};
var chart = new Highcharts.Chart(options);
点击展开全文

相关文章

  1. 如何利用Highcharts中使用烛台图来展示数据
  2. 如何利用Highcharts中使用盒须图来展示数据
  3. 如何利用Highcharts创建一个雷达图表
  4. 如何利用Highcharts语法插入漂亮的图表