diff --git a/Source/Charts/Charts/ChartViewBase.swift b/Source/Charts/Charts/ChartViewBase.swift index cfa7094cdf..13944f09c1 100644 --- a/Source/Charts/Charts/ChartViewBase.swift +++ b/Source/Charts/Charts/ChartViewBase.swift @@ -456,7 +456,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate } // set the indices to highlight - highlighted = [h] + highlighted = [h] if callDelegate { diff --git a/Tests/ChartsTests/BarChartTests.swift b/Tests/ChartsTests/BarChartTests.swift index 2b0bdca9ce..acdf8383ec 100644 --- a/Tests/ChartsTests/BarChartTests.swift +++ b/Tests/ChartsTests/BarChartTests.swift @@ -367,4 +367,36 @@ class BarChartTests: XCTestCase { chart.notifyDataSetChanged() assertChartSnapshot(matching: chart) } + + func testBarShadow() { + let dataEntries = setupDefaultValuesDataEntries() + let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) + let chart = setupDefaultChart(dataSets: [dataSet]) + dataSet.barShadowColor = NSUIColor(red: 255.0/255.0, green: 187.0/255.0, blue: 115.0/255.0, alpha: 1.0) + chart.drawBarShadowEnabled = true + chart.notifyDataSetChanged() + assertChartSnapshot(matching: chart) + } + + func testHighlightSingleValue() { + let dataEntries = setupDefaultValuesDataEntries() + let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) + let chart = setupDefaultChart(dataSets: [dataSet]) + chart.notifyDataSetChanged() + chart.highlightValue(x: dataEntries[0].x, dataSetIndex: 0, callDelegate: false) + assertChartSnapshot(matching: chart) + } + + func testHighlightMultipleValue() { + let dataEntries = setupDefaultValuesDataEntries() + let dataSet = setupDefaultDataSet(chartDataEntries: dataEntries) + let chart = setupDefaultChart(dataSets: [dataSet]) + chart.notifyDataSetChanged() + chart.highlightValues( + [.init(x: dataEntries[0].x, y: dataEntries[0].y, dataSetIndex: 0), + .init(x: dataEntries[4].x, y: dataEntries[4].y, dataSetIndex: 0), + .init(x: dataEntries[5].x, y: dataEntries[5].y, dataSetIndex: 0)] + ) + assertChartSnapshot(matching: chart) + } } diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testBarShadow-iOS_393-0_852-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testBarShadow-iOS_393-0_852-0.1.png new file mode 100644 index 0000000000..9b0378edeb Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testBarShadow-iOS_393-0_852-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHighlightMultipleValue-iOS_393-0_852-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHighlightMultipleValue-iOS_393-0_852-0.1.png new file mode 100644 index 0000000000..1f5cfc59e4 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHighlightMultipleValue-iOS_393-0_852-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHighlightSingleValue-iOS_393-0_852-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHighlightSingleValue-iOS_393-0_852-0.1.png new file mode 100644 index 0000000000..1159b3cdc5 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/BarChartTests/testHighlightSingleValue-iOS_393-0_852-0.1.png differ