kaiserfarrell / core-plot

Automatically exported from code.google.com/p/core-plot
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

CPTScatterPlot label text's duplication #420

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Created linePlot through
 CPTScatterPlot *linePlot = [(CPTScatterPlot *)[CPTScatterPlot alloc] initWithFrame:graph.bounds];
linePlot.dataLineStyle = lineStyle;
    linePlot.dataSource = self.dataSource;
    linePlot.labelFormatter = formatter;
    linePlot.labelTextStyle = textStyle;
2. Added linePlot to main graph and draw/update
    [graph addPlot:linePlot];
    [linePlot reloadData];
What is the expected output?
3. Draws chart with label text on it(between/at start/at end point) only
once.

What do you see instead?
4. Draws chart(attach) with label text on both sides(start/end point of 
linePlot).

What version of the product are you using? On what operating system?
Integrated CorePlot v1.0(release and several patches after) as iOS static lib.

Please provide any additional information below.

I need to draw horizontal line in runtime with Y-value texted above. Maybe 
there is some other kind of plot to do that, but it seems that scatter plot is 
what i need.

Original issue reported on code.google.com by Max...@gmail.com on 3 Apr 2012 at 9:56

Attachments:

GoogleCodeExporter commented 8 years ago
Every data point on a scatter plot will be labeled by default. If you want a 
label somewhere in the middle, you'll need a data point there. Use the 
-dataLabelForPlot:recordIndex: datasource method control the labels. Return nil 
to use the default label for that point. Return [NSNull null] to suppress the 
label.

Original comment by eskr...@mac.com on 4 Apr 2012 at 1:39