SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0
0

This might need to be two separate questions, but is there a way to select a point in a line series. or, can I style a pointMarker differently for each data point?

I would prefer to not have to do this with annotations.

Version
2.5.0
  • You must to post comments
0
0

Hi There,

You can’t select points out of the box, but you can create custom special modifier similar to ours SeriesSelectionModifier.
As for styling – sure, you can style pointMarkers differently for each point via palette provider, please see the code below:

@interface PointMarkerPaletteProvider : SCIPaletteProvider
@end

@implementation PointMarkerPaletteProvider {
    SCILineSeriesStyle *_lineStyle;
}

- (instancetype)init {
    self = [super init];
    if (self) {
        _lineStyle = [SCILineSeriesStyle new];
        _lineStyle.pointMarker = [SCIEllipsePointMarker new];
        _lineStyle.pointMarker.fillStyle = [[SCISolidBrushStyle alloc] initWithColorCode:0xffff0000];
    }
    return self;
}

- (id<SCIStyleProtocol>)styleForX:(double)x Y:(double)y Index:(int)index {
    return index % 2 == 0 ? _lineStyle : nil;
}

@end

Hope that helps.
Best Regards,
Nazar R.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.