google / chartjs.dart

ARCHIVED/UNMAINTAINED Dart API for Chart.js
https://pub.dev/packages/chartjs
Other
143 stars 53 forks source link

Missing constructors #22

Open portno opened 6 years ago

portno commented 6 years ago

I am facing a problem using the github repository instead of the pub package (v0.3.2). I believe that the same problem exists for version 0.4.0+1.

It looks like the external factory constructors are not getting generated or just missing.

Example is ChartXAxe class which was:

@anonymous
@JS()
abstract class ChartXAxe implements CommonAxe {
  external num get categoryPercentage;
  external set categoryPercentage(num v);
  external num get barPercentage;
  external set barPercentage(num v);
  external TimeScale get time;
  external set time(TimeScale v);
  external factory ChartXAxe(
      {num categoryPercentage,
      num barPercentage,
      TimeScale time,
      String /*'category'|'linear'|'logarithmic'|'time'|'radialLinear'|String*/ type,
      bool display,
      String id,
      bool stacked,
      String position,
      TickOptions ticks,
      GridLineOptions gridLines,
      num barThickness,
      ScaleTitleOptions scaleLabel});
}

and changed in dd29e3a (link to line) to:

@anonymous
@JS()
abstract class ChartXAxe implements CommonAxe {
  external num get categoryPercentage;
  external set categoryPercentage(num v);
  external num get barPercentage;
  external set barPercentage(num v);
  external TimeScale get time;
  external set time(TimeScale v);
}

The same applies for other classes as well, for example LinearTickOptions, ChartYAxe, ChartLegendLabelOptions, ChartLegendOptions.

I can take those constructors and move them to the latest code, carefully add any new options that were added and push another PR, unless they can be auto generated them somehow.

danielmcquillen commented 6 years ago

Experiencing same issue. Is 0.5.0-dev broken?

When I switch to this version in pubspec.yml, Dart Analysis complains with errors like Abstract classes can't be created with a 'new' expresssion., referring to (for example) abstract class TickOptions<T>.

joe776 commented 5 years ago

https://github.com/dart-lang/js_facade_gen/issues/26 seems to be the underlying issue for this.