Skip to content

Commit

Permalink
Add links between documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
abdelaz3r committed Mar 25, 2024
1 parent 40ff05b commit 2144141
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions lib/sparkline_svg.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2144141

Please sign in to comment.