Dojo StackedAreas图表不接受对象作为值

编程入门 行业动态 更新时间:2024-10-28 16:16:34
本文介绍了Dojo StackedAreas图表不接受对象作为值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我所使用的每个Dojo图表都允许使用包含每个值点的一系列值和工具提示的对象数组。

Every Dojo chart that I have worked with has allowed for the use of an array of objects that contain the series of values and tooltips for each value point.

当使用StackedAreas图表类型,Dojo似乎忽略了对象内的值。例如:

When using the StackedAreas chart type, Dojo seems to ignore my values inside the objects. For example:

var values = [ {x: 1, y: 10, tooltip: 'test1'}, {x: 2, y: 30, tooltip: 'test2'}, {x: 3, y: 60, tooltip: 'test3'} ];

这可以在Lines,Columns和StackedColumns图表类型中工作。图表呈现轴线,您可以看到位于字符基线的标记,就像我仅为所有值提供零。

This works in Lines, Columns and StackedColumns chart types. The chart renders the axis and you can see the markers sitting on the base line of the char as if I had only supplied zero for all values.

提前感谢。希望这是有道理的。

Thanks in advance. Hope this makes sense.

推荐答案

该文档指定此页面上的不同类型: dojotoolkit/reference-guide/dojox/charting.html 在将图表连接到数据和指定数据系列。

The doc specifies the different types on this page : dojotoolkit/reference-guide/dojox/charting.html in the paragraph "Connecting Charts to Data and Specifying a Data Series".

对于任何非堆叠线条图类型,您可以指定坐标对。您需要使用与addPlot()调用中定义的hAxis和vAxis参数相对应的键。这些默认值为x和y。

[...]

使用addSeries()添加的每个数据集的堆叠图形类型都相对于上一个集合放置。这是一个简单的例子,显示了这个概念。而不是第二个数据集是在1处的直线,所有的点都高于第一个数据集的点。

chart1.addSeries("Series 1", [1, 2, 3, 4, 5]); chart1.addSeries("Series 2", [1, 1, 1, 1, 1], {stroke: {color: "red"}});

所以,对于在stackareas图上的工具提示,首先你必须激活你的绘图上的标记,那么你必须使用自定义的dojox / charting / action2d / Tooltip,它需要一个自定义函数来产生所需的工具提示。

So, for your tooltips on a stackedareas graph, first you have to activate the markers on your plot, then you have to use a custom dojox/charting/action2d/Tooltip, which takes a custom function to produce the desired tooltip.

我在这里举了一个例子: a href =jsfiddle/psoares/nUe3C/ =nofollow> jsfiddle/psoares/nUe3C/

I've made an example here : jsfiddle/psoares/nUe3C/

希望它有帮助...

更多推荐

Dojo StackedAreas图表不接受对象作为值

本文发布于:2023-11-08 18:45:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1570132.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图表   不接受   对象   Dojo   StackedAreas

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!