Line Chart label displayed only if there are multiple labels?


Because my line chart that has one series did not display the label, I had to add some dummy series like {name: ‘.’, data: [0, 0, 0, 0, 0, 0, 0]} to display the real one’s label.

Is it intended? I think it should display label even if there is only one series.


Hey @bsmmoon, that’s right. The legend only shows if there are more than 1 series by design. The rationale is that normally it wouldn’t show additional useful information if you only have a single series. That said, I’d be keen to hear why is this important for your visualization/metric.


Thanks for the answer!

If we don’t want to have label displayed, we can just leave out name field for the series since it is an optional field. In my opinion, it is better because it provides one more option for the users. It also feels more consistent in terms of API design.

In terms of visualization, it can be a workaround for my another issue regarding title (link) as I can use the label to show what line chart this is. I would love if I can minimize manual editing.

By the way, API doc does not mention this I think, so someone like me can get confused haha