ChartLine.withChartData constructor
ChartLine.withChartData(
- List data, {
- bool animate = false,
- double height = 200.0,
- int titleFontSize = 14,
- double maskFontSize = 18.0,
- bool showLegend = true,
- bool showChartTitle = true,
- bool showAxisLine = false,
- Widget? loadingWidget,
- double strokeWidth = 1.0,
- bool hidePrimaryAxis = false,
- bool hideSecondaryAxis = false,
- bool hideDomainAxis = false,
Implementation
factory ChartLine.withChartData(List data,
{bool animate = false,
double height = 200.0,
int titleFontSize = 14,
double maskFontSize = 18.0,
bool showLegend = true,
bool showChartTitle = true,
bool showAxisLine = false,
Widget? loadingWidget,
double strokeWidth = 1.0,
bool hidePrimaryAxis = false,
TypedHiddenFn<String, bool>? hiddenFn,
bool hideSecondaryAxis = false,
bool hideDomainAxis = false}) {
var lineData =
data.map<ChartLineData>((e) => ChartLineData.fromJson(e)).toList();
List<charts.TickSpec<String>> staticTick = _makeStaticTick(lineData);
return ChartLine(
staticTicks: staticTick,
lineData: lineData,
animate: animate,
height: height,
titleFontSize: titleFontSize,
maskFontSize: maskFontSize,
showLegend: showLegend,
showChartTitle: showChartTitle,
showAxisLine: showAxisLine,
loadingWidget: loadingWidget,
hiddenFn:
hiddenFn == null ? null : (String? groupCode) => hiddenFn(groupCode!),
strokeWidth: strokeWidth,
hideDomainAxis: hideDomainAxis,
hidePrimaryAxis: hidePrimaryAxis,
hideSecondaryAxis: hideSecondaryAxis,
);
}