4

我在深色背景上绘制了一个图表,但由于轴颜色和刻度值颜色,很难阅读。如何将轴、刻度和轴刻度值的颜色更改为白色?

4

4 回答 4

8

例如,您可以用来CSS设置图表的样式

path.domain { stroke: white; }
.tick text { stroke: yellow; }
.c3-legend-item text { stroke: grey; }

要使轴变为白色,刻度标签为黄色,图例文本为灰色。

于 2015-04-27T10:03:47.603 回答
3
.c3 path, .c3 line, .tick text { 
  stroke: white;
}
于 2016-05-04T15:15:26.007 回答
1

如果您不想使用描边,请尝试更改填充颜色:

path.domain { fill: white; }
.tick text { fill: yellow; }
.c3-legend-item text { fill: grey; }
于 2018-04-20T12:31:21.287 回答
1

您可以尝试调整路径和线条的 CSS 属性。请参阅下面的示例 CSS 作为帮助程序。

.c3 .c3-axis-x path,
.c3 .c3-axis-x line {
  stroke: red;
}

.c3 .c3-axis-y path,
.c3 .c3-axis-y line {
  stroke: blue;
}
于 2020-10-21T16:27:27.293 回答