How can I make Core Plot to show an x-axis label for each point in time? - ios

Apart from the issue I am trying to fix atm, I would like to know how I can make the x-axis labels to draw wherever there is a point drawn. As you can see on the screenshot there are three points in time. So instead of the label "1/10/54' (yes that is year 54) floating nowhere, I want three labels, one below each point.
(Note the 3 points are only for illustration, needs to be expandable.)

If the spacing between the labels will be irregular like your sample screenshot, you'll want to change the axis labeling policy to CPTAxisLabelingPolicyNone or CPTAxisLabelingPolicyLocationsProvided. Both policies require you to provide the tick locations. The first policy also requires you to make custom labels that don't have to be at the same locations as the tick marks while the second will automatically make labels at each tick location using the standard label formatter.

Related

Labels on Grid lines in HighchartsJS

I'm using highcharts and trying to add labels to the grid lines of a polar chart, however, I can only add labels to the first axis (which is the y-axis in the cartesian coordinate system).
Polar charts are not well covered (as well as labels on grids) in the highcharts docs. My current approach is placing the labels manually on the correct positions, which will get cumbersome due to dynamic number of categories and sizes of my chart. Additionally, exporting the chart will not support labels anymore.
Background: Let's assume I am selling tickets for clubbing from Monday to Friday (no weekends, bad choice) for the clubs Green, Black, and Blue. Now, I want to know which club performed best on each day, and also how many tickets are sold in total. Therefore, I'd like to apply different scalings to each axis as attached (manually manipulated). I'm currently normalizing the ticket sales for each day to 0…1 which does the job for comparing each single day, but I can't apply the different labels to the axis.
One way might be to add more panes (with startAngle correction) and yAxes with different scales, so dataLabels are showing as in your image.
Example: http://jsfiddle.net/6b9m7Lvb/
Problem - each yAxis can have only a single pane, each series can have only a single yAxis, so there is one scale for a series - no matter what category.
Another way could be to do the same, but have all yAxes linked to each other, so scale is the same for all. Next it is possible to change axis labels and tooltip display, to match your image.
Example: http://jsfiddle.net/6b9m7Lvb/1/

Highcharts :: Need to split y-axis from primary body of chart. Can I display this axis separately from the Highchart?

I have a situation where I need to remove all margins from a highchart and remove the x/y axis so it fills a series of columns in a table completely.
I did that, no problem. Chart goes to the extremes as needed.
What I need now is that pesky yaxis I already removed...but displayed in a table cell outside of the existing highcharts object.
It would seem easy, as though I could just set the overflow property of yaxis to 'visible' and play with the offset...which would work however this would only work if I wanted to re-position the axis within the boundaries of the highchart object. I want him in a different cell entirely.
Is there anyone who has had experience in this situation? Is it going to require me to have a secondary highchart with only a y-axis?
Best answer gets a green check.
EDIT :: I now have dispersed each 'day' into their own column (more bars coming per day [scheduled,actual,etc...]). In order to keep the scales lined up, I manipulate the yAxis:max property and set them all to a derived value.
In the open column (currently w/ text Hourly Trends) is where I would put an additional highchart module with no series data but with the same min/max/tickInterval.
The next big leap will be to see the data is alive and changes w/ schedule. May have to start another thread for that one, no?
Create a new HC object with no data but only the yAxis (making sure it is the right scale, etc). Perhaps add the same series of data to it but hide the series? Add it to the location you want. This seems kludge and not very good practice. Each business use is different but why would you want this?
EDIT based on comment of business rules:
Why not come at this from a different direction and have the individual chart elements (the bars/points/etc) be a single point chart. This way you have one chart per column. You can then set up the yAxis to be text and not worry about the position. If we could see an example of the page layout and the desired result that would help.

Coreplot: Axis Labels Fixed Location

I'm trying to customize a Coreplot graph in many ways I can and the next thing I would like to do is place the X Axis Labels (one that is custom as well) at the bottom of the graph, independent of the X axis' position (whether it's scrolled up or down).
To make it clear, it is similar to giving the labels an offset value of something like 50.0. But offset is not the property I'm looking for since it fixes the labels location relative to the X axis.
Any way this can be done? Or do I have to skip the axisLabels property and place and layer or something manually at the bottom of the graph?
EDIT: Alright, I managed to place an axis on the bottom with CPTConstraints. But it's not on the bottommost. If a plot point is on those levels, the plot line overlaps the labels. I tired padding of the graph but of course, it moves the whole graph, hence the issue persists.
Thanks in advance
Make a second x-axis. Have the first one draw the axis line, tick marks, etc., as normal but no labels. Label the second one and set all of the line style properties to nil so it doesn't draw any of the lines.
Turns out that aside from the graph, the plotAreaFrame property of the CPTGrpah also has paddings. If you give more paddings to plotAreaFrame than that of the graph, the plot will be drawn in a smaller frame and the rest of the graph area will be for you to add what you want (i.e., a second Axis).
Big thanks to #Eric, for trying to answer Every single CorePlot question as soon as possible.
CorePlot does have a lot of customisation than I thought.

Highcharts highstocks - candlestick graph has last value partially cut

In a candlestick graph i am building, the latest bar is cut-off partially such that even the bar is not visible. Thus it's difficult to judge the high and low by seeing the bar.
I'm unable to post a pic now but it's like the last rectangle being cut in half.
I'm tried a lot of options in the api but can't figure out why this is not showing correctly. The chart margin and axis offset options havent' helped. Is there a way i can set the series margin from the plot area so that it displays right.
For this problem, the best solution is to insert a dummy series which should be hidden from every aspect of the chart. So try this, insert a dummy series from the last point of the data series to some extra buffer(as per need). Then remove this series from the chart by explicitly removing it from the legends (using showinlegend),chart(setting linewidth to 0) and from tooltip by having a check in formatter. Hope this solves your problem.
I had the same problem and couldn't figure it out, because no matter how I changed the xAxis.maxPadding or changed the xAxis.max, it would always cut off the last candlestick when I clicked on the range selector.
To solve it, (hack) I just added an extra data point in my series and set it 1 day past the last day and set all values to null.
Without any code or a pic, it's hard to tell the problem, but it sounds like you need to use the max padding option. http://api.highcharts.com/highcharts#xAxis.maxPadding. You may also want to look at endOnTick as well as whether you are setting max on the axis.

Highcharts - multiple plot with the same x scale

I want to make a multiple plots with the x-axis aligned so that we can compare two set of data. I want it to look like this
https://stackoverflow.com/a/11796553/229075
In my case there are some addition requirement that some of the plot are lines and some are bar. So the default scale does not align even if the data range are the same.
I found some good suggestion about "stacking" the charts. It is a little bit complicated but a promising way to try.
https://stackoverflow.com/a/12179023/229075
However I also have other use case that may push the envelop of simple stacking. For example, I'd like to do scatter plot matrix sometime when both x-axis and y-axis have to align like this
http://www.statmethods.net/graphs/images/spmatrix3.png
Rather than putting many chart in one Highchart, this may requires have many separate charts but have better control in how the axis is layout.
If you want to use one one chart, you can use linkedTo option to connect axis.
If you want more simple charts, you can manage to connect axis using event afterSetExtremes, where you can call setExtremes() for another chart.

Resources