datawrapper 0.0.1
datawrapper: ^0.0.1 copied to clipboard
A datawrapper Flutter package.
datawrapper #
Create datawrapper charts within a Flutter application.
Getting Started #
This is a Dart-native library. Issues/PRs will be raised in Flutter and flutter/engine as necessary for features that are not good candidates for Dart implementations.
Basic usage (to create an chart):
var jsonBody = await createChart(
title: '<CHART_TITLE>',
chartType: ChartType.lineChart);
Add data:
final List<Map<String, Object>> data = [
{"X.1": "1/19-1/29", "Approve": 56, "Disapprove": 40},
{"X.1": "2/1-2/9", "Approve": 53, "Disapprove": 43},
{"X.1": "2/9-2/16", "Approve": 54, "Disapprove": 44},
{"X.1": "2/17-2/24", "Approve": 53, "Disapprove": 46},
{"X.1": "2/24-3/1", "Approve": 51.3, "Disapprove": 41},
{"X.1": "3/2-3/4", "Approve": 50, "Disapprove": 48},
{"X.1": "3/5-3/9", "Approve": 49.3, "Disapprove": 45.7},
{"X.1": "3/5-3/11", "Approve": 54.5, "Disapprove": 44.5},
{"X.1": "3/10-3/17", "Approve": 51.4, "Disapprove": 46},
{"X.1": "3/11-3/18", "Approve": 55.7, "Disapprove": 43},
{"X.1": "3/17-3/22", "Approve": 48.5, "Disapprove": 49.5},
{"X.1": "3/18-3/25", "Approve": 49.3, "Disapprove": 48},
{"X.1": "3/25-4/1", "Approve": 49.9, "Disapprove": 47.2},
{"X.1": "4/3-4/6", "Approve": 50.3, "Disapprove": 46.6},
{"X.1": "4/6-4/11", "Approve": 50.6, "Disapprove": 44.5}
];
var jsonBody = await addData(
'<CHART_ID>',
data);
Publish chart:
var jsonBody = await publishChart(
'<CHART_ID>',
display: false);
Get chart embed code:
var embedCode = await getIframeCode(
'<CHART_ID>',
responsive: true);
Use Cases #
- Create datawrapper charts with Flutter application.
- Easier to create custom chart with
Visualizemodel. - Save time without doing datawrapper API integration.
- Selected chart templates are provided in the package.