highcharts 折线,饼状,条状综合图

完整代码如下:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>综合图</title>

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/highcharts.js"></script>
<script type="text/javascript" src="js/exporting.js"></script>
<script type="text/javascript">
    $(function () {
        $(‘#container‘).highcharts({
            chart: {
            },
            title: {
                text: ‘折线,饼状,条状综合图‘
            },
            //x轴
            xAxis: {
                categories: [‘Apples‘, ‘Oranges‘, ‘Pears‘, ‘Bananas‘, ‘Plums‘]
            },
            tooltip: {
                formatter: function () {
                    var s;
                    if (this.point.name) { // the pie chart
                        s = ‘‘ +
                        this.point.name + ‘: ‘ + this.y + ‘ fruits‘;
                    } else {
                        s = ‘‘ +
                        this.x + ‘: ‘ + this.y;
                    }
                    return s;
                }
            },
            labels: {
                items: [{
                    html: ‘Total fruit consumption‘,
                    style: {
                        left: ‘40px‘,
                        top: ‘8px‘,
                        color: ‘black‘
                    }
                }]
            },
            series: [{
                type: ‘column‘,
                name: ‘Jane‘,
                data: [3, 2, 1, 3, 4]
            }, {
                type: ‘column‘,
                name: ‘John‘,
                data: [2, 3, 5, 7, 6]
            }, {
                type: ‘column‘,
                name: ‘Joe‘,
                data: [4, 3, 3, 9, 0]
            }, {
                type: ‘spline‘,
                name: ‘Average‘,
                data: [3, 2.67, 3, 6.33, 3.33],
                marker: {
                    lineWidth: 2,
                    lineColor: Highcharts.getOptions().colors[3],
                    fillColor: ‘white‘
                }
            }, {
                type: ‘pie‘,
                name: ‘Total consumption‘,
                data: [{
                    name: ‘Jane‘,
                    y: 13,
                    color: Highcharts.getOptions().colors[0] // Jane‘s color
                }, {
                    name: ‘John‘,
                    y: 23,
                    color: Highcharts.getOptions().colors[1] // John‘s color
                }, {
                    name: ‘Joe‘,
                    y: 19,
                    color: Highcharts.getOptions().colors[2] // Joe‘s color
                }],
                center: [100, 80],
                size: 100,
                showInLegend: false,
                dataLabels: {
                    enabled: false
                }
            }]
        });
    });
</script>

</head>
<body>
    <div id="container" style="width:850px;height:500px;margin:0 auto"></div>
</body>
</html>

显示出来的效果

现在一个折线,饼状,条状综合图就好了。

时间: 2024-08-28 16:12:12

highcharts 折线,饼状,条状综合图的相关文章

python中matplotlib绘图封装类之折线图、条状图、圆饼图

DrawHelper.py封装类源码: 1 import matplotlib 2 import matplotlib.pyplot as plt 3 import numpy as np 4 5 class DrawHelper: 6 def __init__(self): 7 # 指定默认字体 下面三条代码用来解决绘图中出现的乱码 8 matplotlib.rcParams['font.sans-serif'] = ['SimHei'] 9 matplotlib.rcParams['font

PHP+mysql+Highcharts实现饼状统计图

PHP+mysql+Highcharts实现饼状统计图 Mysql 首先我们建一张?chart_pie?表作为统计数据. -- edit http://www.lai18.com -- 表的结构 `chart_pie` -- CREATE TABLE IF NOT EXISTS `chart_pie` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(30) NOT NULL, `pv` int(10) NOT NULL, PRIMA

Android图表库MPAndroidChart(八)——饼状图的扩展:折线饼状图

Android图表库MPAndroidChart(八)--饼状图的扩展:折线饼状图 我们接着上文,饼状图的扩展,增加折现的说明,来看下我们要实现的效果 因为之前对MPAndroidChart的熟悉,所有我们就可以直接来实现了 一.基本实现 首先,就是我们的来看下他的定义布局 <com.github.mikephil.charting.charts.PieChart android:id="@+id/mPieChart" android:layout_width="mat

jquery实现的竖向动态柱状条效果

jquery实现的竖向动态柱状条效果:很多数据统计效果中,柱状条方式的算是比较常见的一种,形象直观,下面就是一段能够实现此功能的代码实例,并且具有一定的动态效果,下面就对代码做一下分享,并详细介绍一下它的实现过程.代码如下: <!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <meta name="author" content="http://

[R语言绘图]条状图barplot

#基本的条状图 a<-c(1,2,3,4,5,6,7,8) barplot(a) #table的条状图 install.packages("vcd") library(vcd) b<-table(Arthritis$Improved) barplot(b) 参考:R语言实战 转载请注明出处:http://blog.csdn.net/zhyoulun/article/details/46433619

用CSS设计类似条状统计表效果

<html> <head> <title>用CSS设计类似条状统计表效果</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <style> dl { margin:0; padding:0 0 15px 0; width:401px; height:auto; background:#ff

盾神与条状项链

问题描述 有一天,盾神捡到了好多好多五颜六色的珠子!他心想这些珠子这么漂亮,可以做成一条项链然后送给他心仪的女生~于是他用其中一些珠子做成了长度为n的项链.当他准备把项链首尾相接的时候,土方进来了. “哇这么恶心的项链你也做得出来!!!” 盾神自知审美不是他的长项,于是他很谦虚地请教土方,怎么才能把项链做得漂亮. “这个嘛~首先你要在这里加上一个这种颜色的珠子,然后在这里去掉这个珠子,然后……,最后你看看是不是漂亮很多咧~”土方一下子说出了m个修改步骤. 盾神觉得这个用人工做太麻烦了,于是交给了

highcharts 折线图

<!doctype html> <html lang="en"> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script type="text/javascript"

highCharts折线图、饼图、柱图

原文:highCharts折线图.饼图.柱图 源代码下载地址:http://www.zuidaima.com/share/1550463665392640.htm highCharts折线图.饼图.柱图 每种类型的图有5种不同风格的样式 折线图 饼图 柱图 竖柱图