简体   繁体   English

图表面积超过系列长度

[英]Chart area exceeding series length

I pull data remotely to create a line chart. 我远程提取数据以创建折线图。 The chart spans time. 图表跨越时间。 So weekly, monthly, quarter, etc... Series shows digits representing dollar or percentage. 因此,每周,每月,季度等。系列显示代表美元或百分比的数字。 Anyhow, problem I have is this. 无论如何,我的问题是这个。 If a user wants to view data for current quarter and the date is the middle of the quarter, the anything after current date drops to zero. 如果用户要查看当前季度的数据,并且日期在该季度的中间,则当前日期之后的所有内容都将降至零。 Is there a way to have the chart area show the defined time (weekly, current quarter, etc...) but then cut the series at current date? 有没有一种方法可以让图表区域显示定义的时间(每周,当前季度等),然后在当前日期剪切该序列? Even if the pulled remote data shows zero rather than null or anything like that? 即使提取的远程数据显示零而不是null或类似的东西? I cannot find examples or documentation for this and no luck so far. 我找不到与此相关的示例或文档,到目前为止还没有运气。 So am hoping someone here can help. 因此,希望这里有人能提供帮助。

You can use setExtremes which allows to define "range" on axis. 您可以使用setExtremes ,它允许在轴上定义“范围”。

ps. ps。 please recreate your example in the jsfiddle.net 请在jsfiddle.net中重新创建您的示例

Alternatively, It sounds like something that should be handled on the back end, when you pull the data...if I understand the problem correctly. 或者,听起来好像应该在后端处理,当您提取数据时……如果我正确理解问题的话。

It sounds like you are building the data series with zero values if there is no data - if you change that to populate with null values, or if you simply don't build the data series beyond the available data, your problem should go away. 听起来好像您在没有数据的情况下使用零值构建数据系列-如果您将其更改为使用空值填充,或者您只是不构建超出可用数据范围的数据系列,那么问题就应该解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM