GraFiddle / angular-chart

AngularJS directive for adjustable dynamically updating c3 charts
http://grafiddle.github.io/angular-chart/
MIT License
127 stars 40 forks source link

The lines and fills of the charts are not being set #74

Closed tonyeung closed 9 years ago

tonyeung commented 9 years ago

I'm using the options and data from the line annotations page - http://maxklenk.github.io/angular-chart/examples.html#/?category=annotate&example=xAxis

this is what it looks like in my project

this is how its supposed to look like

My app declaration:

var app = angular.module("app", [ "ngCookies", "ngRoute", "angularChart" ]);

My angular version is 1.3.15 Please let me know if there is anything else you need.

I'll include the options at the bottom for convenience sake, but its copied directly from the sample page.

$scope.options = {
    "rows": [
      {
          "key": "sales",
          "type": "spline",
          "axis": "y",
          "color": "#1f77b4"
      },
      {
          "key": "customers",
          "type": "area",
          "axis": "y",
          "color": "#ff7f0e"
      },
      {
          "key": "units",
          "type": "bar",
          "axis": "y",
          "color": "#2ca02c"
      }
    ],
    "annotation": [
      {
          "axis": "x",
          "value": 1,
          "label": "one"
      }
    ],
    "selection": {
        "selected": []
    },
    "type": "line",
    "zoom": {}
};

$scope.dataset = [
  {
      "day": "2013-01-08T00:00:00",
      "sales": 300,
      "income": 200,
      "customers": 30,
      "units": 130,
      "dayString": "Montag"
  },
  {
      "day": "2013-01-03T00:00:00",
      "sales": 200,
      "income": 130,
      "customers": 20,
      "units": 120,
      "dayString": "Dienstag"
  },
  {
      "day": "2013-01-04T00:00:00",
      "sales": 160,
      "income": 90,
      "customers": 50,
      "units": 150,
      "dayString": "Mittwoch"
  },
  {
      "day": "2013-01-05T00:00:00",
      "sales": 400,
      "income": 240,
      "customers": 40,
      "units": 140,
      "dayString": "Donnerstag"
  },
  {
      "day": "2013-01-06T00:00:00",
      "sales": 250,
      "income": 130,
      "customers": 60,
      "units": 160,
      "dayString": "Freitag"
  },
  {
      "day": "2013-01-07T00:00:00",
      "sales": 250,
      "income": 220,
      "customers": 50,
      "units": 150,
      "dayString": "Samstag"
  }
];

the markup

<angularchart dataset="dataset"
              schema="schema"
              options="options">
</angularchart>
maxklenk commented 9 years ago

It looks like the css styles are not present, have you included this file?

<link rel="stylesheet" href="bower_components/c3/c3.css" />
tonyeung commented 9 years ago

i had a typo in my path. Thank you for checking this out.