Why is the text inverted?
I have implemented corePlot in my project xcode
. I am trying to add legend
to another cell
.
I can add legend
to another cell, but when I do, the text is flipped.
Here is my code:
- (void)configureLegend
{
CPTGraph *graph = self.hostView.hostedGraph;
CPTLegend *theLegend = [CPTLegend legendWithGraph:graph];
// Add legend to graph
graph.legend = theLegend;
graph.legendAnchor = CPTRectAnchorRight;
CGFloat legendPadding = - (self.chartView.bounds.size.width / 8);
graph.legendDisplacement = CGPointMake(legendPadding, 0.0);
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:2 inSection:0]];
[cell.layer addSublayer:graph.legend];
This is what I tried:
theLegend.transform = CATransform3DMakeRotation(M_PI / 180.0f, 0, 1, 0);
}
It didn't do anything. Results in the same place. Why is this happening, and how can I get the text to display normally and not upside down?
Edit
This is shown when I add it as a sublayer: (It says "First", "Second".)
+3
source to share