dart_pdf icon indicating copy to clipboard operation
dart_pdf copied to clipboard

How can I add dot value to the linear graph?

Open Sardor6628 opened this issue 2 years ago • 7 comments

var chart1 = pw.Container( margin: pw.EdgeInsets.symmetric(vertical: 4, horizontal: 12), height: 30, child: pw.Container( child: pw.Chart( grid: pw.CartesianGrid( xAxis: pw.FixedAxis.fromStrings([ for (int i = 0; i < dataset.length; i++) '${DateFormat("yy.MM.dd\n HH:mm").format(dates[i])}' ], margin: 1, color: PdfColors.white, textStyle: pw.Theme.of(context) .defaultTextStyle .copyWith(fontSize: 6, color: PdfColors.black)), yAxis: pw.FixedAxis([0, 50, 100], color: PdfColors.white, textStyle: pw.Theme.of(context) .defaultTextStyle .copyWith(fontSize: 8, color: PdfColors.white)), ), datasets: [ pw.LineDataSet( color: PdfColors.blue400, pointColor: PdfColors.black, pointSize: 2, legend: 'chest', data: List<pw.LineChartValue>.generate( dataset.length, (i) { final num v = dataset[i]; return pw.LineChartValue(i.toDouble(), v.toDouble()); }, ), ), ], )));

return chart1;

Sardor6628 avatar Apr 14 '22 12:04 Sardor6628

@DavBfr Hello, is there a way of adding a dot value to the graph in the package?

Sardor6628 avatar Apr 14 '22 12:04 Sardor6628

What's a dot value?

DavBfr avatar Apr 14 '22 12:04 DavBfr

Screen Shot 2022-04-14 at 18 00 27 @DavBfr now it looks like this. I want a value to be displayed above the dot.

Sardor6628 avatar Apr 14 '22 13:04 Sardor6628

That's an improvement to make.

DavBfr avatar Apr 14 '22 13:04 DavBfr

I see, @DavBfr is there any alternative that I can use now? I need to finish function implementation by this week. So I would be very glad for any advice

Sardor6628 avatar Apr 14 '22 13:04 Sardor6628

Screen Shot 2022-04-14 at 18 16 30 I would like to get a graph like this.

Sardor6628 avatar Apr 14 '22 13:04 Sardor6628

There is no support for drawing values. Can be related to #1000 and #975

DavBfr avatar Apr 14 '22 13:04 DavBfr

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Apr 15 '23 00:04 github-actions[bot]

Closing this stale issue because it has no activity.

github-actions[bot] avatar Apr 21 '23 00:04 github-actions[bot]