bar-chart

D3Js Bar Chart Bars Starting Way After beginning of X-Axis

我们两清 提交于 2019-12-24 07:41:07
问题 As the title say, I am creating a bar chart using D3Js. What do I have to change in the following snippet for the bars to start at the beginning of the X-Axis? var allBarsDatasets = [ { "xAxisTickValue": "10-1", "barValue": 18 }, { "xAxisTickValue": "10-2", "barValue": 17 }, { "xAxisTickValue": "10-3", "barValue": 17 }, { "xAxisTickValue": "10-4", "barValue": 19 }, { "xAxisTickValue": "11-1", "barValue": 19 }, { "xAxisTickValue": "11-2", "barValue": 14 }, { "xAxisTickValue": "11-3", "barValue

How do I get series data to display in bar chart legend

十年热恋 提交于 2019-12-24 06:44:50
问题 I have a Windows Forms Application that displays a graph from data stored in a database. I am able to get the data to display in a bar graph or pie graph. But the legend in the bar graph only displays "Series1", the name of the series. The legend of the pie chart displays a correct legend with the series data. I've searched MSDN and found several articles on adding a legend but they all have the same results. Here is my bar chart code: string[] xvals = new string[dt.Rows.Count]; int[] yvals =

Fit lognormal distribution to already binned data python

拟墨画扇 提交于 2019-12-24 02:40:48
问题 I would like to make a lognormal fit to my already binned data. The bar plot looks like this: Unfortunately, when I try to use the standard lognorm.pdf() the shape of the fitted distribution is very different. I guess it's because my data is already binned. Here's the code: times, data, bin_points = ReadHistogramFile(filename) xmin = 200 xmax = 800 x = np.linspace(xmin, xmax, 1000) shape, loc, scale = stats.lognorm.fit(data, floc=0) pdf = stats.lognorm.pdf(x, shape, loc=loc, scale=scale) area

Tornado plot in R

余生长醉 提交于 2019-12-24 01:27:56
问题 I am trying to make a tornado plot (a.k.a. sensitivity graph) in R. The goal is to visualize the effect of a 10% increase and 10% decrease in some variables. So far I have gotten this result This is the code I am using: # Tornado plot data <- matrix(c(-0.02,0.02,-0.01,0.01,-0.03,0.02,-0.01,0.04), ncol = 4) rownames(data) <- c('+10%','-10%') # Amount of change in variables colnames(data) <- c('V_bar', 'alpha', 'rho','xi') # Names of variables x <- seq(-0.04,0.04, length=10) # For plotting '%'

Highcharts Backgroundimage for bar graph

守給你的承諾、 提交于 2019-12-24 00:59:45
问题 I want to add a background image to a bar chart using Highcharts and display it in a UIWebView . So far I've been using this little plugin, which is working fine in latest Chrome. However, as soon as I load this into my UIWebView, the image is not displayed. I think this is related to the fact that iOS might not be able to parse the correct path for the image file? Is there another (simpler) way to just add a background-image to a bar chart? In my Highcharts data series color: { pattern:

Python: Plotting percentage in seaborn bar plot

£可爱£侵袭症+ 提交于 2019-12-24 00:52:50
问题 For a dataframe import pandas as pd df=pd.DataFrame({'group':list("AADABCBCCCD"),'Values':[1,0,1,0,1,0,0,1,0,1,0]}) I am trying to plot a barplot showing percentage of times A, B, C, D takes zero (or one). I have a round about way which works but I am thinking there has to be more straight forward way tempdf=df.groupby(['group','Values']).Values.count().unstack().fillna(0) tempdf['total']=df['group'].value_counts() tempdf['percent']=tempdf[0]/tempdf['total']*100 tempdf.reset_index(inplace

How do i create a series that I can create a bar chart from

扶醉桌前 提交于 2019-12-24 00:49:49
问题 I have a list of names: ['joe','brian','stephen'] i would like to create a bar chart in jupyter with names as indexes and the bar showing the numbers of letters in each name. How do I create a series which I can call ".plot(kind='bar')" on and get a bar chart like described? 回答1: import numpy as np import matplotlib.pyplot as plt bars = ['joe','brian','stephen'] height = [len(m) for m in bars] y_pos = np.arange(len(bars)) plt.bar(y_pos, height, color=(0.2, 0.4, 0.6, 0.6)) plt.xticks(y_pos,

Pentaho CDE Bar chart display

一个人想着一个人 提交于 2019-12-24 00:49:15
问题 I am trying to display a simple static Bar Chart in pentaho CDE but while previewing it i am not getting any result. I am using Pentaho 5.4.0.1.130 version. my console display. my chart component panel details I checked the Query result in mysql workbench and it is giving me proper result 回答1: You are missed Height and Width of the chart. Please specify the value of the height and width like below: Eg: Height: 200 Width: 400 来源: https://stackoverflow.com/questions/35169865/pentaho-cde-bar

ggplot2: geom_bar with custom y limits

杀马特。学长 韩版系。学妹 提交于 2019-12-24 00:47:17
问题 I want to draw a bar chart with ggplot2 along with custom y limits. Type <- LETTERS[1:5] Y <- c(99, 99.5, 99.0, 98.8, 98.5) df <- data.frame(Type, Y) The following code works fine for bar chart: library(ggplot2) ggplot(data = df, mapping = aes(x = Type, y = Y, fill = Type)) + geom_bar(stat = "identity") + theme_bw() However, I'm not able to set the y limits. See the code below. ggplot(data = df, mapping = aes(x = Type, y = Y, fill = Type)) + geom_bar(stat = "identity") + scale_y_continuous

How to plot a stacked column graph in R?

淺唱寂寞╮ 提交于 2019-12-23 20:11:54
问题 does anyone know how to use R to plot a histogram with the columns stacked up by more than 1 variables? Like the "stacked column" graph in excel. Thank you! 回答1: I'm assuming you really want a bar chart rather than a histogram. In that case, barplot from standard graphics or barchart from the lattice package will both do it. Or use ggplot as shown in this example or here 回答2: For example; ht1=c(0.3,0.7) ht2=c(0.4,0.6) barplot(cbind(ht1,ht2)) 回答3: There is also barplot.xts in the xtsExtra