s2
import 'package:d_chart/d_chart.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
List<NumericData> series1 = [
NumericData(domain: 20, measure: 18000),
NumericData(domain: 23, measure: 20000),
NumericData(domain: 34, measure: 19000),
NumericData(domain: 28, measure: 23000),
NumericData(domain: 30, measure: 25000),
NumericData(domain: 40, measure: 30000),
NumericData(domain: 50, measure: 65000),
NumericData(domain: 40, measure: 66000),
NumericData(domain: 48, measure: 37000),
NumericData(domain: 47, measure: 60000),
NumericData(domain: 52, measure: 50000),
NumericData(domain: 58, measure: 48000),
NumericData(domain: 55, measure: 48000),
NumericData(domain: 53, measure: 29000),
NumericData(domain: 59, measure: 60000),
NumericData(domain: 64, measure: 64000),
NumericData(domain: 67, measure: 65000),
NumericData(domain: 66, measure: 66000),
NumericData(domain: 70, measure: 72000),
NumericData(domain: 72, measure: 56000),
NumericData(domain: 59, measure: 64000),
NumericData(domain: 65, measure: 65000),
NumericData(domain: 65, measure: 71000),
NumericData(domain: 68, measure: 66000),
NumericData(domain: 72, measure: 60000),
NumericData(domain: 84, measure: 63000),
NumericData(domain: 82, measure: 69000),
NumericData(domain: 80, measure: 80000),
NumericData(domain: 79, measure: 68000),
NumericData(domain: 85, measure: 73000),
NumericData(domain: 86, measure: 75000),
NumericData(domain: 90, measure: 76000),
NumericData(domain: 84, measure: 66000),
NumericData(domain: 82, measure: 79000),
NumericData(domain: 85, measure: 78000),
];
AspectRatio(
aspectRatio: 16 / 9,
child: DChartScatterN(
layoutMargin: LayoutMargin(52, 20, 20, 30),
configRenderPoint: const ConfigRenderPoint(
radiusPx: 5,
),
measureAxis: MeasureAxis(
numericTickProvider: const NumericTickProvider(
desiredTickCount: 5,
),
tickLength: 0,
useGridLine: true,
gridLineStyle: LineStyle(
color: Colors.grey.shade300,
dashPattern: [4],
),
gapAxisToLabel: 10,
tickLabelFormatter: (measure) {
return NumberFormat.compactCurrency(
decimalDigits: 0,
symbol: '\$',
).format(measure);
},
labelStyle: const LabelStyle(
color: Colors.black54,
fontSize: 12,
),
),
domainAxis: DomainAxis(
tickLength: 0,
lineStyle: LineStyle(
color: Colors.grey.shade300,
),
gapAxisToLabel: 10,
tickLabelFormatterN: (domain) {
return '${domain!.toInt()}°C';
},
numericTickProvider: const NumericTickProvider(
desiredTickCount: 6,
),
labelStyle: const LabelStyle(
color: Colors.black54,
fontSize: 12,
),
numericViewport: const NumericViewport(17, 84),
),
groupList: [
NumericGroup(
id: '1',
data: series1,
color: Colors.deepPurple,
),
],
),
),