Nivo: help wanted: API Client: `"\"legendPosition\" must be one of [start, center, end]鈥

Created on 11 Jan 2019  路  3Comments  路  Source: plouc/nivo

When using the API Client and try to generate bar charts https://nivo.rocks/bar/api the result is a following error:

{
  "errors": [
    "\"legendPosition\" must be one of [start, center, end] (axisBottom.legendPosition)",
    "\"legendPosition\" must be one of [start, center, end] (axisLeft.legendPosition)"
  ]
}

if we disable the axisBottom and axisLeft from the Grid & Axes tab, then the chart is generated without any errors. I see no options to set the position to [start, center, end] from the API Client am I missing something?

bug http API

Most helpful comment

@plouc The types are also incompatible, for example into the BarProps "legenPostion" property accepts these type of values "start" | "center" | "end" | undefined;

 export type Axis = Partial<{
        format: string | LabelFormatter
        legend: string
        legendOffset: number
        legendPosition: 'start' | 'center' | 'end'
        orient: 'top' | 'right' | 'bottom' | 'left'
        tickPadding: number
        tickRotation: number
        tickSize: number
        tickValues: number | string[] | number[]
    }>

but when you render it with center value it throws and exception saying that middle is the correct value to use:

screen shot 2019-01-31 at 16 29 53

Update: already covered on https://github.com/plouc/nivo/issues/197

All 3 comments

@indvstry the http API isn't up to date with the latest version of nivo packages, that's why it's rejected for now.

@plouc The types are also incompatible, for example into the BarProps "legenPostion" property accepts these type of values "start" | "center" | "end" | undefined;

 export type Axis = Partial<{
        format: string | LabelFormatter
        legend: string
        legendOffset: number
        legendPosition: 'start' | 'center' | 'end'
        orient: 'top' | 'right' | 'bottom' | 'left'
        tickPadding: number
        tickRotation: number
        tickSize: number
        tickValues: number | string[] | number[]
    }>

but when you render it with center value it throws and exception saying that middle is the correct value to use:

screen shot 2019-01-31 at 16 29 53

Update: already covered on https://github.com/plouc/nivo/issues/197

I'm closing this in favor of https://github.com/plouc/nivo/issues/263, as both issues are about mismatch between the deployed demo packages versions and the ones used for the website.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PattieC4ke picture PattieC4ke  路  3Comments

pratikguru picture pratikguru  路  3Comments

stahlmanDesign picture stahlmanDesign  路  3Comments

Buvaneshkumar7 picture Buvaneshkumar7  路  3Comments

dubzzz picture dubzzz  路  3Comments