问题标签 [stackedbarseries]
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.
javascript - Stacked bar chart in D3js - bars are not on the correct places
I'm trying to build a stacked bar chart in D3js. I have problems to set properly y
and y0
attributes and draw the bars on their right positions. Probably I have a calculation mistake but I cannot find it. This is the link to the example code FIDDLE
The scenario is:
- I group the data first by "period" and the periods are shown on xAxis
- Then I have grouping by "type" - MONTH and ENTRY which should be stacked bars in different colors.
- The sum "amount" for each type per each period is shown on yAxis.
I use nest function with 2 keys to structure the data. The problem appears when I draw the bars in the actual stacked bar chart. I'm not sure whether the problem is in the way I access the data (key and values) or in the way I set the attributes "y" and "height".
The obvious errors are that one of the bars is hidden behind another one. And the second bar is under the xAxis.
I'm beginner in d3js and I cannot find the solution. Can somebody help me?
r - 在 ggplot 中为堆积条形图添加更多复杂性
我知道这有点混乱,但我正在尝试进一步划分构成堆叠条形图的数据。这是到目前为止的样子:
生成此图:(我会发布该图,但显然我的名誉达不到新成员的水平!)
如何按“物种”因子进一步划分条形?我假设它涉及添加另一个geom,但我对这一切都很陌生。谢谢!
编辑添加:尝试mtcars
用于虚拟数据,虽然不是最好的,因为 mpg 不像我的数据中的两次切割那样的产量。
这会产生这个丑陋的图表: http: //i.imgur.com/sK7A5am.png ( http://i.imgur.com/sK7A5am.png ) 我希望将这些条形中的每一个(例如cylinders
)分成两个并排的条形图(在本例中,6 个并排的条形图表示发动机的 mpg,carb
每个气缸系数的水平各不相同)。我希望这是有道理的。再次感谢!
matlab - 可视化这些数据的最佳方式是什么?
我有以下形式的数据:agent_i 在某些时间点具有百分比贡献的百分比(百分比):
我已将这些数据可视化为 MATLAB“运行图”,图形随时间变化,并在每次绘制每个代理的百分比。这给了我一个视频。但是,我还需要有一个静态表示,可以打印在纸上。因此,一个代表该数据的数字。我想过为每个时间点制作垂直条,条具有不同(或交替)颜色的条纹,条纹的大小对应于 %。这样,我丢失了哪个代理具有该百分比的数据,但这是可以接受的,这是我在将所有信息放在一个数字中时可以承受的损失。
但是,颜色图并没有真正的帮助,因为它只是根据条形堆栈的值对其进行着色。然而,我想要一堆交替的颜色。(并且只使用 2 种或最多 3 种颜色)
有人可以帮忙吗?
javascript - JQPLOT Stacked Bar Chart 数组输入问题
我正在尝试绘制一个堆积条形图,并且我正在动态地将数据传递给图表
当我通过输入
在变量 s1,s2,s3,s4,dateArr 中(下面的代码片段)
我得到了正确的堆积条形图
但是当传递给堆积条形图的数据如下
只有第二个数组被绘制,第一个被忽略
但是请注意,y 轴从 2 开始,即它识别第一个数组但未绘制相同的数组
这是我用来绘制图表的代码
那我做错了什么?
提前致谢
r - 如何在stackbar图中居中值并使用ggplot将希腊文本添加到图例
我创建了一个带有“ggplot”的堆积条形图,以显示移植实验的核型(分子)结果,每个面板代表一个位置,x 轴是各种底物,而 y 轴是百分比三种核型中的每一种。
我查看了 Stack Overflow 中的几个问题和答案示例,但无法弄清楚如何执行以下操作:
- 将堆叠条的每个部分中的值(应该四舍五入到小数点后两位)居中,现在我只是让它们从顶部偏移。
- 如何将我的图例文本从“BB”更改为希腊语“lower alpha,lower alpha”,将“BD”更改为希腊语“lower alpha,lower beta”,以及将“DD”更改为希腊语“lower beta,lower beta”。
这是一些示例数据和代码以及它生成的图的副本。
c# - 如何消除堆叠条中的间隙
我正在尝试用 C# 制作甘特图,我使用的是 StackedBar 图表类型。此图表的目的是显示如何根据“机器”的数量安排“任务”。在我的算法中,图表上的“任务”之间不应该有空闲空间。每个“任务”都作为新系列添加。在第一个栏上,它按应有的方式工作,但在其他栏上,“任务”在前一个栏结束后开始。我需要帮助来消除这些差距。有些任务需要在两台机器上划分,当我这样做时,这个任务就会像它应该的那样显示在第二列,从栏的开头开始。
我试图添加零数据点,就像在堆栈上的一些帖子中建议的那样,但它对我的情况没有帮助。(微软图表堆积柱形图有差距)
以下是我创建此图表的代码:
- 编辑 -
根据要求提供数据图表:http: //i.imgur.com/64X3SNy.png
reporting-services - SSRS stacked bar chart multiple series, utilizing category groups for different date fields
The source data is a SSAS cube, which contains information about tickets, particularly priority, date opened, and date closed.
Each ticket has a priority and date opened value, though the closed value may be null or another placeholder value (subject to change).
A ticket is represented by a record in the source table with the mentioned attributes, and in the cube each of the dates are linked to a date dimension record (with the exception of the potentially null closed date).
I utilize a named-set to limit the data from the cube to the past 13 months.
The desired result is a multiple column stacked bar chart, the Series Grouping should be Priority thereby creating the stack with Y-axis representing a ticket count dependent on the X-axis which is a grouping by month.
Each month grouping should have a stack dependent on the opened and closed dates.
The closest I've come is utilizing the category expressions but I have beginners knowledge in this.
Any suggestions in either the way I'm pulling the dataset from the cube with MDX to alleviate the creation of the chart or features of the SSRS chart control are welcome.
Thank you.
javascript - 如何使 yAxis 从特定时间开始在高图中使用条形系列?
我想让条形图从特定时间开始(1.Apr)
所以我在下面的示例中实现了这个:
使用下面的代码
yAxis 实际上从 1.Apr 开始,但我看不到条本身。
如果我将最小行标记如下
现在我可以看到栏出现了,但 yAxis 默认显示从 1.Jan 开始。
任何人都可以帮助我从 1.Apr 开始使栏可见和 yAxis 吗?
highcharts - 在 highcharts 堆叠条形聊天上创建超链接
我使用 Ko、highcharts 和使用 JSON 的数据创建了一个仪表板。我必须创建一个堆叠条形聊天,其中系列数据针对每个类别动态变化。示例 cat1 可能有 3 个系列对象,而 cat2 可能有 0 个,cat3 可能有 10 个等等......我有两个问题,1.如何将此动态 JSON 对象包含到系列对象中。(我参考了链接,我得到了解决方案,我必须尝试它们) 2. 一旦我点击特定位置(颜色)的条形聊天,我必须显示详细信息,(我已经设计并目前显示在我的仪表板,我需要切换到该部分)。他们是否有任何信息可用于处理这种情况。
在此先感谢,香卡尔