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
85
IGTooltip: limitation
posted

Hello

first of all your product seems great and I really hope it can change our way to create charts, from HighChart html to a native component.

Said that one of the strongest features of HighChart is the tooltip management.

I tried a bit the Nuclios tooltip and apart that I don't find documentation, it seems it is not usable in financial series (OHLC..)

Am I right? And if I'm you have plans to implement the tooltip there too? (showing max-min, average values etc)

Thanks

Paolo

Parents
  • 4940
    Offline posted

    Thanks for the compliments on the release!

    The tooltip feature was added later in the release cycle and will be documented in the next release. Since you were using the samples as a reference to create the tooltip, you may have missed that the type of chart used will use a different type of data point. For the financial price series in OHLC, you will need to use the IGOHLCPoint. Reference code is below. Let me know if you have any further question.

    - (UIView *)chartView:(IGChartView *)chartView viewForTooltipWithItemlist:(NSDictionary *)itemlist
    {
        UILabel *valueLabel = [[UILabel alloc] init];
    
        if ([itemlist count] > 0)
        {
            NSString *seriesKey = (NSString*)[[itemlist allKeys] objectAtIndex:0];
            double pointValue = ((IGOHLCPoint *)[itemlist valueForKey:seriesKey]).highValue;
    
            valueLabel.backgroundColor = [UIColor whiteColor];
            valueLabel.text = [NSString stringWithFormat:@" High Value: $%.2f ", pointValue];
            [valueLabel sizeToFit];
            valueLabel.frame = CGRectMake(5, 5, valueLabel.frame.size.width, valueLabel.frame.size.height);
        }
    
        return valueLabel;
    }
    
Reply Children