我使用dc.js 构建了两个图表。对于标题中的第二个图表,您可以看到带有两个选项的下拉列表。选择后,图表将使用新数据重新绘制。在桌面上工作很好。然而,在移动平台上什么都没有发生。我使用以下方法:
HTML:
<div id='Line_chart_rate'>
<strong>Daily Price of a Dollar in </strong>
<select class = 'line-drop'>
<option id = 'RUB'>Ru
我很难理解为什么当你点击图表时,中间的数字不会更新,直到用户在点击图表后移动他们的光标。
onClick: function(event, chart) {
var index = chart[0]._index;
var value = ~~percentages[index];
chart[0]._chart.config.options.elements.center.text = value;
},
我已经创建了一个JS小提琴,您可以在其中看到这一点。
根据我的经验,到目前为止,这是Chrome和FF中的一个问题。
我实际上在我的项目中使用了NG2图表
我有一个简单的node.js应用程序:
server.js
const express = require('express');
const app = express();
const PORT = 8080;
app.use(express.static('client'));
// Start the express web server listening on 8080
app.listen(8080, () => {
console.log('Service started on port 8080.');
});