I'm using core plot for plotting a bar chart.
There i'm using custom labels (CPTAxisLabel) for X-Axis labels.
Some of my labels are long in length. In such cases, labels are not getting wrapped to next lines.
How can i achieve it in CPTAxisLabel ?
-Balaji R.
You can insert newline ('\n') characters in any text in Core Plot to force it to wrap to the next line. Use the textAlignment property of the text style to control the alignment (left, center, right) of the lines of text.
Related
I am added CPTlegend in my pie chart but i am unable to find how to set cptlegend text as more than two lines how?
Insert a newline ("\n") character in any Core Plot text to break the text into multiple lines.
I am designing an HighCharts bubble chart (a matrix with coloured fields, drawn using SVG), that should have some text explaining the axis values outside of the actual chart area.
That is, because the axis values are A-E and need a lengthy explanation (A = Always exceeds goals bla bla etc.).
These explanations should be visible - next to the chart, not in it, and not in tooltips because these cannot be printed.
My question: Can I put SVG <text/> outside of the plot area? HighCharts seems to stretch the plot area as far as it can, leaving no space to either side.
You can use text text and define css styles i.e: position:absolute;left:20px;top:20px;
I want to add a label to a core plot scatter chart. It should be at a specific y value at the left edge of the chart, like that:
I tried doing it using annotation but I have a problem with dragging. When I drag the chart the annotation is also being dragged, and I would like it to always stay at the left edge.
Create your label as a plot space annotation. Use a plot space delegate to monitor changes to the xRange and update the x-value of the anchor point as needed. You can use the plot space to convert the desired x-position to the corresponding data value for the anchor point.
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.
I use a custom font in my Core Plot legend. However, this causes the label to no longer be vertically aligned with the plot key (the little color line representing the plot above). When using a standard font, the alignment is perfect. Can this be fixed please?