Skip to content

Releases: AppPear/ChartView

2.0.0

02 Mar 08:35

Choose a tag to compare

Changelog

2.0.0

Added

  • Full SwiftUI-idiomatic modifier API:
    • chartData, chartXRange, chartYRange
    • chartGridLines, chartGridStroke, chartGridBaseline
    • chartXAxisLabels, chartYAxisLabels, chartAxisFont, chartAxisColor
    • chartLineWidth, chartLineBackground, chartLineMarks, chartLineStyle, chartLineAnimation
    • chartInteractionValue
    • chartSelectionHandler
    • chartPerformance
  • Immutable chart configuration structs and environment-key-based composition.
  • Updated docs/examples and generated showcase app.
  • Dynamic streaming data source support via ChartStreamingDataSource.
  • Unified X-axis alignment strategy shared across chart layers.
  • Apple privacy manifest for SDK distribution (PrivacyInfo.xcprivacy).

Changed

  • Major clean break from mutating chain APIs.
  • Chart style/data/range/axis/grid/line configs are now modifier-driven and value-based.

Fixed

  • Removed required @EnvironmentObject interaction dependency for basic chart rendering paths.
  • Existing regression and smoke tests remain green after API shift.

Migration

  • See MIGRATION.md for full old-to-new mapping.

2.0.0-beta.8: feat: add animation toggle interface (#256)

26 Nov 13:38
7140b8b

Choose a tag to compare

Co-authored-by: “Andras <“andras.samu@supercharge.io”>

Fixed background shape for non origin charts

24 Oct 14:09
ebaaf81

Choose a tag to compare

2.0.0-beta.7

feat: new protocol for chained functions, and added support for expli…

Added chart mark custom color

17 Oct 17:44

Choose a tag to compare

Pre-release
2.0.0-beta.6

feat: add new axis interface

Added new background interface

16 Oct 18:15

Choose a tag to compare

Pre-release

.setBackground(colorGradient: ColorGradient(.red, .yellow))

Added new axis labels

09 Oct 20:11

Choose a tag to compare

Added new axis labels Pre-release
Pre-release

Added new axis labels

new functions are:

func setAxisYLabels(_ labels: [String], position: AxisLabelsYPosition = .leading)

func setAxisXLabels(_ labels: [String])

func setAxisYLabels(_ labels: [(Double, String)], range: ClosedRange<Int>, position: AxisLabelsYPosition = .leading)

func setAxisXLabels(_ labels: [(Double, String)], range: ClosedRange<Int>)

Adds a much improved LineChart

29 Sep 17:26

Choose a tag to compare

Pre-release

LineChart now supports these new functions:

func setLineWidth(width: CGFloat) - to set line width
func showBackground(_ show: Bool) - to show background below a line
func showChartMarks(_ show: Bool) - to show marks at the points
func setLineStyle(to style: LineStyle) - to set it curved or straight

New elements:

ChartGrid

displays a user defined grid behind chart

func setNumberOfHorizontalLines(_ numberOfLines: Int) - to display horizontal lines
func setNumberOfVerticalLines(_ numberOfLines: Int) - to display vertical lines
func setStoreStyle(_ strokeStyle: StrokeStyle) - to set stroke pattern linewidth etc...
func setColor(_ color: Color) - set color
func showBaseLine(_ show: Bool, with style: StrokeStyle? = nil) - show a line at the base with given style

AxisLabels

displays user defined labels along X or Y or both axises

func setAxisYLabels(_ labels: [String]) - takes and array which will be displayed along Y axis
func setAxisXLabels(_ labels: [String]) - takes and array which will be displayed along X axis

Demo

Displaying a simple line chart with marks and X and Y ranges.

LineChart()
    .setLineWidth(width: 2)
    .showChartMarks(true)
    .showBackground(false)
    .data([2, 4, 5, 1, 3])
    .rangeY(0...10)
    .rangeX(0...10)
    .chartStyle(ChartStyle(backgroundColor: .white, foregroundColor: ColorGradient(.blue, .purple)))

Adding a grid behind the LineChart

ChartGrid {
    LineChart()
        .setLineWidth(width: 2)
        .showChartMarks(true)
        .showBackground(false)
        .data([2, 4, 5, 1, 3])
        .rangeY(0...10)
        .rangeX(0...10)
        .chartStyle(ChartStyle(backgroundColor: .white, foregroundColor: ColorGradient(.blue, .purple)))
}
.setNumberOfHorizontalLines(11)
.setNumberOfVerticalLines(11)
.showBaseLine(true)

Adding labels along X and Y axises

AxisLabels {
    ChartGrid {
        LineChart()
            .setLineWidth(width: 2)
            .showChartMarks(true)
            .showBackground(false)
            .data([2, 4, 5, 1, 3])
            .rangeY(0...10)
            .rangeX(0...10)
            .chartStyle(ChartStyle(backgroundColor: .white, foregroundColor: ColorGradient(.blue, .purple)))
    }
    .setNumberOfHorizontalLines(11)
    .setNumberOfVerticalLines(11)
    .showBaseLine(true)
}
.setAxisYLabels(["0","5","10"])
.setAxisXLabels(["27 Oct", "2 Nov", "9 Nov", "15 Nov", "22 Nov"])

ChartViews v2 Beta 2 release

21 Aug 13:55
caa75ec

Choose a tag to compare

Pre-release
  • improved handling of negative numbers
  • precise alignment of line chart view to the grid lines
  • interaction enabled on: bar chart, line chart, pie chart, ring chart
  • new bar chart shape

Fixed some bugs and merged PRs for V1 while V2 is being developed

26 Mar 18:38
9115a99

Choose a tag to compare

Add legend format specifier option in LineView (#186)

Co-authored-by: ClaesCJ <claes@airwallet.net>

Add interaction for piechart

01 Aug 09:51

Choose a tag to compare

1.5.4

Fixed missing self in piechartrow