简体   繁体   English

一个商店在ExtJS4图表中的多个时间轴系列

[英]Multiple timeline series in ExtJS4 chart with one store

The data, that comes from the server looks like this: 来自服务器的数据如下所示:

[
  { date: 123456789, browser: 'firefox', clicks: 123, ... },
  { date: 123456789, browser: 'chrome' , clicks: 456, ... },
  { date: 123456790, browser: 'firefox', clicks: 678, ... },
  { date: 123456790, browser: 'chrome' , clicks: 453, ... },
  { date: 123456791, browser: 'firefox', clicks: 234, ... },
  { date: 123456791, browser: 'chrome' , clicks: 555, ... },
  ...
]

I generate my models from this, pack them into a store and show them in a grid, which works fine. 我据此生成我的模型,将它们打包到商店中,并以网格显示,效果很好。

But now I want to show a timeline chart for this table, and it should have one series for every browser. 但是现在我想显示该表的时间表,并且每个浏览器应该有一个系列。

Is it possible to filter series? 是否可以过滤系列?

Something like this: 像这样:

series: [
  {
    type  : 'line', 
    title : 'Chrome',
    xfield: 'clicks',
    yfield: 'date',
    filter: { browser: '*chrome*' }
  }
]

You can only filter a store, but when you filter the store your grid will get filtered aswell. 您只能过滤商店,但是在过滤商店时,网格也会被过滤。 You could make a copy of the store, or create a new store with filtered data from the first store. 您可以复制存储,也可以使用第一个存储中的过滤数据创建新存储。

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

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