LegendStyle text aligment not working?


#1

Hello again.

Still playing with the library, I want to have my legend labels right aligned not center aligned as they are by default… 

I set the legendStyle’s textAligment property to UITextAlignmentRight but stil the legends are centered. This I set after creating the chart’s theme and customizing it .

Thx

Gustavo


#2

Hello. Not sure if this is the solution, but I did the following and it worked

-(void)sChartRenderFinished:(ShinobiChart *)chart
{
    
    for(UILabel * label in self.pieChart.legend.labels){        
         [label setTextAlignment:NSTextAlignmentRight];
    }
    
    
}

G.


#3

Where exactly do you set the legends style?

When I directly change the style property like chart.legend.style.textAlignment = NSTextAlignmentRight; it works correctly.

See  Right Aligned vs  Centered


#4

Quote: I set the legendStyle’s textAligment property to UITextAlignmentRight but stil the legends are centered. This I set after creating the chart’s theme and customizing  

Quote: When I directly change the style property like chart.legend.style.textAlignment = NSTextAlignmentRight; it works correctly.

Confirming that this bug exists and still present, just wasted some time on it then found this page.

If you read well the report, setting someTheme. legendStyle .textAlignment doesnt work.

chart. legend.style .textAlignment does work, but is just an ugly workaround if you wand to code your own theme by inheritance.