user1227928
user1227928

Reputation: 829

Showing Coreplot barchart value without selection

Currently i am refering to following coreplot tutorial to learn bar chart plotting.

So while showing the value w.r.t each bar user has to tap each bar & finally CPTBarPlotDelegate method gets called & value is shown

-(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index {

}

But what i am looking is without selecting any bar, it should show me all the values in 90 degree orientation.

Is this possible. How to do it ?

Upvotes: 2

Views: 369

Answers (1)

Eric Skroch
Eric Skroch

Reputation: 27381

Use data labels with any plot to label each value. Set the labelTextStyle to turn on basic numeric labels. Use the following properties to customize the labels:

  • labelOffset
  • labelRotation
  • labelField
  • labelTextStyle
  • labelFormatter
  • labelShadow

Use one of the following datasource methods to provide custom labels if the basic text labels aren't enough or if you want to skip some labels:

-(NSArray *)dataLabelsForPlot:(CPTPlot *)plot recordIndexRange:(NSRange)indexRange;
-(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)idx;

Upvotes: 2

Related Questions