C3.js-独立显示/隐藏数据系列的点 [英] C3.js - Show/hide points independently for a data series

查看:97
本文介绍了C3.js-独立显示/隐藏数据系列的点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C3.js为数据系列创建折线图.

I am creating a line chart for a data series using C3.js.

我正在努力只显示其中一个系列的要点".

I am struggling in trying to show the "points" only for one of the series.

基本上,首先我用一些参考数据创建了一个多系列折线图,然后我(用char.load)加载了一个新的特定数据线,我想在其中显示点,仅针对该特定线.其他参考线保留有隐藏点.

Basically, first I am creating a multiple series line chart with some reference data, and then I am loading (with char.load) a new particular data line in which I want to show points, only for that particular line while the other reference lines remain with hidden points.

通过C3.js可以吗?如果是这样,您能指示我这样做吗,谢谢! 另外,欢迎使用C3.js的同时使用D3.js的任何方法.

Is that possible via C3.js? If so, could you instruct me to do so, thanks! Also, any method to do so using D3.js while using C3.js is welcome.

这是一个官方示例,其中所有点对于一个数据系列都是隐藏的,仅供参考: http://c3js.org/samples/point_show.html

This is the official example in which all points are hidden for a data series, just for reference: http://c3js.org/samples/point_show.html

推荐答案

c3.js在其所有元素上提供了全面的类属性,因此您可以使用CSS对其进行自定义.例如,要隐藏第二个系列中的点,请添加以下CSS:

c3.js provides comprehensive class attributes on all its elements so you can customize them with CSS. For example to hide the points on the 2nd series add this CSS:

#chart .c3-circles-data2 {
  display: none;
}

示例此处.

这篇关于C3.js-独立显示/隐藏数据系列的点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