bar-chart

How to line break a label object in ChartsJS (nested arrays won't work)

混江龙づ霸主 提交于 2020-07-08 00:46:26
问题 As answered here I'm using nested arrays to line break my labels on ChartsJS and it works fine but if I try to use nested arrays on my label (the object inside dataset) they won't line break. For example in this graph: I have 2 labels with new lines but if I try the same technique with my label (the legend above the graph) it won't line break. Here is the code for this graph: data: { labels: [ 'Utensilios para escrita e artes','Faz de conta','Jogos',['Materiais não estruturado','/de largo

How to plot a combined bar and line plot in ggplot2

自古美人都是妖i 提交于 2020-07-03 07:26:59
问题 I have the following data which I am trying to plot as combined bar and line plot (with CI) A data frame of Feature, Count, Odds Ratio and Confidence Interval values for OR I am trying to get a plot as A bar plot for count over lapped with a line plot for Odds Ratio with CI bars I tried to plot in ggplot2 using following code: ggplot(feat)+ geom_bar(aes(x=Feat, y=Count),stat="identity", fill = "steelblue") + geom_line(aes(x=Feat, y=OR*max(feat$Count)),stat="identity", group = 1) + geom_point

How to plot a combined bar and line plot in ggplot2

放肆的年华 提交于 2020-07-03 07:25:11
问题 I have the following data which I am trying to plot as combined bar and line plot (with CI) A data frame of Feature, Count, Odds Ratio and Confidence Interval values for OR I am trying to get a plot as A bar plot for count over lapped with a line plot for Odds Ratio with CI bars I tried to plot in ggplot2 using following code: ggplot(feat)+ geom_bar(aes(x=Feat, y=Count),stat="identity", fill = "steelblue") + geom_line(aes(x=Feat, y=OR*max(feat$Count)),stat="identity", group = 1) + geom_point

reduce width of bars in multiple barplot R

社会主义新天地 提交于 2020-07-03 06:52:20
问题 I need to reduce the width of the bars in the below multiple barplot: I tried to use the space option as per here Change width of bars in barchart (R) but it seems that with multiple barplot (i.e. in my case 4 bars per each variable) the function space does not work. Here's some fake data that reproduce the plot: mat_example = matrix(rnorm(40), 4, 10) barplot(mat_example[,c(1:10)], beside = TRUE) Thank you for any suggestions. 回答1: In help(barplot) there is this paragraph: space: the amount

Ascending order of bars in seaborn barplot

家住魔仙堡 提交于 2020-06-25 07:21:34
问题 I have the following dataframe Class Age Percentage 0 2004 3 43.491170 1 2004 2 29.616607 2 2004 4 13.838925 3 2004 6 10.049712 4 2004 5 2.637445 5 2004 1 0.366142 6 2005 2 51.267369 7 2005 3 19.589268 8 2005 6 13.730432 9 2005 4 11.155305 10 2005 5 3.343524 11 2005 1 0.913590 12 2005 9 0.000511 I would like to make a bar plot using seaborn where in the y-axis is the 'Percentage', in the x-axis is the 'Class' and label them using the 'Age' column. I would also like to arrange the bars in

Bar/Linear chart with multiple entries in Xamarin Forms

余生长醉 提交于 2020-06-18 02:51:25
问题 I must implement a linear and a bar chart whit multiple data entries in Xamarin.Forms, I have seen multiple plugins like Microcharts but I think that doesn't afford multiple entries and Syncfusion which affords it but is not free. Any free plugin to do it? Example of the charts: Bar Chart Linear 回答1: Based on your demand, You could use PlotView to achieve that .Before you used it, please refer to following link to initialize the OxyPlot, http://docs.oxyplot.org/en/latest/getting-started/hello

D3 y-axis percent display

隐身守侯 提交于 2020-06-09 05:10:20
问题 D3 Fiddle /** * A bar chart. Required data format: * [ { name : x-axis-bar-label, value : N }, ...] * * Sample use: * var bargraph = d3.select('#bargraph') * .append('svg') * .chart('BarChart') * .yFormat(d3.format("d")) * .height(400) * .width(800) * .max(1.0); * bargraph.draw(bardata); */ d3.chart('BarChart', { initialize: function() { var chart = this; // chart margins to account for labels. // we may want to have setters for this. // not sure how necessary that is tbh. chart.margins = {

Spotfire - Show top values in stacked bar chart

一笑奈何 提交于 2020-06-01 05:52:02
问题 I have a stacked bar chart that looks like this : I would like to only show the top 3 bars in terms of value, that is to say the three first bars. I tried to use the Show/Hide feature but it doesn't work as I expected. For example if I limit to Show top 1 value with the Show/Hide value, i get : when I expect to also have the orange and blue bars that are stacked in the first picture. Is there a way to do what I am looking for? 回答1: You will have to achieve a dynamic rank and use that to

Deal with bar size and totals when ggplot position “stack” in split charts

被刻印的时光 ゝ 提交于 2020-06-01 05:38:25
问题 When using the "stack" style (not "dodge") as with geom_bar or geom_col the totals get compromised with log scale . I manage to represent the correct total in a simple way (split chart) when ONE of the values is conspicuously more frequent than others, see Workaround (not log). But, the total problem remains for other cases and log scales . I would ask for a universal -automated- solution. EDIT: After reading ggplot scale_y_log10() issue, I found it makes no sense to use log. So the answer to

Missing only one bar in bar-chart

妖精的绣舞 提交于 2020-05-29 10:57:19
问题 I'm working on a duplicate bar chart using ggplot and I'm almost getting what I want, except for this error I couldn't fix. The data I'm plotting: comp reg counts 1 C0xC12 up 569 2 C0xC12 down 845 3 C0xC24 up 420 4 C0xC24 down 227 5 C0xT12 up 2904 6 C0xT12 down 2989 7 C0xT24 up 2536 8 C0xT24 down 2309 9 C12xC24 up 314 10 C12xC24 down 138 11 C12xT12 up 3006 12 C12xT12 down 3082 13 C12xT24 up 2795 14 C12xT24 down 2577 15 C24xT12 up 1381 16 C24xT12 down 1901 17 C24xT24 up 482 18 C24xT24 down 862