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

discontinued
outdatedDart 1 only

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() {
  var rnd = new math.Random();
  var months = <String>["January", "February", "March", "April", "May", "June"];

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

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

  new Chart(querySelector('#canvas') as CanvasElement, config);
}
16
likes
0
pub points
79%
popularity

Publisher

unverified uploader

Chart.js wrapper for Dart

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

func, js

More

Packages that depend on chartjs