bar-chart

MS Chart: How can you change the color of each label on the Axis of a Bar Chart?

人走茶凉 提交于 2019-12-23 09:12:50
问题 I have a bar chart which shows different categories on the Y axis. I can change the color of all of them on the axis at the same time by using: chart.ChartAreas["MyChart"].AxisY.LabelStyle.ForeColor = "Red"; However it doesn't allow me to set the color for each of them. Any help will be much appreciated. 回答1: You can try adding custom labels to the chart, and that will allow you to modify each one individually. private void AddCustomLabelAtYValue(double YValue, string Text, Color ForeColor) {

bar graph using AChartEngine library

给你一囗甜甜゛ 提交于 2019-12-23 07:37:10
问题 I have a bar graph using AChartEngine library as shown below :: public class MainActivity extends Activity { private String[] mMonth = new String[] { "Jan", "Feb" , "Mar", "Apr", "May", "Jun", "Jul", "Aug" , "Sep", "Oct", "Nov", "Dec" }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Getting reference to the button btn_chart Button btnChart = (Button) findViewById(R.id.btn_chart); // Defining click

dc.js onClick Listener Not Working

让人想犯罪 __ 提交于 2019-12-22 13:30:47
问题 I'm having trouble getting an onClick listener to work with a dc.barChart. According to this thread, clickable charts should have an onClick listener now. However, I've tried both chart.onClick = function and chart.on("click", function) without any luck. Below is the code I've tried to test whether the listener is working or not. var hubChart = dc.barChart("#hub-chart"); var dateHub = dateCF.dimension(function(d){ return d.hub;}), dateHubs = dateHub.group().reduceSum(function(d){ return d

Customizing the order of legends in plotly

妖精的绣舞 提交于 2019-12-22 09:57:43
问题 I am trying to customize the order of legends while plotting stacked bar plots in plotly,python. data = [ go.Bar( y=df['sid'], # assign x as the dataframe column 'x' x=df['A'], orientation='h', name='A' ), go.Bar( y=df['sid'], x=df['B'], orientation='h', name='B' ), ] layout = go.Layout( barmode='stack', title=f'{measurement}', xaxis=dict( title='Count', dtick=0), yaxis=dict( tickfont=dict( size=10, ), dtick=1) ) fig = go.Figure(data=data, layout=layout) plot(fig, filename='plot.html') The

How to control space between stack bars in ggplot2?

走远了吗. 提交于 2019-12-22 08:11:21
问题 I'm plotting a stack barplot in ggplot2. My dataset is like, var1 var2 var3 value treatment1 group_1 C8.0 0.010056478 treatment2 group_1 C8.0 0.009382918 treatment3 group_2 C8.0 0.003014983 treatment4 group_2 C8.0 0.005349631 treatment5 group_2 C8.0 0.005349631 var1 contains 5 treatments, these five treatments belong to two groups in var2 , and each treatment has 14 measurements in var3 , their value stored in value . I want to make a plot to compare these five treatments, and their

Conditional Barchart coloring with a vector in R

♀尐吖头ヾ 提交于 2019-12-22 06:31:16
问题 I am attempting to create a simple barplot with both negative and positive values with my input as a vector. I would like the barplot to display the positive values colored in red and the negative values colored in blue. I understand this problem is simple, but I cannot seem to figure it out. Here is my vector: x <- (1.9230769, 1.2961538, 0.2576923, -1.5500000, -1.3192308, 0.2192308, 1.8346154, 1.6038462, 2.5653846, 4.1423077) I have attempted the code: barplot(x, ylim=c(-8,8), if(x>0) {col=

Change width of bars in barchart (R)

蓝咒 提交于 2019-12-22 04:39:56
问题 I am wondering how to change the width of the bars in the barchart() function. Here is the code: rater1 <- c(0.75, 0.66, 0.73, 0.63) barplot(rater1, ylim=c(0:1),axes = TRUE, names.arg = c("A", "B", "C", "D"), axisnames=TRUE, col="grey70") Is it also possible to place value labels above the bars? Thanks. 回答1: From ?barplot : space: the amount of space (as a fraction of the average bar width) left before each bar. May be given as a single number or one number per bar. [...] So, for example,

How to give solid colors to bar charts in flot

廉价感情. 提交于 2019-12-22 04:29:19
问题 I need to give solid colors to bar charts... I have followed this link Bar chart Example But i want to give solid colors and also i need to change colors myself... how to do it... 回答1: First off, read the API.txt, it answers all your questions. Two things you need to do then. When you specify that you want bars, set fill: 1 , which tells flot to make the colors 100% opaque. To specify a colour per series, just add a color:'red' to each data object. So you end up with a data object like this:

Example of animated 3D bar-chart using matplotlib.animation in Python

北城以北 提交于 2019-12-22 01:36:10
问题 I've seen a few nice examples of use of matplotlib.animation module, including this animated 3D plot example. I'm wondering if this animation module can be used with a bar3d chart. Can someone generates a simple example of that? Note: I'm currently working on a different solution that doesn't include matplotlib.animation (see my other post) but this appears to be too slow... 回答1: Here's a small example with 2x2 bars which will be growing and changing color randomly, one at a time when update

barchart in R using lattice

老子叫甜甜 提交于 2019-12-21 20:45:40
问题 This is my code: d<-data.frame(column1=rep(Names, each=1),column2=rep(c("one"),1),column3=values) barchart(column3 ~ column1, groups=column2, d, auto.key = list(columns = 1)) One of my values is negative. On my picture I see all the bars starting from negative values and growing up to their values, but I want to see all the bars starting at 0 (one bar has revers direction). How can I do this? I'm not sure about lattice, any other way is ok. I tried barplot, it plots in the right way, but my