From 61bacce6dba4b3fe5384fcfbf9bf811c1187da87 Mon Sep 17 00:00:00 2001 From: imaNNeoFighT Date: Tue, 10 Dec 2019 22:41:13 +0330 Subject: [PATCH 1/2] use targetData to draw the titles, fixed #130. --- lib/src/chart/bar_chart/bar_chart_painter.dart | 8 ++++---- lib/src/chart/line_chart/line_chart_painter.dart | 10 +++++----- lib/src/chart/scatter_chart/scatter_chart_painter.dart | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/src/chart/bar_chart/bar_chart_painter.dart b/lib/src/chart/bar_chart/bar_chart_painter.dart index 14ea3c02d..9d40eb4ba 100644 --- a/lib/src/chart/bar_chart/bar_chart_painter.dart +++ b/lib/src/chart/bar_chart/bar_chart_painter.dart @@ -267,13 +267,13 @@ class BarChartPainter extends AxisChartPainter with TouchHandler groupBarsPosition) { - if (!data.titlesData.show) { + if (!targetData.titlesData.show) { return; } final Size drawSize = getChartUsableDrawSize(viewSize); // Left Titles - final leftTitles = data.titlesData.leftTitles; + final leftTitles = targetData.titlesData.leftTitles; if (leftTitles.showTitles) { double verticalSeek = data.minY; while (verticalSeek <= data.maxY) { @@ -295,7 +295,7 @@ class BarChartPainter extends AxisChartPainter with TouchHandler with TouchHandler with TouchHandler } void drawTitles(Canvas canvas, Size viewSize) { - if (!data.titlesData.show) { + if (!targetData.titlesData.show) { return; } viewSize = getChartUsableDrawSize(viewSize); // Left Titles - final leftTitles = data.titlesData.leftTitles; + final leftTitles = targetData.titlesData.leftTitles; if (leftTitles.showTitles) { double verticalSeek = data.minY; while (verticalSeek <= data.maxY) { @@ -590,7 +590,7 @@ class LineChartPainter extends AxisChartPainter with TouchHandler } // Top titles - final topTitles = data.titlesData.topTitles; + final topTitles = targetData.titlesData.topTitles; if (topTitles.showTitles) { double horizontalSeek = data.minX; while (horizontalSeek <= data.maxX) { @@ -614,7 +614,7 @@ class LineChartPainter extends AxisChartPainter with TouchHandler } // Right Titles - final rightTitles = data.titlesData.rightTitles; + final rightTitles = targetData.titlesData.rightTitles; if (rightTitles.showTitles) { double verticalSeek = data.minY; while (verticalSeek <= data.maxY) { @@ -636,7 +636,7 @@ class LineChartPainter extends AxisChartPainter with TouchHandler } // Bottom titles - final bottomTitles = data.titlesData.bottomTitles; + final bottomTitles = targetData.titlesData.bottomTitles; if (bottomTitles.showTitles) { double horizontalSeek = data.minX; while (horizontalSeek <= data.maxX) { diff --git a/lib/src/chart/scatter_chart/scatter_chart_painter.dart b/lib/src/chart/scatter_chart/scatter_chart_painter.dart index bdaf892d0..73c448bf6 100644 --- a/lib/src/chart/scatter_chart/scatter_chart_painter.dart +++ b/lib/src/chart/scatter_chart/scatter_chart_painter.dart @@ -45,13 +45,13 @@ class ScatterChartPainter extends AxisChartPainter with TouchH } void drawTitles(Canvas canvas, Size viewSize) { - if (!data.titlesData.show) { + if (!targetData.titlesData.show) { return; } viewSize = getChartUsableDrawSize(viewSize); // Left Titles - final leftTitles = data.titlesData.leftTitles; + final leftTitles = targetData.titlesData.leftTitles; if (leftTitles.showTitles) { double verticalSeek = data.minY; while (verticalSeek <= data.maxY) { @@ -73,7 +73,7 @@ class ScatterChartPainter extends AxisChartPainter with TouchH } // Top titles - final topTitles = data.titlesData.topTitles; + final topTitles = targetData.titlesData.topTitles; if (topTitles.showTitles) { double horizontalSeek = data.minX; while (horizontalSeek <= data.maxX) { @@ -97,7 +97,7 @@ class ScatterChartPainter extends AxisChartPainter with TouchH } // Right Titles - final rightTitles = data.titlesData.rightTitles; + final rightTitles = targetData.titlesData.rightTitles; if (rightTitles.showTitles) { double verticalSeek = data.minY; while (verticalSeek <= data.maxY) { @@ -119,7 +119,7 @@ class ScatterChartPainter extends AxisChartPainter with TouchH } // Bottom titles - final bottomTitles = data.titlesData.bottomTitles; + final bottomTitles = targetData.titlesData.bottomTitles; if (bottomTitles.showTitles) { double horizontalSeek = data.minX; while (horizontalSeek <= data.maxX) { From af6c15bd6b00d982fce8832998218f1c6b44f488 Mon Sep 17 00:00:00 2001 From: imaNNeoFighT Date: Tue, 10 Dec 2019 23:20:00 +0330 Subject: [PATCH 2/2] bump version to 0.5.2 --- CHANGELOG.md | 3 +++ README.md | 2 +- pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15c6acacc..194198f9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.5.2 +* drawing titles using targetData instead of animating data, fixed issue #130. + ## 0.5.1 * prevent to show touch indicators if barData.show is false in LineChart, [#125](https://github.com/imaNNeoFighT/fl_chart/issues/125). diff --git a/README.md b/README.md index 13c136044..fca85d584 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Thank you all! ```kotlin dependencies: - fl_chart: ^0.5.1 + fl_chart: ^0.5.2 ``` diff --git a/pubspec.yaml b/pubspec.yaml index f08c587f8..7c2a50993 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fl_chart description: A powerful Flutter chart library, currently supporting Line Chart, Bar Chart and Pie Chart. -version: 0.5.1 +version: 0.5.2 author: Iman Khoshabi homepage: https://github.com/imaNNeoFighT/fl_chart