1
If you are willing to try an Add-in, there is a way to use Javascript, HTML and css in Excel. It's called Funfun and it hosts an online editor with an embedded spreadsheet so the transition isn't hard between the website to Excel.
如果您愿意尝试外接程序,那么在Excel中有一种使用Javascript、HTML和css的方法。它叫做Funfun,它有一个在线编辑器,里面有一个嵌入式的电子表格,所以在网站之间转换成Excel并不难。
Here is a chart I made with Highcharts:
这是我用海图制作的一张图表:
https://www.funfun.io/1/#/edit/5a61c190404f66229bda3f0f
https://www.funfun.io/1/ /编辑/ 5 a61c190404f66229bda3f0f
In this example I took the chart from a Highchart demo, and replaced the data with mine. I store my data in the embedded spreadsheet, and thanks to a json file I can use it in my Javascript code.
在这个示例中,我从一个Highchart演示中获取图表,并将数据替换为我的。我将数据存储在嵌入式电子表格中,由于有了json文件,我可以在Javascript代码中使用它。
That is how I get my data from the spreadsheet with the json file:
这就是我从json文件的电子表格中获取数据的方式:
{
"data": "=A1:E16"
}
I store it in my script.js with the right format so I can directly load it in Highcharts (for numbers you must convert your data into floats or int):
我将它保存在我的脚本中。使用正确的格式,这样我就可以直接以海图的形式加载它(对于数字,您必须将数据转换为浮点数或int):
var data = [];
for (var i = 1; i <$internal.data.length; i++)
data.push(
{
x: parseFloat($internal.data[i][2]),
y: parseFloat($internal.data[i][3]),
z: parseFloat($internal.data[i][4]),
name: $internal.data[i][1],
country: $internal.data[i][0]
}
);
After You've chosen all of you're options for your chart you can add your data:
在您选择了所有的图表选项后,您可以添加您的数据:
series: [{
data: data
}]
Once you are happy with your chart you can directly load it into Excel by pasting the URL in the Funfun add-in. Here is how it looks like with my example:
一旦你对你的图表满意,你可以直接将它加载到Excel中,粘贴在Funfun插件中的URL。下面是我的例子:

Of course you can use another library than Highcharts, there are a lot of powerful libraries for data visualization like charts.js and D3.js.
当然,除了Highcharts之外,您还可以使用其他库,有很多强大的库用于数据可视化,比如charts。js和D3.js。
I know this is an old post but I hope it helps people with the same problem.
我知道这是一个古老的帖子,但我希望它能帮助人们解决同样的问题。
Disclosure : I’m a developer of Funfun.
我是Funfun的开发者。