javascript - jqplot horizontal bars issue -
I am trying to set a horizontal bar graph using jqplot:
Var plot1 = $ .jqplot ('graph', [gData], {seriesDefaults: {renderer: $ .jqplot.BarRenderer, renderer options: {bar direction: 'horizontal'}}, axis: {yaxis: {renderer: $ .jqplot rangex randerer, tick: gtixt}}}); This code works well with vertical bars, such as:
var plot1 = $ .jqplot ('graph', [gData], { SeriesDefaults: {Renderer: $ .jqplot.BarRenderer}, axes: {xaxis: {renderer: $ .jqplot.CategoryAxisRenderer, ticks: gTicks}}}); But when I go to make it horizontal, then suddenly the lines do not make lines with ticks anymore. For example, for some ticks, there may be two or more overlapping bars and for some, nobody can be. Finally, there is an additional 'undefined' tick, which often overlaps repeatedly.
Both jData and GTI are javascript arrays.
Any thoughts?
Edit: The undefined category is actually my own creation, but the problem remains unchanged.
The reason for this does not work for you, that is, that which I believe, you Data changing according to horizontal orientation of graph is not changing, assuming that this is a problem, the chart data will be as follows:
[[[2,1], [4,2], [6,3]], [3,4]], [[5,1], [1,2], [3,3], [4,4]], [[4] 1], [7,2], [1, 3], [2,4]]
You can use a value array sign (below) As Series:
[[200, 600, 700, 1000], [460, -2] 10, 690, 820], [-260, -440, 320, 200]] This notation will allow you to change the orientation of the chart without worrying about the data format, As presented in the examples given below, where the parameters of the same graph change in the same graph:
Comments
Post a Comment