Use iOS-Charts How to set the label position of the X axis and the position of the bar, line - ios-charts

I want need to be done like this,
but I made this after I do not know how to do it.
I want understand the attributes of the IOS chart, the first picture on both sides of the column does not show completely, I would like to two columns and X axis of the label indentation, how to set up?
Can who help me?
Thank you!

If I understand your question, you want to see the whole width of the yellow bar for April. This should force the bar to be shown:
chartView.xAxis.axisMinimum = 0.0
chartView.setVisibleXRange(minXRange: 3.0, maxXRange: 3.0)
If you change the 0.0 to a bigger number it should move the yellow bar more to the right.
You can also try changing the number 3.0 to a bigger number and see what effect it gives you.

Related

Make barWidth fix in barchart

I am using Charts library. I want to keep chart max width fix. I didn't find any way to restrict to some width.
There is a way to make sure the width of a bar is never more than a certain proportion of the screen width. For example setting the setVisibleXRangeMinimum to 10 means each bar will be around 1/10 of the screen width
barChart.setVisibleXRangeMinimum(10.0)
You can also set the maximum:
barChart.setVisibleXRangeMaximum(10.0)
Finally, I am able to find the problem in my code. I was adding long value for X, which was creating the problem. I corrected the X value and everything is perfect :)
BarChartDataEntry(x: Double(x_Value), y: Double(y_Value))

matlab: bar, how to change the edge color?

I am having trouble to change the bar color, I want it to be white in the middle, and red at the edge. Looking at matlab's description
if I do:
bar(y,'FaceColor','w','EdgeColor','r','LineWidth',1)
It should give me the above. However, when I actually run it, it only give me white graph.
Update: my y is:
y=zeros(1,5000); y(3000)=1; y(4000)=1;
Using the above, I got....
With so many bars, Matlab probably has trouble differentiating edge ('EdgeColor') and fill ('FaceColor') of each. After all, each complete bar is less than a screen pixel.
I suggest you use white edge and colored fill. That works for me. It's as if 'FaceColor' had precedence over 'EdgeColor'.
bar(y,'FaceColor','r','EdgeColor','w','LineWidth',1)
Or better yet: replace each bar by a line, that is, use stem:
stem(y,'r','marker','none')

Matlab Increase thickness of lines of 3d bars

I have a 3D bar chart. Let me clarify, I do not want to edit the width of the bar graph as I have already done that. However, there are black lines that outline each bar. Is there a way to make these thicker?
Everything I have search pays reference to the width of the bars themselves, not the black lines enclosing them.
At last, I found the answer to my own question the minute after I ask it.
Simply:
set(j,'LineWidth',1.5)
EDIT: As Luis mentioned, j is the handle such that j = bar3(...)
Sorry should have included that.

Sigmaplot: How to scale x-axis for correctly displaying boxplots

I want to display overlapping boxplots using Sigmaplot 12. When I choose the scale for the x-axis as linear then the boxes do indeed overlap but are much too thin. See figure below. Of course they should be much wider.
When I choose the scale of the x-axis to be "category", then the boxes have the right width, but are arranged along each single x-value.
I want the position as in figure 1 and the width as in figure 2. I tried to resize the box in figure 1 but when I choose 100% in "bar width" than it still looks like Figure 1.
many thanks!
okay, I found the answer myself. In Sigmaplot, there is often the need to prepare "style"-columns, for example if you want to color your barcharts, you need a column that holds the specific color names.
For my boxplot example I needed a column that has the values for "width". These had to be quite large (2000) in order to have an effect. Why ? I have no idea. First I thought it would be because of the latitude values and that the program interprets the point as "1.000"s, but when I changed to values without decimals, it didnĀ“t get better.
Well, here is the result in color.
Have fun !

How can I add horizontal lines to a BarPlot

I want to know how could I add Horizontal lines to each bar of a barPlot with different values.
I want to let the customer know what is the expected value with an horizontal line and what is his real value with a bar.
Any idea ?
Thanks
You can use a second bar plot. Set barBasesVary = YES on the second plot. It will ask the datasource for an additional field called CPTBarPlotFieldBarBase. Return a base value and tip value that will make a short bar.