【发布时间】:2015-06-19 19:08:18
【问题描述】:
我有一个非常简单的酒窝折线图。我想将 x 和 y 轴颜色更改为白色。
var svg = dimple.newSvg(".line_chart_container", 400, 300),dataset;
var chart = new dimple.chart(svg, dataset);
var x = chart.addCategoryAxis("x", "Attempts");
//x.style ("fill","red")
var y = chart.addMeasureAxis("y", "Value");
y.showGridlines = true;
x.showGridlines = true;
var s = chart.addSeries(["Metric", "Value"], dimple.plot.bubble);
var lines = chart.addSeries("Metric", dimple.plot.line);
lines.lineWeight = 2;
lines.lineMarkers = true;
chart.assignColor("Metric", "#30D630");
chart.draw();
s.shapes.style("opacity", function (d) {
return (d.yValue === 0 ? 0 : 0.8);
});
我检查了dimple.axis documentation in GitHub,但找不到任何东西。有一个 dimple.axis.colors 属性,但它改变了数据的颜色而不是轴的颜色。酒窝甚至支持这个吗?
我也尝试添加样式属性(如在 D3 中):
x.style ("fill","red")
但是发现了一个错误:Uncaught TypeError: x.style is not a function
有什么想法吗?
【问题讨论】: