简体   繁体   English

是否可以使用jqplot制作此图表?

[英]Is it possible to make this graph using jqplot?

Is it possible to make the graph using jqplot, as given below? 是否可以使用jqplot制作图形,如下所示? The closest possible graph to this is stacked but using that coloring as well as point labels are a problem. 最接近可能的图形是stacked但使用该着色以及点标签是一个问题。

预期产出

This jsfiddle contains my effort to make this bar chart along with it's legend and point labels. 这个jsfiddle包含我努力制作这个条形图以及它的图例和点标签。 So is it possible to make it look like the image. 因此可以使它看起来像图像。

var barchart = $.jqplot('chart1', [s1, s2, s3], {
    animate: true,
    grid: {
        background: 'white',
        drawBorder:false,
        shadow: false
    },

    seriesColors: ['#73C6E8', '#F28570', '#727272'],
    seriesDefaults: {
        renderer: $.jqplot.BarRenderer,
        rendererOptions: {
            barPadding: 20,
            barWidth: 25,
            barMargin:10,
            fillToZero: true
        },
        pointLabels: { show: true }
    },
    series: [
        { label: 'USA' },
        { label: 'India' },
        { label: 'South Africa' }
    ],
    legend: {
        show: true,
        placement: 'outsideGrid',
        location:'se',
        background:'white',
        border: 'white',
        fontFamily: 'Gotham Medium',
        fontSize:'12px',
        renderer: $.jqplot.EnhancedLegendRenderer
    },
    axes: {
        xaxis: {
            renderer: $.jqplot.CategoryAxisRenderer,
            ticks:xticks,
            showTicks:false
        },
        yaxis: {
            pad: 1.05,
            ticks: yticks,
            showTicks:false,
            rendererOptions: {drawBaseline: false}
        }
    }
});

I believe it would be much easier to achieve with highchart: http://www.highcharts.com/demo/column-stacked 我相信用highchart实现它会容易得多: http ://www.highcharts.com/demo/column-stacked

This is only stack bar example you customize everything, legend, color, size, label, etc etc. 这只是堆栈栏示例,您可以自定义所有内容,图例,颜色,大小,标签等。

good luck 祝好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM