combined line and bar w/ jqplot

后端 未结 3 1623
攒了一身酷
攒了一身酷 2020-12-19 04:16

Is it possible w/ jqplot to display a line chart that \'overlays\' a bar chart?

I have added a series to a stacked barchart and changed the renderer to $.jqplot.Line

相关标签:
3条回答
  • 2020-12-19 05:12
     series:[
                  {
                        color:'#0070c0',
                        label : 'Barchart',
                        renderer:$.jqplot.BarRenderer,
                        rendererOptions: {
                              barPadding: 0,
                              barMargin: 0
                        },
                        pointLabels: { show: true }
                  },
           {
                        yaxis: 'y2axis',
                        color: '#ff0000',
                        label : 'Line chart ',
                        renderer:$.jqplot.LineRenderer,
                        rendererOptions: {
                              barPadding: 0,
                              barMargin: 0
                        }
                  }
            ]
    

    It will draw both line and bar chart

    0 讨论(0)
  • 2020-12-19 05:19

    I add this example on jsFiddle, i hope this could be useful to you. It also shows the possibility to draw delimiting lines and areas for a better representation.

    enter image description here

    there is an article about this topic at this page: http://www.meccanismocomplesso.org/en/mean-mode-median-barchart/

    .
    
    0 讨论(0)
  • 2020-12-19 05:20

    Yes it can be done with jqPlot.

    A sample showing how a bar chart can be presented on a single plot together with a line chart is presented here, see the 3rd plot from the top.

    Here I made a sample to show line and stacked bar charts on a single plot.

    0 讨论(0)
提交回复
热议问题