From b592c71b170a226de9e736027891bf3296da4e83 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 19 Oct 2021 11:20:29 -0700 Subject: [PATCH] Updated readme [skip ci] --- README.md | 53 ++++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index aa18ff2..5f4e164 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,31 @@ data = [ ``` +## Data + +Pass data as an array or object + +```jsx + +``` + +or + +```jsx + +``` + +Data can also be a callback + +```jsx +function fetchData(success, fail) { + success({"2021-01-01": 2, "2021-01-02": 3}) + // or fail("Data not available") +} + + +``` + ### Say Goodbye To Timeouts Make your pages load super fast and stop worrying about timeouts. Give each chart its own endpoint. @@ -93,7 +118,7 @@ Make your pages load super fast and stop worrying about timeouts. Give each char ``` -### Options +## Options Id, width, and height @@ -261,32 +286,6 @@ Chartkick.options = { } ``` -### Data - -Pass data as an array or object - -```jsx - - -``` - -Times can be a `Date` or a string (strings are parsed) - -```jsx - -``` - -Data can also be a callback - -```jsx -function fetchData(success, fail) { - success({"Blueberry": 44, "Strawberry": 23}) - // or fail("Data not available") -} - - -``` - ### Multiple Series You can pass a few options with a series: