Latest source merged from Syncfusion

This commit is contained in:
pipeline 2021-08-17 06:30:11 +05:30
Родитель c1ccfe4372
Коммит edeba17b40
8 изменённых файлов: 235 добавлений и 43 удалений

Просмотреть файл

@ -0,0 +1,18 @@
---
title: Essential Studio for Flutter Weekly Nuget Release Release Notes
description: Essential Studio for Flutter Weekly Nuget Release Release Notes
platform: flutter
documentation: ug
---
# Essential Studio for Flutter Release Notes
{% include release-info.html date="August 17, 2021" version="v19.2.0.56" %}
{% directory path: _includes/release-notes/v19.2.0.56
%}
{% include {{file.url}} %}
{% enddirectory %}

Просмотреть файл

@ -26,6 +26,13 @@ To render a stacked column chart, create an instance of [`StackedColumnSeries`](
@override
Widget build(BuildContext context) {
final List<ChartData> chartData = [
ChartData('China', 12, 10, 14, 20),
ChartData('USA', 14, 11, 18, 23),
ChartData('UK', 16, 10, 15, 20),
ChartData('Brazil', 18, 16, 18, 24)
];
return Scaffold(
body: Center(
child: Container(
@ -59,6 +66,15 @@ To render a stacked column chart, create an instance of [`StackedColumnSeries`](
);
}
class ChartData{
ChartData(this.x, this.y1, this.y2, this.y3, this.y4);
final String x;
final String y1;
final String y2;
final String y3;
final String y4;
}
{% endhighlight %}
![Stacked column](cartesian-chart-types-images/stacked_column.jpg)
@ -108,6 +124,15 @@ You can group and stack the similar stacked series types using the [`groupName`]
);
}
class ChartData{
ChartData(this.x, this.y1, this.y2, this.y3, this.y4);
final String x;
final String y1;
final String y2;
final String y3;
final String y4;
}
{% endhighlight %}
![Stacked column grouping](cartesian-chart-types-images/stacked_column_grouping.jpg)
@ -161,6 +186,15 @@ You can show the cumulative data label values using the [`showCumulativeValues`]
);
}
class ChartData{
ChartData(this.x, this.y1, this.y2, this.y3, this.y4);
final String x;
final String y1;
final String y2;
final String y3;
final String y4;
}
{% endhighlight %}
![Stacked column cumulative](cartesian-chart-types-images/stacked_column_cumulative.jpg)

Просмотреть файл

