diff --git a/README.md b/README.md index 13e0854..faedd41 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,9 @@ Markers are used to highlight specific spots on the chart. There are two types o ### Reference lines -Reference lines are used to show common reference lines on the chart. There are four types of +Reference lines are used to show common reference lines on the chart. There are five types of currently supported reference lines (`maximum`, `minimum`, `average`, `median`, and `percentile/1`) -that will be rendered as horizontal lines. +that will be rendered as horizontal lines. You can also add custom reference line. ## Window @@ -58,6 +58,9 @@ under the line. There are two ways to customize the chart: - Using the options like color or width. - Using the CSS classes option to give classes to SVG elements and then using CSS to style them. +For all the customization options, visit the +[options documentation](https://hexdocs.pm/sparkline_svg/SparklineSvg.html#module-available-options). + ### Usage example ``` elixir @@ -96,6 +99,9 @@ This library is currently under active development and it’s API is likely to c ## Examples +A more complete example list can be found in the +[documentation](https://hexdocs.pm/sparkline_svg/examples.html). + ### Light sparkline A cyan sparkline with a line, area, and markers diff --git a/lib/sparkline_svg.ex b/lib/sparkline_svg.ex index e14e3a0..70502a4 100644 --- a/lib/sparkline_svg.ex +++ b/lib/sparkline_svg.ex @@ -414,6 +414,8 @@ defmodule SparklineSvg do If neither `SparklineSvg.show_dots/2`, `SparklineSvg.show_line/2`, nor `SparklineSvg.show_area/2` are called, the rendered chart will be an empty SVG document. + List of available options can be found [here](`m:SparklineSvg#module-available-options`). + ## Examples iex> chart = SparklineSvg.new([1, 2]) @@ -464,6 +466,8 @@ defmodule SparklineSvg do Calling this function multiple times will override the previous dots options. If no options are given, the dots will be shown with the default options. + List of available options can be found [here](`m:SparklineSvg#module-dots-options`). + ## Examples iex> chart = SparklineSvg.new([1, 2]) |> SparklineSvg.show_dots() @@ -496,6 +500,8 @@ defmodule SparklineSvg do Calling this function multiple times will override the previous line options. If no options are given, the line will be shown with the default options. + List of available options can be found [here](`m:SparklineSvg#module-line-options`). + ## Examples iex> chart = SparklineSvg.new([1, 2]) |> SparklineSvg.show_line() @@ -528,6 +534,8 @@ defmodule SparklineSvg do Calling this function multiple times will override the previous area options. If no options are given, the area will be shown with the default options. + List of available options can be found [here](`m:SparklineSvg#module-area-options`). + ## Examples iex> chart = SparklineSvg.new([1, 2]) |> SparklineSvg.show_area() @@ -561,6 +569,8 @@ defmodule SparklineSvg do Reference lines on an empty chart won't be rendered. + List of available options can be found [here](`m:SparklineSvg#module-reference-line-options`). + ## Examples iex> chart = SparklineSvg.new([1, 2]) |> SparklineSvg.show_ref_line(:max) @@ -594,6 +604,8 @@ defmodule SparklineSvg do When using this function with a list of numbers as datapoints, the min window value and the max window must be interpreted as the index of the list. Negative values are allowed. + List of available options can be found [here](`m:SparklineSvg#module-window-options`). + ## Examples iex> chart = SparklineSvg.new([1, 2, 3, 4]) |> SparklineSvg.show_line() |> SparklineSvg.set_x_window(min: 1, max: 2) @@ -640,6 +652,8 @@ defmodule SparklineSvg do Markers are not used to calculate the boudaries of the chart. If you set a marker outside the range of the chart, it will be rendered but won't be visible. + List of available options can be found [here](`m:SparklineSvg#module-marker-options`). + ## Examples iex> chart = SparklineSvg.new([1, 3]) |> SparklineSvg.add_marker(2)