-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catch up with a small feature from 2.1.1 (Fixes #249)
- Loading branch information
1 parent
3e51af3
commit 2a0e534
Showing
13 changed files
with
139 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// LineScatterCandleChartDataSet.swift | ||
// Charts | ||
// | ||
// Created by Daniel Cohen Gindi on 29/7/15. | ||
// | ||
// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda | ||
// A port of MPAndroidChart for iOS | ||
// Licensed under Apache License 2.0 | ||
// | ||
// https://github.com/danielgindi/ios-charts | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
public class LineScatterCandleChartDataSet: BarLineScatterCandleChartDataSet | ||
{ | ||
/// Enables / disables the horizontal highlight-indicator. If disabled, the indicator is not drawn. | ||
public var drawHorizontalHighlightIndicatorEnabled = true | ||
|
||
/// Enables / disables the vertical highlight-indicator. If disabled, the indicator is not drawn. | ||
public var drawVerticalHighlightIndicatorEnabled = true | ||
|
||
public var isHorizontalHighlightIndicatorEnabled: Bool { return drawHorizontalHighlightIndicatorEnabled } | ||
public var isVerticalHighlightIndicatorEnabled: Bool { return drawVerticalHighlightIndicatorEnabled } | ||
|
||
/// Enables / disables both vertical and horizontal highlight-indicators. | ||
/// :param: enabled | ||
public func setDrawHighlightIndicators(enabled: Bool) | ||
{ | ||
drawHorizontalHighlightIndicatorEnabled = enabled | ||
drawVerticalHighlightIndicatorEnabled = enabled | ||
} | ||
|
||
// MARK: NSCopying | ||
|
||
public override func copyWithZone(zone: NSZone) -> AnyObject | ||
{ | ||
var copy = super.copyWithZone(zone) as! LineScatterCandleChartDataSet | ||
copy.drawHorizontalHighlightIndicatorEnabled = drawHorizontalHighlightIndicatorEnabled | ||
copy.drawVerticalHighlightIndicatorEnabled = drawVerticalHighlightIndicatorEnabled | ||
return copy | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
Charts/Classes/Renderers/LineScatterCandleRadarChartRenderer.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// LineScatterCandleRadarChartRenderer.swift | ||
// Charts | ||
// | ||
// Created by Daniel Cohen Gindi on 29/7/15. | ||
// | ||
// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda | ||
// A port of MPAndroidChart for iOS | ||
// Licensed under Apache License 2.0 | ||
// | ||
// https://github.com/danielgindi/ios-charts | ||
// | ||
|
||
import Foundation | ||
import CoreGraphics | ||
import UIKit | ||
|
||
public class LineScatterCandleRadarChartRenderer: ChartDataRendererBase | ||
{ | ||
public override init(animator: ChartAnimator?, viewPortHandler: ChartViewPortHandler) | ||
{ | ||
super.init(animator: animator, viewPortHandler: viewPortHandler) | ||
} | ||
|
||
/// Draws vertical & horizontal highlight-lines if enabled. | ||
/// :param: context | ||
/// :param: points | ||
/// :param: horizontal | ||
/// :param: vertical | ||
public func drawHighlightLines(#context: CGContext, points: UnsafePointer<CGPoint>, horizontal: Bool, vertical: Bool) | ||
{ | ||
// draw vertical highlight lines | ||
if vertical | ||
{ | ||
CGContextStrokeLineSegments(context, points, 2) | ||
} | ||
|
||
// draw horizontal highlight lines | ||
if horizontal | ||
{ | ||
var pts = UnsafePointer<CGPoint>() | ||
CGContextStrokeLineSegments(context, points.advancedBy(2), 2) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters