chartjs 0.6.0 copy "chartjs: ^0.6.0" to clipboard
chartjs: ^0.6.0 copied to clipboard

discontinued
Platformweb

Chart.js wrapper for Dart

example/example.dart

// Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

import 'dart:html';
import 'dart:math' as math;

import 'package:chartjs/chartjs.dart';

void main() {
  final rnd = math.Random();
  final months = <String>['January', 'February', 'March', 'April', 'May', 'June'];

  final data = LinearChartData(labels: months, datasets: <ChartDataSets>[
    ChartDataSets(
        label: 'My First dataset',
        backgroundColor: 'rgba(220,220,220,0.2)',
        data: months.map((_) => rnd.nextInt(100)).toList()),
    ChartDataSets(
        label: 'My Second dataset',
        backgroundColor: 'rgba(151,187,205,0.2)',
        data: months.map((_) => rnd.nextInt(100)).toList())
  ]);

  final config = ChartConfiguration(
      type: 'line', data: data, options: ChartOptions(responsive: true));

  Chart(querySelector('#canvas') as CanvasElement, config);
}
16
likes
120
pub points
80%
popularity

Publisher

unverified uploader

Chart.js wrapper for Dart

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

BSD-3-Clause, MIT (license)

Dependencies

js

More

Packages that depend on chartjs