diff --git a/README.md b/README.md index 5939a0b6..418e4c5b 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,11 @@ $scope.options = { y2: {type: 'linear'} }, series: [ - {y: 'value', color: 'steelblue', type: 'area', striped: true, label: 'Pouet'}, + {y: 'value', color: 'steelblue', , thickness: '2px', type: 'area', striped: true, label: 'Pouet'}, {y: 'otherValue', axis: 'y2', color: 'lightsteelblue'} ], - lineMode: 'linear' + lineMode: 'linear', + tension: 0.7 } ``` ##### Axes @@ -59,7 +60,7 @@ The `axes` keys can be undefined. Otherwise, it can contain an `x̀` key with th + `tooltipFormatter` : optional, allows to format the tooltip. Must be a function that accepts a single argument, the x value. It should return something that will be converted into a string and put in the x tooltip. + `type` : optional, can be either 'date' or 'linear' (default is 'linear'). If set to 'date', the chart will expect Date objects as abscissas. No transformation is done by the chart itself, so the behavior is basically D3.js' time scale's. + `labelFunction` : optional, allows to format the axis' ticklabels. Must be a function that accepts a single argument and returns a string. - + It can also contain, according to your series configuration, a `y` and a `y2` key with the following properties : + `type` : optional, can be either linear' or 'log' (default is 'linear'). If set to 'log', the data may be clamped if its computed lower bound is 0 (this means the chart won't display an actual 0, but a close value - log scales can't display zero values). @@ -67,13 +68,14 @@ It can also contain, according to your series configuration, a `y` and a `y2` ke ##### Series The `series` key must be an array which contains objects with the following properties : - + + `y` : mandatory, defines which property on each data row will be used as ordinate value. + `color` : optional, any valid HTML color (if none given, the chart will set it for you). + `label` : optional, will be used in the legend (if undefined, the `y` value will be used). + `axis` : optional, can be either 'y' (default, for left) or 'y2' (for right). Defines which vertical axis should be used for this series. If no right axis is needed, none will be displayed. + `type` : optional, can be one value between 'line', 'area', 'column'. Default is 'line'. + `striped` : optional, can be either `true` or `false`. Default is `false`. Will be ignored if the series type is not 'area'. ++ `thickness` : optional, can be `{n}px`. Default is `1px`. Will be ignored if the series type is not 'area' or 'line'. ##### Optional stuff Additionally, you can set `lineMode` to a value between these : @@ -90,6 +92,8 @@ Additionally, you can set `lineMode` to a value between these : + cadinal-closed + monotone +The `tension` can be set, too (default is `0.7`). See [issue #44][2] about that. + > For more information about interpolation, please consult the [D3.js documentation about that][1]. #### Mode @@ -123,3 +127,4 @@ AngularJS is designed to be testable, and so is this project. It has a good coverage rate (above 90%), and we want to keep it this way. [1]: https://github.com/mbostock/d3/wiki/SVG-Shapes#wiki-line_interpolate + [2]: https://github.com/n3-charts/line-chart/issues/44