Core-plot grid lines with LabelingPolicyNone - core-plot

I have custom labels for which I used the LabelingPolicyNone. But with that labeling policy I can't get to show grid lines.
Is there a way to show grid lines with LabelingPolicyNone?

The grid lines are shown at the tick locations. Set the majorTickLocations and the majorGridLineStyle. If you don't want tick marks at the same locations, set the majorTickLineStyle to nil.

Related

How to align multiple charts with different data

I have three pie charts displayed in a row. Two have two segments, one has five. All three have vertical legends.
Given that, the chart with five segments displays the pie slightly smaller, due to the extra height of the legend. It also has a slight negative vertical offset.
Is there any way I can set all three charts to render the chart in the same position? I've tried setting the center to 50%,50% in plotOptions, didn't help.
You have to set the marginBottom-Value of the chart to a value that is equal an all charts. Highcharts is trying to display the pie as big as possible, therefore it will use more space if the legend is not as big.
By setting the marginBottom you force the chart to ignore the actual legend size.
The center: ['50%','50%'] setting will only take into account the actual plot area. So if this area is decreased because of a taller legend it has no effect.
I made a jsfiddle where you can explore this settings:
http://jsfiddle.net/doc_snyder/dsmgy6ts/

Core-Plot DataLabel Z-Ordering

I try to add data labels to a bar graph in Core-Plot (on iOS). The user selects individual plots and then the values are shown.
The main problem is shown in the image, the other plots overdraw the data labels.
Is it possible to have the labels always at the top?
As the user sets the ordering of the bars, I cannot reorder the bars. (Also if I did, the user experience would be terrible as the whole graph appearance would change on selection.)
Other possibility: Can I reorder the plots for Z-ordering but have the positions remain unchanged?
Any other ideas? I also tried CPTPlotSpaceAnnotations, but I cannot align them on the bar precise enough (see the "1037" label at the year (x-axis) 1980).
I came up with a solution by myself: I just remove the plot and add it back. In that way the plot is raised in the z-Hierarchy.
[self.graph removePlot:plot];
[self.graph addPlot:plot];

Changing lables on x-axis like from Monday to show M as per window size in HighCharts

I am using highcharts library to draw chart and I need to display Weekdays as labels on x-axis and also to auto reset it like from Monday to M if all weekdays can't fit on screen.
It should be dynamic, which means no flickering should appear when changing label text on x-axis.
Any suggestions?
Thanks in advance.
There is no straight option for that, rather simple workaround:
Disable reflow from Highcharts, use window.resize browser event
In that event add condition to decide showing full name of just shortened, and set this for chart - chart.xAxis[0].dateTimeLabelFormats should be fine
After setting new format, apply new chart dimensions using chart.setSize(w, h)

Adding title to the PlotSymbol

Is it possible to set a title instead of A CPTPlotSymbol ? I want to display the co-ordinates instead of a symbol.Here is the screen shot.I want a label where , there is a circle symbol plot in the screen shot.
Set the plotSymbol to nil to remove the symbols from the plot. You want to use data labels to label the points. If you just want to show the y-coordinate, set a labelTextStyle and labelFormatter. The plot will create and display labels automatically using the given style and number format.
If you need more complex labels (e.g., showing both x and y coordinates), you can make custom labels. Implement the -dataLabelForPlot:recordIndex: datasource method. This method can return any CPTLayer, so you have a lot of flexibility. For simple text labels, create a string with the label text and display it in a CPTTextLayer. The plot will position the label for you and keep it aligned with the data point if it moves.

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

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.

Resources