问题标签 [sparklines]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1189 浏览

html - 如何在 div 中居中 jquery 迷你图画布

我似乎无法将 jquery 迷你图创建的画布居中在 div 元素中。画布具有固定宽度,但通常的 css ( display:block; margin:0 auto;) 似乎不起作用。

这是jsfiddle:

http://jsfiddle.net/7V5nH/

有人可以告诉我如何使这幅画布居中吗?

谢谢

0 投票
1 回答
1729 浏览

sparklines - Jquery Sparklines 在负值的工具提示上显示错误的格式

我正在使用这个 jquery 插件来显示一个迷你图,http: //www.omnipotent.net/jquery.sparkline 。

工作完美,除非行值上有负值,它只显示“-,299”而不是“-299”,我试图追踪所有逗号仍然附加的内容,即使该值仅以数百为单位。

这是小提琴http://jsfiddle.net/alfdc/u8pyg/

HTML:

JS:

0 投票
1 回答
1071 浏览

jquery - jQuery迷你图

我正在使用 Jquery Sparkline 插件在我的网站上绘制折线图,​​它工作正常,但我想编辑它的工具提示。我阅读了他们官方网站上提供的整个工具提示文档,但没有积极的结果。

这是我的代码:

我正在绘制推文数与小时图,所以我只想显示“y Hrs 的 x Tweets”,有人可以帮我解决这个问题吗?

0 投票
1 回答
187 浏览

excel - 每次更新时都会返回列中列出的最后 12 个值的 Excel 2013 函数?

正如标题所描述的,我试图找到一个返回列的最后 12 个值的函数。问题是每个月都会在列中添加一个新值,我需要这些值自动更新。理想情况下,我的最终结果将是一个 12 行表,当我将新数据添加到源表时会进行调整。从新表中,我想制作一个可以调整的迷你图。有谁知道如何做到这一点?

我尝试使用 VLookup 以及 Index 和 CountA 但都没有给我我想要的东西。他们只返回最后一个值,但我需要最后 12 个。

提前感谢您的帮助!

丹泽尔

0 投票
1 回答
7242 浏览

jquery - 带有表格动态数据的 HighChart 迷你图

我正在尝试为项目模拟 highcharts 提供的迷你图,但是 highchart 提供的 js fiddle 具有非常静态的表数据数据。但我想为表格动态填充值,而不是硬编码它们。我对这个 highcharts 非常陌生,并且一直在尝试找到可以使这个 highchart 动态但没有找到很多示例。任何有关此主题的信息将不胜感激。请为此迷你图查找当前 jsfiddle(静态定义的表数据)的示例。

我想在 highcharts 的范围内动态获取上述数据。

提前致谢 !

编辑 CubanGuy,感谢您的回复。我正在以 JSON 的形式获取数据。下面是我使用的 json 格式。

我没有关注的是如何用这些数据填充表格。图表(如 highchart)将有多个包含数据的列和 1 个包含表示某些数据的图表的列。Highchart 使用标签静态放置数据列的值。很抱歉有任何困惑,我也是这个论坛的新手。

0 投票
1 回答
1974 浏览

vba - VBA - 动态范围的迷你图在 VBA 中未更新

我有一个与这个非常相似的问题,我有:

  1. 创建了一个带有迷你图的工作表,它引用了一个动态范围
  2. 我有一个宏,它通过循环更新一些单元格(因此每次循环迭代都会改变迷你图)
  3. 复制大范围(包括迷你图和其他命名范围)
  4. 将此范围粘贴到第二张纸中(我无法弄清楚如何以其他方式进行操作,因此我使用该Range.CopyPicture方法并将范围作为图片粘贴到第二张纸上,但是如果您知道粘贴的方法迷你图本身,这样当我再次更新 raneg 时它不会更新,请告诉我)

现在,我的问题是,如果我在调试模式下单步执行代码,一切正常,但是如果我让宏自动运行,迷你图永远不会更新(所以它总是看起来像第一次运行宏) .

作为我的问题的一个简单示例,假设我的工作表中有这个:


现在,简单的 VBA 代码:


现在,这应该粘贴 10 个不同的迷你图,但它会粘贴 10 个相同的迷你图。并且如果我在调试模式下单步执行它(或者甚至设置断点然后F5在 VBA 中运行,那么它就可以工作了!)再次,我查看了上面提到的问题并尝试了它的技巧无济于事....任何人都知道如何让它适用于迷你图????

非常感谢!!!

0 投票
1 回答
659 浏览

javascript - 带有实时数据的迷你图

如何使用来自 javascript 中的事件侦听器的实时数据创建迷你图?

我尝试了几种资源,但没有一个能让我清楚地了解如何将数据点连续发送到迷你图以绘制它们。

0 投票
1 回答
1558 浏览

javascript - draw a bar chart with jquery sparkline and mysql data

I am trying to use jquery sparkline with mysql data for showing how much money every user make in every day... Here I show you the money about one user example which is in the mysql DB:

but not show nothing ...can you help me and show me where is my error?

This is the JS library I am use to try to show the graph:

Here the javascript in the page:

Here the code in users.php

And for last the id to show the graph:

always show me only loading...


EDIT

I changed this part of the code inside of users.php

TO

And now show me the graph with these values:

But the graph is showed with every separated numbers and dots.... ", 2,5,.,0,0,",,....and so on

nevermind! Now is working properly and show me all the data per user!

0 投票
1 回答
746 浏览

r - In R, write functions on-the-fly (for sparkTable content)

I'm learning to use the sparkTable package. I'm creating tables having a sparkLine followed by a certain numbers of columns (not fixed). The columns all achieve the same thing: display the n'th element of the time series, rounded to 2 digits. For instance, column 1 following the spark graph will display the value of the 1st time point, 2nd column, the 2nd data point, and so on. For now, I deal with it by:

First declaring a list of functions allowing for as many time points I might expect to come up in the data.

Then, when calling newSparkTable, I make the tableContent argument "expand" to the number of time points present in the data:

This works well, but I'm thinking there must be a more flexible approach (I'm thinking of lambda functions in Python, or something like that). Ideas most welcome.

Edit

I'm getting closer to it. A way to have this code evaluated would do the trick:

But then:

Only the last one gets eval'd. :s

0 投票
2 回答
8024 浏览

python - 在 python 中使用 matplotlib 创建迷你图

我正在研究 matplotlib 并创建了一些图表,如条形图、气泡图等。

有人可以举例说明折线图和迷你图有什么区别,以及如何使用 matplotlib 在 python 中绘制迷你图吗?

例如使用以下代码

生成的折线图如下:在此处输入图像描述

但是对于相同的数据,我无法理解折线图和火花留置权图之间的区别。请帮我理解