owlnext_charts 1.0.1+2
owlnext_charts: ^1.0.1+2 copied to clipboard
Package Flutter de visualisation de données basé sur fl_chart.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:owlnext_charts/owlnext_charts.dart';
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'owlnext_charts',
home: Scaffold(
appBar: AppBar(title: const Text('owlnext_charts demo')),
body: SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const Text('PieChart', style: TextStyle(fontWeight: FontWeight.bold)),
SizedBox(
height: 260,
child: OwlnextPieChart(data: const [
ChartDataPoint(label: 'Flutter', value: 40),
ChartDataPoint(label: 'React', value: 30),
ChartDataPoint(label: 'Vue', value: 20),
ChartDataPoint(label: 'Other', value: 10),
]),
),
const SizedBox(height: 24),
const Text('BarChart', style: TextStyle(fontWeight: FontWeight.bold)),
SizedBox(
height: 260,
child: OwlnextBarChart(
seriesName: 'Commandes',
data: const [
ChartDataPoint(label: 'Jan', value: 30),
ChartDataPoint(label: 'Feb', value: 45),
ChartDataPoint(label: 'Mar', value: 38),
ChartDataPoint(label: 'Apr', value: 52),
],
),
),
const SizedBox(height: 24),
const Text('LineChart', style: TextStyle(fontWeight: FontWeight.bold)),
SizedBox(
height: 260,
child: OwlnextLineChart(series: const [
ChartSeries(name: 'Revenue', data: [
ChartDataPoint(label: 'Jan', value: 10),
ChartDataPoint(label: 'Feb', value: 25),
ChartDataPoint(label: 'Mar', value: 18),
ChartDataPoint(label: 'Apr', value: 32),
]),
]),
),
],
),
),
),
);
}
}