带图案填充的饼图:Jqplot问题

时间:2014-09-04 11:17:09

标签: javascript jquery html5 jqplot

我正在使用jqplot制作饼图..在这里我想创建一个像下面的图像饼图.. Pie chart with Pattern filling

有可能吗?使用jqplot

1 个答案:

答案 0 :(得分:0)

我找不到jqPlot的解决方案,而是使用了highcharts。您可以查看demo

代码:

var chart = new Highcharts.Chart({

    chart: {
        renderTo: 'container'
    },

    title: {
        text: 'Pattern fill plugin demo'
    },

    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

    yAxis: {
        plotBands: [{
            from: 100,
            to: 200,
            color: {
                pattern: 'https://rawgithub.com/highslide-software/pattern-fill/master/graphics/pattern3.png',
                width: 6,
                height: 6
            }
        }]
    },

    series: [{
        type: 'area',
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
        fillColor: {
            pattern: 'https://rawgithub.com/highslide-software/pattern-fill/master/graphics/pattern1.png',
            width: 6,
            height: 6
        }
    }, {
        type: 'column',
        data: [148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6],
        color: {
            pattern: 'https://rawgithub.com/highslide-software/pattern-fill/master/graphics/pattern2.png',
            width: 6,
            height: 6,
            // VML only:
            color1: 'red',
            color2: 'yellow'
        }
    }]

});