@ -17,29 +17,95 @@ To export the Cartesian chart as a PNG image, we can get the image by calling [`
{% highlight dart %}
Future<void> _renderCartesianImage() async {
dart_ui.Image data = await _cartesianKey.currentState!.toImage(pixelRatio: 3.0);
final bytes = await data.toByteData(format: dart_ui.ImageByteFormat.png);
if (data != null) {
await Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Center(
child: Container(
color: Colors.white,
child: Image.memory(bytes!.buffer.asUint8List()),
),
),
);
},
),
);
}
}
// Dart import
import 'dart:async';
import 'dart:io';
import 'dart:ui' as dart_ui;
{% endhighlight %}
// Package imports
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';
// Chart import
import 'package:syncfusion_flutter_charts/charts.dart';
class Export extends SampleView {
const Export(Key key) : super(key: key);
@override
_ExportState createState() => _ExportState();
}
class _ExportState extends SampleViewState {
_ExportState();
final GlobalKey<SfCartesianChartState> _chartKey = GlobalKey();
// ScaffoldState _scaffoldState;
GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
@override
Widget build(BuildContext context) {
return Scaffold(
key: scaffoldKey,
body: Column(
children: <Widget>[
SfCartesianChart(
key: _chartKey,
// Other chart configurations
),
Container(
child: IconButton(
onPressed: () {
duration: Duration(milliseconds: 100),
content:
Text('Chart has been exported as PNG image'),
_renderImage();
},
icon: const Icon(Icons.image, color: Colors.white),
)
)
]
)
)
}
Future<void> _renderImage() async {
final List<int> bytes = await _readImageData();
if (bytes != null) {
final Directory documentDirectory =
await getApplicationDocumentsDirectory();
final String path = documentDirectory.path;
const String imageName = 'cartesianchart.png';
imageCache!.clear();
final File file = File('$path/$imageName');
file.writeAsBytesSync(bytes);
await Navigator.of(context).push<dynamic>(
MaterialPageRoute<dynamic>(
builder: (BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Center(
child: Container(
color: Colors.white,
child: Image.file(file),
),
),
);
},
),
);
}
}
Future<List<int>> _readImageData() async {
final dart_ui.Image data =
await _chartKey.currentState!.toImage(pixelRatio: 3.0);
final ByteData? bytes =
await data.toByteData(format: dart_ui.ImageByteFormat.png);
return bytes!.buffer.asUint8List(bytes.offsetInBytes, bytes.lengthInBytes);
}
}
{% endhighlight %}
## Export PDF
@ -47,22 +113,95 @@ Similar to the above way, we can also export the rendered chart as a PDF documen
{% highlight dart %}
Future<void> _renderCartesianPDF() async {
var document = PdfDocument();
PdfPage page = document.pages.add();
dart_ui.Image data = await _cartesianKey. currentState!.toImage(pixelRatio: 3.0);
final bytes = await data.toByteData(format: dart_ui.ImageByteFormat.png);
final Uint8List imageBytes =
bytes!.buffer.asUint8List(bytes.offsetInBytes, bytes.lengthInBytes);
page.graphics
.drawImage(PdfBitmap(imageBytes), Rect.fromLTWH(25, 50, 300, 300));
var byteData = document.save();
// Dart import
import 'dart:async';
import 'dart:io';
import 'dart:ui' as dart_ui;
// Package imports
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';
// Chart import
import 'package:syncfusion_flutter_charts/charts.dart';
// Pdf import
import 'package:syncfusion_flutter_pdf/pdf.dart';
class Export extends SampleView {
const Export(Key key) : super(key: key);
@override
_ExportState createState() => _ExportState();
}
class _ExportState extends SampleViewState {
_ExportState();
final GlobalKey<SfCartesianChartState> _chartKey = GlobalKey();
// ScaffoldState _scaffoldState;
GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
@override
Widget build(BuildContext context) {
return Scaffold(
key: scaffoldKey,
body: Column(
children: <Widget>[
SfCartesianChart(
key: _chartKey,
// Other chart configurations
),
Container(
child: IconButton(
onPressed: () {
duration: Duration(milliseconds: 100),
content:
Text('Chart has been exported as PDF document'),
_renderPdf();
},
icon: const Icon(Icons.image, color: Colors.white),
)
)
]
)
)
}
Future<void> _renderPdf() async {
final PdfDocument document = PdfDocument();
final PdfBitmap bitmap = PdfBitmap(await _readImageData());
document.pageSettings.orientation =
MediaQuery.of(context).orientation == Orientation.landscape
? PdfPageOrientation.landscape
: PdfPageOrientation.portrait;
document.pageSettings.margins.all = 0;
document.pageSettings.size =
Size(bitmap.width.toDouble(), bitmap.height.toDouble());
final PdfPage page = document.pages.add();
final Size pageSize = page.getClientSize();
page.graphics.drawImage(
bitmap, Rect.fromLTWH(0, 0, pageSize.width, pageSize.height));
ScaffoldMessenger.of(context).hideCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(5))),
duration: Duration(milliseconds: 200),
content: Text('Chart has been exported as PDF document'),
));
final List<int> bytes = document.save();
document.dispose();
Directory directory = await getExternalStorageDirectory();
String path = directory.path;
File file = File('$path/Output.pdf');
await file.writeAsBytes(byteData, flush: true);
OpenFile.open('$path/Output.pdf');
await FileSaveHelper.saveAndLaunchFile(bytes, 'cartesian_chart.pdf');
}
Future<List<int>> _readImageData() async {
final dart_ui.Image data =
await _chartKey.currentState!.toImage(pixelRatio: 3.0);
final ByteData? bytes =
await data.toByteData(format: dart_ui.ImageByteFormat.png);
return bytes!.buffer.asUint8List(bytes.offsetInBytes, bytes.lengthInBytes);
}
}
{% endhighlight %}

Просмотреть файл

@ -63,6 +63,7 @@ The [`name`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/char
* [`isResponsive`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/Legend/isResponsive.html) - toggles the visibility of the legend. If the width or height of the legend is greater than the plot area bounds.
* [`iconBorderWidth`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/Legend/iconBorderWidth.html) - border width of the icon in the legend items. Used to change the stroke width of the legend icon shape.
* [`overflowMode`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/Legend/overflowMode.html) - overflow legend items.
* The [`legendIconType`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/ChartSeries/legendIconType.html) property of [`ChartSeries`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/ChartSeries-class.html) is used to set the shape for the legend icon. Any shape in the [`LegendIconType`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/LegendIconType-class.html) can be applied to this property.
{% highlight dart %}

Просмотреть файл

@ -160,7 +160,7 @@ Multiple selection can be enabled using the [`enableMultiSelection`](https://pub
## Selection on initial rendering
You can select a point or series programmatically on a chart using [`initialSelectedDataIndexes`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/CartesianSeries/initialSelectedDataIndexes.html) property of chart.
You can select a point or series programmatically on a chart using [`initialSelectedDataIndexes`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/CartesianSeries/initialSelectedDataIndexes.html) property of the [`CartesianSeries`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/CartesianSeries-class.html).
{% highlight dart %}
@ -183,7 +183,7 @@ You can select a point or series programmatically on a chart using [`initialSele
primaryXAxis: CategoryAxis(),
series: <CartesianSeries>[
ColumnSeries<ChartData, String>(
// Initially selected the data at point index - 1.
// Initially selected the data at point index 1.
initialSelectedDataIndexes: <int>[1],
dataSource: chartData1,
xValueMapper: (ChartData data, _) => data.x,

Просмотреть файл

@ -551,7 +551,7 @@ N> The above mentioned properties are only applicable for SfCartesian types of c
child: Container(
child: SfCartesianChart(
primaryXAxis: NumericAxis(
crosshairTooltip: InteractiveTooltip(
interactiveTooltip: InteractiveTooltip(
// Enables the crosshair tooltip
enable: true
)

Просмотреть файл

@ -232,7 +232,7 @@ The [enableMouseWheelZooming](https://pub.dev/documentation/syncfusion_flutter_c
## Auto interval on zooming
The [`enableAutoIntervalOnZooming`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/ChartAxis/enableAutoIntervalOnZooming.html) property determines the update of axis interval based on the current visible range while zooming the chart. Default value of this property is true. If this property is false, the nice internal will not be calculated for new range after zoom in and actual interval will be sustained.
The [`enableAutoIntervalOnZooming`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/ChartAxis/enableAutoIntervalOnZooming.html) property determines the update of axis interval based on the current visible range while zooming and panning the chart. Default value of this property is true. If this property is false, the nice interval will not be calculated for new range after zoom in and actual interval will be sustained.
{% highlight dart %}
@ -244,7 +244,7 @@ The [`enableAutoIntervalOnZooming`](https://pub.dev/documentation/syncfusion_flu
child: Container(
child: SfCartesianChart(
primaryXAxis: DateTimeAxis(
// Intervals will be fixed, not calculated automatically based on the visible range on zooming
// Intervals will be fixed, not calculated automatically based on the visible range on zooming and panning
enableAutoIntervalOnZooming: false
)
)

Просмотреть файл

@ -497,7 +497,7 @@
</li>
<li>
Release Notes
<ul><li>2021 Volume 2 - v19.2.0.*<ul><li> Weekly Release <ul><li><a href="/flutter/release-notes/v19.2.0.51">v19.2.0.51</a></li><li><a href="/flutter/release-notes/v19.2.0.49">v19.2.0.49</a></li><li><a href="/flutter/release-notes/v19.2.0.48">v19.2.0.48</a></li><li><a href="/flutter/release-notes/v19.2.0.47">v19.2.0.47</a></li><li><a href="/flutter/release-notes/v19.2.0.46">v19.2.0.46</a></li></ul></li><li><a href="/flutter/release-notes/v19.2.0.55">v19.2.0.55 Service Pack Release</a></li><li><a href="/flutter/release-notes/v19.2.0.44">v19.2.0.44 Main Release</a></li></ul></li><li>2021 Volume 1 - v19.1.0.*<ul><li> Weekly Release <ul><li><a href="/flutter/release-notes/v19.1.0.69">v19.1.0.69</a></li><li><a href="/flutter/release-notes/v19.1.0.67">v19.1.0.67</a></li><li><a href="/flutter/release-notes/v19.1.0.66">v19.1.0.66</a></li><li><a href="/flutter/release-notes/v19.1.0.65">v19.1.0.65</a></li><li><a href="/flutter/release-notes/v19.1.0.64">v19.1.0.64</a></li><li><a href="/flutter/release-notes/v19.1.0.59">v19.1.0.59</a></li><li><a href="/flutter/release-notes/v19.1.0.58">v19.1.0.58</a></li><li><a href="/flutter/release-notes/v19.1.0.57">v19.1.0.57</a></li><li><a href="/flutter/release-notes/v19.1.0.56">v19.1.0.56</a></li><li><a href="/flutter/release-notes/v19.1.0.55">v19.1.0.55</a></li></ul></li><li><a href="/flutter/release-notes/v19.1.0.63">v19.1.0.63 Service Pack Release</a></li><li><a href="/flutter/release-notes/v19.1.0.54">v19.1.0.54 Main release</a></li></ul></li><li>2020 Volume 4 - v18.4.0.*<ul><li> Weekly Release <ul><li><a href="/flutter/release-notes/v18.4.0.49">v18.4.0.49</a></li><li><a href="/flutter/release-notes/v18.4.0.48">v18.4.0.48</a></li><li><a href="/flutter/release-notes/v18.4.0.47">v18.4.0.47</a></li><li><a href="/flutter/release-notes/v18.4.0.46">v18.4.0.46</a></li><li><a href="/flutter/release-notes/v18.4.0.44">v18.4.0.44</a></li><li><a href="/flutter/release-notes/v18.4.0.43">v18.4.0.43</a></li><li><a href="/flutter/release-notes/v18.4.0.42">v18.4.0.42</a></li><li><a href="/flutter/release-notes/v18.4.0.41">v18.4.0.41</a></li><li><a href="/flutter/release-notes/v18.4.0.35">v18.4.0.35</a></li><li><a href="/flutter/release-notes/v18.4.0.34">v18.4.0.34</a></li><li><a href="/flutter/release-notes/v18.4.0.33">v18.4.0.33</a></li><li><a href="/flutter/release-notes/v18.4.0.32">v18.4.0.32</a></li><li><a href="/flutter/release-notes/v18.4.0.31">v18.4.0.31</a></li></ul></li><li><a href="/flutter/release-notes/v18.4.0.39">v18.4.0.39 Service Pack Release</a></li><li><a href="/flutter/release-notes/v18.4.0.30">v18.4.0.30 Main Release</a></li></ul></li><li>2020 Volume 3 - v18.3.0.*<ul><li> Weekly Release <ul><li><a href="/flutter/release-notes/v18.3.0.53">v18.3.0.53</a></li><li><a href="/flutter/release-notes/v18.3.0.52">v18.3.0.52</a></li><li><a href="/flutter/release-notes/v18.3.0.51">v18.3.0.51</a></li><li><a href="/flutter/release-notes/v18.3.0.50">v18.3.0.50</a></li><li><a href="/flutter/release-notes/v18.3.0.48">v18.3.0.48</a></li><li><a href="/Flutter/release-notes/v18.3.0.44">v18.3.0.44</a></li><li><a href="/Flutter/release-notes/v18.3.0.42">v18.3.0.42</a></li></ul></li><li><a href="/Flutter/release-notes/v18.3.0.47">v18.3.0.47 Service Pack Release</a></li><li><a href="/Flutter/release-notes/v18.3.0.35">v18.3.0.35 Main Release</a></li></ul></li>
<ul><li>2021 Volume 2 - v19.2.0.*<ul><li> Weekly Release <ul><li><a href="/flutter/release-notes/v19.2.0.56">v19.2.0.56</a></li><li><a href="/flutter/release-notes/v19.2.0.51">v19.2.0.51</a></li><li><a href="/flutter/release-notes/v19.2.0.49">v19.2.0.49</a></li><li><a href="/flutter/release-notes/v19.2.0.48">v19.2.0.48</a></li><li><a href="/flutter/release-notes/v19.2.0.47">v19.2.0.47</a></li><li><a href="/flutter/release-notes/v19.2.0.46">v19.2.0.46</a></li></ul></li><li><a href="/flutter/release-notes/v19.2.0.55">v19.2.0.55 Service Pack Release</a></li><li><a href="/flutter/release-notes/v19.2.0.44">v19.2.0.44 Main Release</a></li></ul></li><li>2021 Volume 1 - v19.1.0.*<ul><li> Weekly Release <ul><li><a href="/flutter/release-notes/v19.1.0.69">v19.1.0.69</a></li><li><a href="/flutter/release-notes/v19.1.0.67">v19.1.0.67</a></li><li><a href="/flutter/release-notes/v19.1.0.66">v19.1.0.66</a></li><li><a href="/flutter/release-notes/v19.1.0.65">v19.1.0.65</a></li><li><a href="/flutter/release-notes/v19.1.0.64">v19.1.0.64</a></li><li><a href="/flutter/release-notes/v19.1.0.59">v19.1.0.59</a></li><li><a href="/flutter/release-notes/v19.1.0.58">v19.1.0.58</a></li><li><a href="/flutter/release-notes/v19.1.0.57">v19.1.0.57</a></li><li><a href="/flutter/release-notes/v19.1.0.56">v19.1.0.56</a></li><li><a href="/flutter/release-notes/v19.1.0.55">v19.1.0.55</a></li></ul></li><li><a href="/flutter/release-notes/v19.1.0.63">v19.1.0.63 Service Pack Release</a></li><li><a href="/flutter/release-notes/v19.1.0.54">v19.1.0.54 Main release</a></li></ul></li><li>2020 Volume 4 - v18.4.0.*<ul><li> Weekly Release <ul><li><a href="/flutter/release-notes/v18.4.0.49">v18.4.0.49</a></li><li><a href="/flutter/release-notes/v18.4.0.48">v18.4.0.48</a></li><li><a href="/flutter/release-notes/v18.4.0.47">v18.4.0.47</a></li><li><a href="/flutter/release-notes/v18.4.0.46">v18.4.0.46</a></li><li><a href="/flutter/release-notes/v18.4.0.44">v18.4.0.44</a></li><li><a href="/flutter/release-notes/v18.4.0.43">v18.4.0.43</a></li><li><a href="/flutter/release-notes/v18.4.0.42">v18.4.0.42</a></li><li><a href="/flutter/release-notes/v18.4.0.41">v18.4.0.41</a></li><li><a href="/flutter/release-notes/v18.4.0.35">v18.4.0.35</a></li><li><a href="/flutter/release-notes/v18.4.0.34">v18.4.0.34</a></li><li><a href="/flutter/release-notes/v18.4.0.33">v18.4.0.33</a></li><li><a href="/flutter/release-notes/v18.4.0.32">v18.4.0.32</a></li><li><a href="/flutter/release-notes/v18.4.0.31">v18.4.0.31</a></li></ul></li><li><a href="/flutter/release-notes/v18.4.0.39">v18.4.0.39 Service Pack Release</a></li><li><a href="/flutter/release-notes/v18.4.0.30">v18.4.0.30 Main Release</a></li></ul></li><li>2020 Volume 3 - v18.3.0.*<ul><li> Weekly Release <ul><li><a href="/flutter/release-notes/v18.3.0.53">v18.3.0.53</a></li><li><a href="/flutter/release-notes/v18.3.0.52">v18.3.0.52</a></li><li><a href="/flutter/release-notes/v18.3.0.51">v18.3.0.51</a></li><li><a href="/flutter/release-notes/v18.3.0.50">v18.3.0.50</a></li><li><a href="/flutter/release-notes/v18.3.0.48">v18.3.0.48</a></li><li><a href="/Flutter/release-notes/v18.3.0.44">v18.3.0.44</a></li><li><a href="/Flutter/release-notes/v18.3.0.42">v18.3.0.42</a></li></ul></li><li><a href="/Flutter/release-notes/v18.3.0.47">v18.3.0.47 Service Pack Release</a></li><li><a href="/Flutter/release-notes/v18.3.0.35">v18.3.0.35 Main Release</a></li></ul></li>
<li>2020 Volume 2 - v18.2.0.*<ul><li><a href="/Flutter/release-notes/v18.2.0.53">v18.2.0.53 Service Pack Release</a></li><li><a href="/Flutter/release-notes/v18.2.0.44">v18.2.0.44 Main Release</a></li></ul></li>
<li>2020 Volume 1 - v18.1.0.*<ul><li><a href="/Flutter/release-notes/v18.1.0.52">v18.1.0.52 Service Pack Release</a></li><li><a href="/Flutter/release-notes/v18.1.0.42">v18.1.0.42 Main Release</a></li><li><a href="/Flutter/release-notes/v18.1.0.36">v18.1.0.36 Beta Release</a></li></ul></li><li>2019 Volume 4 - v17.4.0.*<ul><li><a href="/Flutter/release-notes/v17.4.0.46">v17.4.0.46 Service Pack Release</a></li><li><a href="/Flutter/release-notes/v17.4.0.39">v17.4.0.39 Main Release</a></li></ul></li>
<li>2019 Volume 3 - v17.3.0.*