gujjula / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

Wrong line style in legend's swatch / bug in setting line styles in general #320

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a scatter graph having as line styles in the specified order a
 - solid line
 - a dashed line
 - a solid line
2. Create a legend

What is the expected output? What do you see instead?
For each line the swatch should show the right line style. Unfortunately, the 
third line has a dashed line pattern (the pattern of the second line).

What version of the product are you using? On what operating system?
core-plot 0.4 head

Please provide any additional information below.

The bug is actually in CPTLineStyle.m. Probably the bug does not appear 
anywhere else because drawing lines is done differently for plots than for 
legends. At least scatter plots use for each line a new path. This is not the 
case for legends. Legends do not use explicit paths but draw directly to the 
context.

The bug is in CPTLineStyle's method -setLineStyleInContext:. It does not set a 
solid line style. This means a previous set dashed line pattern is used for the 
whole context till it is replaced by another dashed line pattern.
The attached file solves the problem by setting a solid line style when no dash 
pattern is specified (see attached file).

Hardy

Original issue reported on code.google.com by google@skywind.eu on 20 Aug 2011 at 10:02

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision acd4a6d2d337.

Original comment by eskr...@mac.com on 20 Aug 2011 at 11:41