Charts: 哪个属性控制黄线,如图?

创建于 2017-12-06  ·  3评论  ·  资料来源: danielgindi/Charts

最有用的评论

正确答案:

    <strong i="6">@objc</strong> open func drawHighlightLines(context: CGContext, point: CGPoint, set: ILineScatterCandleRadarChartDataSet)
    {

        // draw vertical highlight lines
        if set.isVerticalHighlightIndicatorEnabled
        {
            context.beginPath()
            context.move(to: CGPoint(x: point.x, y: viewPortHandler.contentTop))
            context.addLine(to: CGPoint(x: point.x, y: viewPortHandler.contentBottom))
            context.strokePath()
        }

        // draw horizontal highlight lines
        if set.isHorizontalHighlightIndicatorEnabled
        {
            context.beginPath()
            context.move(to: CGPoint(x: viewPortHandler.contentLeft, y: point.y))
            context.addLine(to: CGPoint(x: viewPortHandler.contentRight, y: point.y))
            context.strokePath()
        }
    }

所有3条评论

如何隐藏它

DataSet.highlightEnabled = false
highlightEnabled.highlightColor = UIColor.clear

正确答案:

    <strong i="6">@objc</strong> open func drawHighlightLines(context: CGContext, point: CGPoint, set: ILineScatterCandleRadarChartDataSet)
    {

        // draw vertical highlight lines
        if set.isVerticalHighlightIndicatorEnabled
        {
            context.beginPath()
            context.move(to: CGPoint(x: point.x, y: viewPortHandler.contentTop))
            context.addLine(to: CGPoint(x: point.x, y: viewPortHandler.contentBottom))
            context.strokePath()
        }

        // draw horizontal highlight lines
        if set.isHorizontalHighlightIndicatorEnabled
        {
            context.beginPath()
            context.move(to: CGPoint(x: viewPortHandler.contentLeft, y: point.y))
            context.addLine(to: CGPoint(x: viewPortHandler.contentRight, y: point.y))
            context.strokePath()
        }
    }
此页面是否有帮助?
0 / 5 - 0 等级

相关问题

deepumukundan picture deepumukundan  ·  3评论

newbiebie picture newbiebie  ·  3评论

kirti0525 picture kirti0525  ·  3评论

Shunshine07 picture Shunshine07  ·  3评论

sjdevlin picture sjdevlin  ·  3评论