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
35
Place label above candle stick
posted

I want to add the price direction labels on candlestic, i am using Financial Charts with type candlestic, need your help and advice on this matter you can see the label on the screen i am adding.

Secondly, is it possible to add bar chart for financial data using infragistics like the above screen. 

Parents
No Data
Reply
  • 26458
    Offline posted

    Hi,

    Currently the chart can only display custom markers for series that display markers. Financial chart is not one of those types.
    You can potentially overlay a point series bound to an open of close value on top of the financial chart and replace its markers with text. That might be the simplest way to add text to your chart.

    If you proceed with this scenario, you would create a new datasource helper and a new point series. You can bind it to the same data as the financial chart, just pick one of the properties to bind to. Then, handle viewForMarkerInSeries delegate method to replace the right marker with text.

    Regarding having a chart at the bottom, you can do this with an additional chart. We have a sample in the NucliOS samples browser app called "chart synchronization" that does just that. Feel free to check that out.

    _pointDSH = [[IGCategorySeriesDataSourceHelper alloc]initWithData:_chartData andValuePath:@"close"];

    [_chartView addSeriesForType:[IGPointSeries class] usingKey:@"overlay" withDataSource:_pointDSH firstAxisKey:@"x" secondAxisKey:@"y"];

    -(UIView *)chartView:(IGChartView *)chartView viewForMarkerInSeries:(IGSeries *)series withItem:(NSObject *)item index:(NSInteger)index originalSourceItem:(NSObject *)originalSourceItem displayOptions:(IGMarkerDisplayOptions *)options

    {

        if ([series.key isEqualToString:@"overlay"] && index == 3)

        {

            options.offsetY = -10;

            

            IGCategoryPoint *pt = (IGCategoryPoint*)item;

            

            UILabel *label = [[UILabel alloc]init];

            label.text = [NSString stringWithFormat:@"%.2f", pt.value];

            label.textColor = [UIColor blackColor];

            [label sizeToFit];

            return label;

        }

        

        return nil;

    }

Children
No Data