Airtower / core-plot

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

The swatchBorderLineStyle for a CPTLegend is drawn over with the borderLineStyle of a CPTPieChart #609

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a Chart (I used a pieChart), set its borderLineStyle
2. Add a legend
3. Set the swatchBorderLineStyle-property on the CPTLegend

What is the expected output? What do you see instead?

I expect to get a border drawn around the swatches with the lineWidth, color 
and CGLineJoin as specified in the swatchBorderLineStyle-property.
Instead the swatches get their borderWidth etc from the 

CPTPieChart.borderLineStyle.lineWidth
CPTPieChart.borderLineStyle.lineColor

What version of the product are you using? On what operating system?

1.4 on a iPod with iOS 6.1.3

Please provide any additional information below.
-

Original issue reported on code.google.com by ilpaC0...@gmail.com on 26 Nov 2013 at 3:46

GoogleCodeExporter commented 8 years ago
Edit: If you actually remove the borderLineStyle from the CPTPieChart you will 
get the border as specified in the swatchBorderLineStyle... it is simply hidden 
below the borderLineStyle specified in teh CPTPieChart

Original comment by ilpaC0...@gmail.com on 26 Nov 2013 at 3:47

GoogleCodeExporter commented 8 years ago
I attached a Screenshot.

As you can see the pieChart has a white Border with a 2.0f lineWidth.
The swatches in the legend get the same border assigned...even though I 
specified it to be different.

And here comes another "problem".
What if I actually want to have a different border for each swatch?
I do not need this right now, but it would be nice.

With that said: Thank you very muhc for your great library. You did a great 
job. Thanks a lot!

Original comment by ilpaC0...@gmail.com on 26 Nov 2013 at 3:56

Attachments:

GoogleCodeExporter commented 8 years ago
This is working as designed. The legend swatch is drawn first with the given 
fill and border and then the plot draws over top with additional elements 
depending on the plot type. The pie chart uses the pie chart border and slice 
fill for the swatch.

We can add configuration options to customize the pie chart swatches.

You can use the -legend:shouldDrawSwatchAtIndex:forPlot:inRect:inContext: 
legend delegate method to draw custom legend swatches. We can add new legend 
delegate methods to customize the swatch fills and borders without resorting to 
custom drawing.

Original comment by eskr...@mac.com on 27 Nov 2013 at 1:03

GoogleCodeExporter commented 8 years ago
Thanks for clearifying this to me.
It would be great if you'd add thie once you find the time :)

Thanks in advance

Original comment by ilpaC0...@gmail.com on 27 Nov 2013 at 7:01

GoogleCodeExporter commented 8 years ago

Original comment by eskr...@mac.com on 21 Dec 2013 at 1:53

GoogleCodeExporter commented 8 years ago
This issue was closed by revision abd3486e2ba0.

Original comment by eskr...@mac.com on 21 Dec 2013 at 5:15