iOS-charts bar chart with negative values - ios

I am using the great iOS-charts pod for doing my graphics. Now I have to display a bar chart with y-value in a range from -120 to 0. When I add those values, I get the bars displays from the top - 0 - to the bottom.
What I am looking for is a way to let the bar be drawn from the bottom of the chart up to it's value, because 0 means a lot for the application while -120 means nothing. So I would like to get a big bar for 0 and nothing for -120 like this.
0
X
X X
X X X
-120 x X X
Any idea how I can achieve this behavior?
Thanks a lot
Andy

You need to set logical values for the correct visibility - and the use a formatter for showing the values as negative values.
In Charts 3.0 it is easier to format the values.

Related

iOS Charts - Equidistant Y Values?

For the iOS Charts library, does anybody know how to make the y axis values equidistant from one another? So in the following picture the "1" line would be halfway up the graph?
Set axisMinimum to zero will result in your desired output.
//chartView is the object of BarChartView class.
let yAxisLeft : YAxis = self.chartView.leftAxis
yAxisLeft.axisMinimum = 0
It will remain consistent for other values too.

TChart in C++Builder 6.0 rotate chart

Can I rotate a chart? I need x on vertical axis and y on horizontal axis.
Can I change x value to vertical axis and y value to horizontal axis?
Or can I rotate of the component TChart (xy values stay standard and I flip component 90)?
Thank you.
The easiest solution would probably be to use swap your values or add your X values as YValues and add your y values as XValues.
Ie, let's say you have your X values in an array called Xdata and your Y values in an array called Ydata. You could add your values with this:
Series1->AddXY(Ydata, Xdata);
Maybe I can write - i used a line(fast line) chart.
There
[IMG]http://i68.tinypic.com/29atrw5.png[/IMG]
is Classical graph and image if I rotate it. If I change x-y values as You wrote I get wrong image.
y = f(x) so it paint for x=1, x=2, ... but i need paint x = f(y) for y=1, y=2, y=3
I need something as is point chart - connect handly in paint
I'm not sure if it is possible change axis or rotate component teeChart.
I probably use TImage and will paint it into image.
today i find that teechart have a series "horiz line" (https://www.steema.com/files/public/teechart/java/v1/docs/Tutorials/tutorial1.htm).
But licence is expensive for our company (https://www.steema.com/buy). We need only one chart with this axes.
Do you know if can I install only some update into BCB 6?

Highchart - Chart type, gap in the x and y axis (0,0)

Please refer the fiddle codehttp://jsfiddle.net/yuvarajkumarg/az290eyq/1/
In Highchart of type Chart, when we plot for height = 0 and pressure = 2, we get a gap as shown in jsfiddle. I want point to be plotted on the X-axis(2,0). But the graph looks like it is plotted on (2,2) since the y-axis plot starts way above the x-axis. How to remove the gap ?
The issue is the categorized axis.
There are probably a few ways around the issue, but I would do it this way (on your xAxis):
tickmarkPlacement: 'on',
min:0.5,
max:6.5
Example:
http://jsfiddle.net/az290eyq/2/
You could also do it by not using categories, and using the axis label formatter in order to display the numeric sequence that you need.
[[ edit for comments:
For the min and max values - the x axis values for a categorized axis are the category array index values. So the first category is x = 0, the second is x = 1, etc.
Because Highcharts puts the the label in the center of the value's space, setting the min/max to the actual min/max value +/- 0.5 will align the center of the space with the start/end of the axis.
So, you can calculate this dynamically by using 0.5 for the min, and counting the categories array and using (count -1.5) as the max.
Additionally, setting the tickmarkPlacement proerty to 'on' moves the tick mark to the center of the space as well, aligning the ticks with the start/end of the axis as well.

linear Dataseries Say 0 on Y Axis Having Issue

Linear Dataseries Say all y axis is 0, Autoscaling on y axis is not working as desired.
High stock version - 1.3.1
DataSeries to be plotted,
[[1149724800000,0],[1149811200000,0],[1150070400000,0],[1150156800000,0],[1150243200000,0],[1150329600000,0],[1150416000000,0],[1150675200000,0],[1150761600000,0],[1150848000000,0],[1150934400000,0],[1151020800000,0],[1151280000000,0],[1151366400000,0],[1151452800000,0],[1151539200000,0],[1151625600000,0]]
OR
[[1149724800000,20],[1149811200000,20],[1150070400000,20],[1150156800000,20],[1150243200000,20],[1150329600000,20],[1150416000000,20],[1150675200000,20],[1150761600000,20],[1150848000000,20],[1150934400000,20],[1151020800000,20],[1151280000000,20],[1151366400000,20],[1151452800000,20],[1151539200000,20],[1151625600000,20]]
Try Above series with Y min set to 0 and Y Min to Auto.
I had the same issue with 0 values displayed in the center.
The only way I found to get round it was to either use tickPositions and pass range values across to it for the data based of min/max values and ones in between or to use the tickPositioner call back function to return to go through the data and return the tick values based on these.
Still fairly new to highcharts so there is probably another way I don't know of. If anyone knows how to have 0 values displayed at the bottom of the chart while it auto-scales then please post as I would love to know how/if its possible.
Edit: turns out this isn't really possible currently, only way to get around it is to set min/max values and that won't allow auto scaling but at least it stop there from being any middle 0 values.

TChart - Dont plot values that are less than 0?

Introduction
I am using the TChart component and am finding the options rather confusing and hard to find what I need.
The Left Axis of the chart has a minimum of 0 and a maximum of 5000, the Bottom Axis has a minimum of 0 and a maximum of 52 (weeks in a year).
In my chart I have 2 series that are populated based on values from a record I have created which can be edited at runtime, everything is working good so far.
Problem
Take a look at the below image of part of the chart filled with some random values:
I am not sure if such an option exists or not, but notice from week 4 onwards where no values have been added there is a solid red line.
I don't want the chart to plot values that are less than 0, so in this example from week 4 onwards there should be no more lines (I can confirm that from week 4 onwards I have the values set at -1)
Week 1 to 4 does not show this bottom red line, obviously because the values are greater than 0 and are therefore plotted above the line, but this should make my problem a bit more clearer.
So, how do I prevent the chart from plotting / drawing values that are less than 0, importantly for the Bottom Axis of the chart?
I am sure there must be a simple option somewhere, I just cannot find it if there is one as I am not too familiar with the TChart Component.
You have the possibility when adding values to a series to add them as null.
This will prevent them from showing.
Ken is correct saying that a tricky situation is to handle a single value surrounded by null values.
Picking another series type than FastLine and show dots as well as lines might work better.
For a FastLine series to show gaps, set:
Series1.IgnoreNulls := False;
And to discriminate values below zero:
if (y < 0) then
Series1.AddNullXY(x, y, '')
else
Series1.AddXY(x, y, '');
if y < 0 then
LineSeries1.AddXY(x, y, '', clNone)
else
LineSeries1.AddXY(x, y, '', clRed);

Resources