Chartist-js: ctPointLabels label undefined when 0

Created on 22 Nov 2017  路  1Comment  路  Source: gionkunz/chartist-js

I'm implementing ctPointLabels but I get undefined when serie value is 0.

screen shot 2017-11-22 at 15 46 43

What I'm doing wrong? Is this a bug?

new Chartist.Line(chart_wrapper, {
  labels: [1, 2, 3, 4, 5],
  series: [
    [1, 1, 8, 0, 7]
  ]
  },
  {
    axisX: {
      showGrid: false,
      showLabel: false,
      offset: 0
    },
    axisY: {
      showGrid: false,
      showLabel: false,
      offset: 0
    },
    chartPadding: {
      top: 15,
      right: 10,
      bottom: 0,
      left: 10
    },
    fullWidth: true,
    lineSmooth: false,
    showArea: true,
    plugins: [
      Chartist.plugins.ctPointLabels({
        labelOffset: {
          x: 0,
          y: -7
        },
        textAnchor: 'middle'
      })
    ]
  })

Thanks in advance.

Most helpful comment

For anyone who has the same problem add the following line:
if(typeof d === "undefined") d = "0";
below this line:
function b(b, c) { var d = void 0 !== c.value.x && c.value.y ? c.value.x + ", " + c.value.y : c.value.y || c.value.x;

>All comments

For anyone who has the same problem add the following line:
if(typeof d === "undefined") d = "0";
below this line:
function b(b, c) { var d = void 0 !== c.value.x && c.value.y ? c.value.x + ", " + c.value.y : c.value.y || c.value.x;

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Globegitter picture Globegitter  路  4Comments

LandonSchropp picture LandonSchropp  路  3Comments

jbwl picture jbwl  路  4Comments

bluepineventures picture bluepineventures  路  4Comments

pjfsilva picture pjfsilva  路  4Comments