Calendar HTTP API

POST /charts/calendar

The Calendarcomponent is available in the nivo HTTP rendering API. The API generates a SVG and return a path to this SVG which can then be easily embedded.

The api accepts almost the same properties as the regular component, in json, however it's not interactive and you cannot use code in properties (functions).

Please note that the demo API server is installed on heroku using a free plan, so it might be unavailable from times to times.

Click the generate button in order to generate the chart.
You can customize settings by using dedicated controls.
generate
Response n/a
no response available
Base
object[]required

Chart data.

string | Daterequired

start date

string | Daterequired

end date

numberrequired
px

Chart width.

numberrequired
px

Chart height.

numberoptionaldefault:'Depends on device'

Adjust pixel ratio, useful for HiDPI screens.

supportsvgcanvasapi
objectoptional
px
px
px
px

Chart margin.

stringoptionaldefault:'horizontal'

defines calendar layout direction.

stringoptionaldefault:'center'
center

defines how calendar should be aligned inside chart container.

number | 'auto'optionaldefault:0
auto

Minimum value.

number | 'auto'optionaldefault:'auto'
auto

Maximum value.

Style
Themeoptional

Define style for common elements such as labels, axes…

string[]optionaldefault:['#61cdbb', '#97e3d5', '#e8c1a0', '#f47560']

Cell colors.

stringoptionaldefault:'#fff'
   #eeeeee

color to use to fill days without available value.

Years
numberoptionaldefault:30
px

define spacing between each year row/column depending on the direction.

(year: number) => string | numberoptional

can be used to customize years label, returns 'YYYY' by default.

'before' | 'after'optionaldefault:'before'

defines year legends position.

numberoptionaldefault:10
px

define offset from year edge to its label.

Months
numberoptionaldefault:0
px

define spacing between each month row/column depending on the direction.

numberoptionaldefault:2
px

width of month borders.

supportsvgcanvasapi
stringoptionaldefault:'#000'
   #ffffff

color to use for months border.

supportsvgcanvasapi
(year: number, month: number, date: Date) => string | numberoptional

can be used to customize months label, returns abbreviated month name (english) by default. This can be used to use a different language

'before' | 'after'optionaldefault:'before'

defines month legends position.

numberoptionaldefault:10
px

define offset from month edge to its label.

Days
numberoptionaldefault:0
px

define spacing between each day cell.

numberoptionaldefault:1
px

width of days border.

stringoptionaldefault:'#000'
   #ffffff

color to use for days border.

Interactivity
booleanoptionaldefault:true

Enable/disable interactivity.

supportsvgcanvasapi
(day, event) => voidoptional

onClick handler, it receives clicked day data and mouse event.

supportsvgcanvasapi
Functionoptional

Custom tooltip component.

supportsvgcanvasapi
booleanoptional

Showcase custom tooltip.

supportsvgcanvasapi