Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
395
Custom Legend
posted

Hello,

I am using two line series in first chart.

first is solid line which indicates sales and second is dotted line which indicates trend.

Now the problem is sales legend shows perfectly but trend line legend won't show perfect because it doesn't show dotted line in legend.

have a look in this link :

https://ramjansayyad.opendrive.com/files?Nl8zMDk5NjY0MV9JRzQ5OA

The other chart consists of three line series. Two lines which is fusilev and leucovorin legends are perfect. i have removed the colour of third line which indicates share and use marker instead. 

Now the problem is i am unable to set that marker in the legend. I have return image of pyramid in view for marker delegate method. Now i want to set it in legend.

Have a look in this link :

https://ramjansayyad.opendrive.com/files?Nl8zMDk5NjY0OF9IVDQ1UA

Kindly suggest me what should i do for setting this kind of legend ?

Thanks.

Parents
No Data
Reply
  • 26458
    Offline posted

    The dash array is being ignored for legend items. We will fix that for the upcoming service release (Dev issue #163683). This is a fairly straight forward fix.

    The custom markers weren't meant to show up in the legend. This is mostly due to how flexible custom markers are. A legend badge typically represents an entire series, but with custom markers, each point can have something different. I think the best way to work around this issue is to create a custom legend that derives form IGLegend. Here's a quick example. Note, that this code will replace all the badges with a custom image. If you want just one of the series to do this, simply use a specific item index, instead of using the for loop.

    @implementation CustomLegend

    -(void)buildItemViews:(NSMutableArray *)items

    {

        [super buildItemViews:items];

        

        UIScrollView *scrollView = self.subviews[0];

        

        for(int itemIndex = 0; itemIndex < items.count; itemIndex++)

        {

            UIView *container = scrollView.subviews[itemIndex];

            UILabel *label = container.subviews[0];

            UIImageView *badge = container.subviews[1];

            badge.image = _yourCustomImage;

        }

    }

    @end

     

Children
No Data