Highcharts 对数图表
下图是一个 Highcharts 对数图表
下面的代码列出了 Highcharts 对数图表 的基本配置
<!doctype html> <meta charset="utf-8" /> <title>Highcharts 基础教程 | 简单教程(www.twle.cn)</title> <script src="https://cdn.hcharts.cn/highcharts/highcharts.js"></script> <div id="container" style="width: 500px; height: 400px; margin: 0 auto"></div> <script> var title = { text: '对数图表范例' }; var subtitle = { text: '来源: 简单教程 ( www.twle.cn )' }; var xAxis = { tickInterval: 1 }; var yAxis = { type: 'logarithmic', minorTickInterval: 0.1 }; var tooltip = { headerFormat: '<b>{series.name}</b><br>', pointFormat: 'x = {point.x}, y = {point.y}' }; var plotOptions = { spline: { marker: { enabled: true } } }; var series= [{ name: 'data', data: [1, 2, 4, 8, 16, 32, 64, 128, 256, 512], pointStart: 1 } ]; var options = {}; options.title = title; options.subtitle = subtitle; options.xAxis = xAxis; options.yAxis = yAxis; options.tooltip = tooltip; options.plotOptions = plotOptions; options.series = series; var chart = Highcharts.chart('container',options); </script>
以上范例输出如下