javascript - jQplot统计量

标签 javascript jquery jqplot

我有一个 jQplot 图表,我需要将月份标签(一月、二月、三月、四月、五月、六月、七月...)放置到我的 X 轴上。

我尝试了教程中的一些示例,但它们不起作用。

有人可以帮助我吗?

<小时/>

这是我到目前为止所拥有的:

jQuery(document).ready(function(){
    jQuery.plot(jQuery("#chartplace2"), [{
        data : [[6, '0'], [5, '0'], [4, '0'], [3, '0'], [2, '0'], [1, '0'], [0, '32000']],
        label : "Mijolino",
        color : "#79755c"
    }, {
        data : [[6, '0'], [5, '0'], [4, '0'], [3, '0'], [2, '0'], [1, '0'], [0, '42500']],
        label : "Mija",
        color : "#78d6d0"
    }], {
        series : {
            lines : {
                show: true,
                fill : true,
                fillColor : {
                    colors : [{
                        opacity : 0.1
                    }, {
                        opacity : 0.20
                    }]
                }
            },
            points: {
                show : true
            }
        },
        legend: {
            position : 'nw'
        },
        grid: {
            hoverable : true,
            clickable : true,
            borderColor : '#ccc',
            borderWidth : 1,
            labelMargin : 10
        },
        yaxis : {
            min : 0,
            max : 100000
        },
        title : {
            text : 'Grafikon',
            show : true
        }
    });
});

最佳答案

尝试这样的事情:

http://jsfiddle.net/pabloker/GsDMW/3/

var Mijolino = [['01/01/2013', '0'], ['02/01/2013', '0'], ['03/01/2013', '0'],   ['04/01/2013', '0'], ['05/01/2013', '0'], ['06/01/2013', '0'], ['07/01/2013', '32000']];
var Mija = [['01/01/2013', '0'], ['02/01/2013', '0'], ['03/01/2013', '0'], ['04/01/2013', '0'], ['05/01/2013', '0'], ['06/01/2013', '0'], ['07/01/2013', '42500']];;

var plot1 = $.jqplot("chartplace2",
[Mijolino,Mija], {
seriesDefaults: {
lines: { 
    show: true, 
    fill: true
},
points: { 
    show: true 
}
},
legend: { 
   position: 'nw'
},
grid: { 
   hoverable: true, 
   clickable: true, 
   borderColor: '#ccc', 
   borderWidth: 1, 
   labelMargin: 10 
},
axes:{
    xaxis: { 
        renderer:$.jqplot.DateAxisRenderer,
        tickOptions:{formatString:'%Y-%b'},
        min: '01/01/2013'
    },
    yaxis: {
     min:0,
     max:50000
    }
},

title: { 
text: 'Grafikon', 
show: true}
});

关于javascript - jQplot统计量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14682180/

相关文章:

javascript - 使用 Jqplot 和 Sqlite 数据库中的数据绘制图形

java - 如何将列表值传递给jqplot以获取堆积条形图

javascript - Heroku 环境导致 Java/Nashorn/ReactJS 应用程序崩溃

javascript - 序列化不发送表单中的所有数据

javascript - 如何在具有相同类的多个按钮的单击事件上使用Javascript添加多个相同的ID

javascript - 如何动态对齐圆内的文本?

javascript - jQPlot X 轴上的日期刻度间隔不起作用

javascript - SQLITE_ERROR : no such table in Node. js

javascript - 查找上次更改时值是增加还是减少

javascript - 以编程方式单击输入元素