I currently have a bar chart in jquery. If the results show only 1 bar the issues is that the bar fills the space of the whole graph. How can I adjust the width of the bar so that it doesn't look like a log.
try setting the barWidth in the BarRenderer:
http://www.jqplot.com/docs/files/plugins/jqplot-barRenderer-js.html
If you still want your chart bars to size dynamically with number of bars / size of chart then use the barMargin and barPadding values to adjust the width of your bars.
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barPadding: 4,
barMargin: 5
},
The default values are 8 and 10 respectively so the above values will actually make your bar larger. Make the values larger than default to reduce the size of your bars.
barMargin is the width between bars. barPadding is the width between bars within a category if your bar chart is representing multiple series.
See http://www.jqplot.com/docs/files/plugins/jqplot-barRenderer-js.html for more info.
Related
I'm trying to make a 5x2 grid of 9 subplots and where the tenth subplot should be placed , I put the legend. To make this I get from the last subplot the legend handle (with ax.get_legend_handle()) and then I do:
ax = fig10.add_subplot(gs0[N_rows-1,N_cols-1])
ax.axis("off")
#h and l are the handles and the labels
ax.legend(h,l, borderaxespad=0, fontsize=50, title_fontsize=15)
The problem is that the legend doesn't occupy the whole figure and if I increase too much the font size of the labels, then it will generate an extra space between subplots. For that reason I want a way to set the size according to the height or the width of the current axis.
I had bottom bar I need it to be like that
but I can't update width for each item
[Problem]
In a very simple stacked bar graph in excel (example data below), the colors of the positive part of the chart match with the legend (i.e. yellow upper and grey lower in both stacked bars and legend). However, for the negative values the legend is inverse to the actual order of the stacked bar (i.e. blue upper and orange lower in the staked bar but the opposite in the legend).
[Unsuccessful tries]
This is regardless of the actual data in the cells (changing the data doesn't change the colors or the order).
I've tried both changing the last parameter of the formula, and changing the order of the legend manually in the menu desing > select data > move up/down. None of them works, since it changes both the order of the stacked bars and the legends at the same time, so the order keeps unmatched.
[Question]
My question is, how can I match the order of the colors of the staked bars and the legend also for the negative part of the chart?
Example data:
1 -5
2 -1
3 1
4 5
I have a graph in Excel like below. For the X-axis, the distance between 50 and 100 is the same as that between 100 and 200. Can I ask if I can set it based on the number? That is, the distance between 50 and 100, is half of that between 100 and 200.
Perhaps you can use a scatter plot rather than a line chart. The result looks something like this:
To generate the plot, I selected the whole data block and did Insert > Scatter with the subtype consisting of markers with straight-line segments. I don't know of any way to not show horizontal labels at 50, 100, 200 without doing things like 150, but at least the spacing is right. Obviously, the size, style, and color of the markers and lines are easy to tweak, as is the number and spacing of the horizontal grid lines.
I've created horizontal bar chart with category axis (Y axis). After adding more and more categories to Y axis, height of each horizontal bar is shrinked to zero size.
Here we can see bars with height of 2px, but I want to have at least 6px.
How to restrict height of each bar on the chart?
And how to force chart to request more space if bars for all categories are not fitted in plot area?
Each time you add a new category, increase the minHeight property of the chart.