ivnsch / SwiftCharts

Easy to use and highly customizable charts library for iOS
Apache License 2.0
2.53k stars 410 forks source link

barSpacing variable gone #289

Closed ahartman closed 7 years ago

ahartman commented 7 years ago

In the latest version of SwiftCharts, downloaded 27 August, you can no longer let SwiftCharts calculate barWidth by only passing barSpacing. The parameter barSpacing is gone, there is only a parameter barWidth.

ivnsch commented 7 years ago

Where's that? In ChartGroupedBarsLayer at least you can pass both (none mandatory).

ahartman commented 7 years ago

This is in ChartStackedBarsLayer.swift. ChartStackedBarsLayer.swift has only barWidth, see below. Kind regards, André Hartman

public init(xAxis: ChartAxis, yAxis: ChartAxis, innerFrame: CGRect, barModels: [ChartStackedBarModel], horizontal: Bool = false, barWidth: CGFloat, settings: ChartBarViewSettings, stackFrameSelectionViewUpdater: ChartViewSelector? = nil, tapHandler: ((ChartTappedBarStacked) -> Void)? = nil)

ahartman commented 7 years ago

Dear Ivan,

ChartStackedBarsLayer only has barWidth:

init(horizontal: Bool, layer: ChartCoordsSpaceLayer, barWidth: CGFloat, viewGenerator: ChartStackedBarsLayer.ChartBarViewGenerator? = nil) { self.stackedViewGenerator = viewGenerator super.init(horizontal: horizontal, layer: layer, barWidth: barWidth, viewGenerator: nil) }

Met vriendelijke groeten, Kind regards, Mes meilleures salutations, André Hartman Rodeweg 90 B-2920 Kalmthout België tel: 0032 3 666 0411 GSM: 0032 488 626 895

Op 27 aug. 2017, om 22:53 heeft Ivan Schütz notifications@github.com het volgende geschreven:

Where's that? In ChartGroupedBarsLayer https://github.com/i-schuetz/SwiftCharts/blob/master/SwiftCharts/Layers/ChartGroupedBarsLayer.swift#L44 at least you can pass both.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/i-schuetz/SwiftCharts/issues/289#issuecomment-325224053, or mute the thread https://github.com/notifications/unsubscribe-auth/AAqAvFF0Ccdlvm38Wd9xX0m0tsacfgXtks5scddKgaJpZM4PDtK4.

ivnsch commented 7 years ago

Sorry for the long delay... and also because this is a non-answer: I honestly don't remember why it was removed and don't have time to investigate this. But you can determine the spacing indirectly by setting the width (and possibly the zoom level). Hope this doesn't cause a lot of trouble!