Skip to content

Commit

Permalink
GitHub Sync (google#319)
Browse files Browse the repository at this point in the history
* Fix horizontal follow line to match vertical follow line

The horizontal follow line for `LinePointHighlighter` behavior was always being drawn as a dashed line and could not be changed. This change makes it match the vertical follow line pattern which can be changed with the `dashPattern` parameter.

Closes google#238

PiperOrigin-RevId: 265520297

* Fixed import clash for Point class

On Flutter master, when targeting web, the following error occurs:

packages/charts_flutter/src/behaviors/zoom/pan_behavior.dart:17:1: Error: 'Point' is imported from both
'dart:math' and 'dart:ui'.
import 'dart:ui';

I updated the import to read:

import 'dart:ui' show lerpDouble;

Closes google#284

PiperOrigin-RevId: 265534847

* Fix issue google#116 - Exception using desiredMaxColumns in SeriesLegend

Fix issue google#116

Padding rows using a Padding widget and not a Row widget.
Specifying type Iterable<Padding> in the generator.

Closes google#192

PiperOrigin-RevId: 265555440

* Fixing ArcRendererConfig(stroke color)

The stroke color is set to white by default but couldn't be modified.
I add an `arcStrokeColor` value to Style class.
So it can be changed by replace customized style.

Closes google#197

PiperOrigin-RevId: 265572617

* Update versioning.

PiperOrigin-RevId: 265676481

* Internal changes.

PiperOrigin-RevId: 265794470
  • Loading branch information
lorrainekan authored and JackMoseley2001 committed Nov 1, 2021
1 parent 9ab72ae commit 70e78fb
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 8 deletions.
File renamed without changes.
3 changes: 3 additions & 0 deletions charts_common/CHANGELOG.md
@@ -1,3 +1,6 @@
# 0.8.0
* Bug fixes from open source.

# 0.7.0
* Added vertical bar label

Expand Down
Expand Up @@ -451,7 +451,7 @@ class _LinePointLayoutView<D> extends LayoutView {
],
stroke: StyleFactory.style.linePointHighlighterColor,
strokeWidthPx: 1.0,
dashPattern: [1, 3]);
dashPattern: dashPattern);

if (showHorizontalFollowLine ==
LinePointHighlighterFollowLineType.nearest) {
Expand Down
2 changes: 1 addition & 1 deletion charts_common/lib/src/chart/pie/arc_renderer_config.dart
Expand Up @@ -84,7 +84,7 @@ class ArcRendererConfig<D> extends LayoutViewConfig
this.strokeWidthPx = 2.0,
SymbolRenderer symbolRenderer})
: this.noDataColor = StyleFactory.style.noDataColor,
this.stroke = StyleFactory.style.white,
this.stroke = StyleFactory.style.arcStrokeColor,
this.symbolRenderer = symbolRenderer ?? new CircleSymbolRenderer();

@override
Expand Down
3 changes: 3 additions & 0 deletions charts_common/lib/src/common/style/material_style.dart
Expand Up @@ -73,6 +73,9 @@ class MaterialStyle implements Style {
@override
Color get defaultSeriesColor => MaterialPalette.gray.shadeDefault;

@override
Color get arcStrokeColor => MaterialPalette.white;

@override
Color get legendEntryTextColor => MaterialPalette.gray.shade800;

Expand Down
3 changes: 3 additions & 0 deletions charts_common/lib/src/common/style/style.dart
Expand Up @@ -63,6 +63,9 @@ abstract class Style {
/// data.
Color get defaultSeriesColor;

/// Default color for strokes for [ArcRendererConfig].
Color get arcStrokeColor;

/// Default color for entry text for [Legend].
Color get legendEntryTextColor;

Expand Down
2 changes: 1 addition & 1 deletion charts_common/pubspec.yaml
@@ -1,5 +1,5 @@
name: charts_common
version: 0.7.0
version: 0.8.0
description: A common library for charting packages.
author: Charts Team <charts_flutter@google.com>
homepage: https://github.com/google/charts
Expand Down
3 changes: 3 additions & 0 deletions charts_flutter/CHANGELOG.md
@@ -1,3 +1,6 @@
# 0.8.0
* Bug fixes from open source.

# 0.7.0
* Added vertical bar label

Expand Down
8 changes: 6 additions & 2 deletions charts_flutter/lib/src/behaviors/legend/legend_layout.dart
Expand Up @@ -27,6 +27,9 @@ class TabularLegendLayout implements LegendLayout {
/// No limit for max rows or max columns.
static const _noLimit = -1;

/// Default EdgeInsets for padding rows to the max column count
static const defaultCellPadding = const EdgeInsets.all(8.0);

final bool isHorizontalFirst;
final int desiredMaxRows;
final int desiredMaxColumns;
Expand Down Expand Up @@ -132,7 +135,7 @@ class TabularLegendLayout implements LegendLayout {
}

Table _buildTableFromRows(List<TableRow> rows) {
final padWidget = new Row();
final padWidget = Padding(padding: cellPadding ?? defaultCellPadding);

// Pad rows to the max column count, because each TableRow in a table is
// required to have the same number of children.
Expand All @@ -144,7 +147,8 @@ class TabularLegendLayout implements LegendLayout {
final rowChildren = rows[i].children;
final padCount = columnCount - rowChildren.length;
if (padCount > 0) {
rowChildren.addAll(new Iterable.generate(padCount, (_) => padWidget));
rowChildren
.addAll(new Iterable<Padding>.generate(padCount, (_) => padWidget));
}
}

Expand Down
2 changes: 1 addition & 1 deletion charts_flutter/lib/src/behaviors/zoom/pan_behavior.dart
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.

import 'dart:math' show max, pow, Point;
import 'dart:ui';
import 'dart:ui' show lerpDouble;

import 'package:flutter/widgets.dart' show AnimationController;

Expand Down
4 changes: 2 additions & 2 deletions charts_flutter/pubspec.yaml
@@ -1,5 +1,5 @@
name: charts_flutter
version: 0.7.0
version: 0.8.0
description: Material Design charting library for flutter.
author: Charts Team <charts_flutter@google.com>
homepage: https://github.com/google/charts
Expand All @@ -13,7 +13,7 @@ dependencies:
#
# The pub version of charts_flutter will point to the pub version of charts_common.
# The latest pub version is commented out and shown below as an example.
# charts_common: 0.7.0
# charts_common: 0.8.0
charts_common:
path: ../charts_common/
collection: ^1.14.5
Expand Down

0 comments on commit 70e78fb

Please sign in to comment.