开发者

Multi Series Ext Chart JS

开发者 https://www.devze.com 2023-02-11 16:39 出处:网络
In Ext.Charts, i want to create a multi series chart 开发者_Go百科(line + bar in one chart) that gets data in its store from C#.

In Ext.Charts, i want to create a multi series chart 开发者_Go百科(line + bar in one chart) that gets data in its store from C#.

Is that possible? Is there an example that you can please show to explain how it works.


Definitely possible! You have an example graph with line + bar in extJS demo pages itself: http://dev.sencha.com/deploy/dev/examples/chart/charts.html (Refer the last chart with line and bar)

Regarding fetching data from C#.. All you need is a URL that will send you the data (XML or JSON). So, you can have java,C#,python, PHP or any other server side technology.

ExtJs uses stores to hold info, you need to have a store, load data into it and associate the store with the chart to render the data.

PS: I have a series of tutorials at my blog - http://technopaper.blogspot.com/2010/05/getting-started-with-extjs-charts.html

UPDATE I have explained how to handle charts with series in my blog. Have a look at the above link. I have a similar chart (only think is I am using line chart). My Json array returned from server side is:

[
{month:'Jan', sales: 2000, rev: 3000},{month:'Feb', sales: 1800, rev: 2900},
{month:'Mar', sales: 1500, rev: 3100},{month:'Apr', sales: 2150, rev: 2500},
{month:'May', sales: 2210, rev: 2700},{month:'Jun', sales: 2250, rev: 2900},
{month:'Jul', sales: 2370, rev: 2800},{month:'Aug', sales: 2500, rev: 2600},
{month:'Sep', sales: 3000, rev: 3400},{month:'Oct', sales: 2580, rev: 3250},
{month:'Nov', sales: 2100, rev: 3000},{month:'Dec', sales: 2650, rev: 3300}
]

In this I have two data (sales, revenue) and one axis info (month). So, you need to set your xAxis as month and the series info as sales and rev.

Binding your store with server side is done through JsonReader or Proxy ExtJS objects. You need to specify from which URL you need to get the data.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号