combined line and bar w/ jqplot

时光总嘲笑我的痴心妄想 提交于 2019-12-29 07:39:30

问题


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.LineRender. This displays as a line but it is getting added to the stacked amounts.


回答1:


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.




回答2:


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.

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

.



回答3:


 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



来源:https://stackoverflow.com/questions/10727285/combined-line-and-bar-w-jqplot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!