v
Not logged inv
SearchAsk a QuestionReport an IssueMake a SuggestionMy Questions and Issues
Issue Details
Find By ID

Load multiple series in 1 step for a web chart

Issue Details

Log in to Track Changes or Edit
Q204225
Question
Fernando Segura
Yes
Processed
Customer Closed
.NET (ASP.NET)
XtraCharts Suite
DXPerience 8.1.4
Windows XP
Microsoft Visual Studio 2005
9/10/2009 4:54:16 PM
-> Created by Fernando Segura 4/29/2009 6:44:41 PM

Attachment: example.JPG (116493 bytes)

Good Day I'm having an issue and I'm gonna try to explain it to you hope I'm clear enough

I have a table with some data like for example the next

-----------------------------------------------
    Year | Month | Amount |
-----------------------------------------------
    2008 | January | $25, 000.00 |
-----------------------------------------------
    2009 | January | $30, 000.00 |
-----------------------------------------------
    2007 | April | $15, 000.00 |
----------------------------------------------
    2006 | February | $10, 000.00 |
----------------------------------------------
 And so on, well my issue is that I want to load that data into a web chart but I want the data to be grouped by year in each series group and each serie represents the month for example I want all the januarys are grouped together each bar representing a year so they can be compared on sight, all the februarys, and so on if I want to do this I'm gonna have to create 1 datatable for each serie and then load it manually and create each serie standard way so I'll have to know how many years are integrated in that datatable, what I really want to know is if there's a method so I can pass a structure or somethign in code to the web chart control and he detects the changing of each series group

Hope I was clear enough

Best regards!

I'm attaching an image that ilustrates what I want to do, altough this chart is representing quarters is the same concept, 2008 vs 2009 and Objetivo is another simulated year I created in code

<- Reviewed by DevExpress Team 4/30/2009 5:40:20 AM
<- Processed (Answered) by DevExpress Team 4/30/2009 6:50:16 AM

Hi Ivan,

I believe you can use the Series Template approach to accomplish this task.
First, you should specify a data field (see the WebChartControl.SeriesDataMember property), whose values are used to dynamically create series when binding a chart control to data. In your example, it's 'Year'. Then, you should adjust both SeriesTemplate.ArgumentDataMember and SeriesTemplate.ArgumentValueMembers properties (e.g. set them to 'Month' and 'Amount' data fields).
For reference, check the corresponding documentation article: ChartControl.SeriesTemplate Property.
Should you need further clarification, feel free to ask. I'll be glad to help you.

Thanks,
Alex

-> Reactivated by Fernando Segura 4/30/2009 3:25:36 PM

It really helped me thanks a lot but now I have another problem

I need change the information being loaded to the chart and when I change the parameters and te name of the fields change even if it's the same structureit tries to load the old data and send an exception for example

If I load this data

SELECT year, month sum(total) from myView GROUP BY year, month

I send year to the seriesDataMember, month to the SeriesTemplate.ArgumentDataMemeber and sum(total) to the SeriesTemplate.ValueDataMember and it's loads just like I want it

but then the user changes the filters and the sql query looks like this

SELECT quarter, client, sum(total) from myView GROUP BY quarter, client

And like before I send quarter to the SeriesDataMember, client to the SeriesTemplate.ArgumentDataMember and sum(total) to the SeriesTemplate.ValueDataMember but when I try to run it it sends an error that says

The field year does not exist in the current datasource

What makes me think that I have to do somenthing so the chart erases it's memory from the old datasource, I already tried setting datasource = nothing or using the method dispose but doesn't seem to work

I will really appreciate your help once again Alex

Best Regards

<- Processed (Answered) by DevExpress Team 5/1/2009 9:25:53 AM

Hi Ivan,

You might need to call the WebChartControl.DataBind method to bind the data source to the chart when binding it at runtime.
If this doesn't help, post a complete sample project, showing the issue.
This would allow me to determine what's going wrong, and provide you with an exact solution.

Thanks,
Alex

-> Reactivated by Fernando Segura 5/4/2009 2:13:44 PM

I'm sorry maybe I didn't explained myself right what I'm asking is how to change the datasource fr a webchart that already has data let me see if this makes it clear enough

I have a web form in wich I have a webchart and a series of filters like client name, product name, date ranges, etc
and this webpage server for various reports, not printable just for reviewing them the users often enter the site and put let's say the filter for a product name and a determined data range, they check it and then they want to see the hole client well there's the problem when the webchart is already loaded and I try to load it once again it fails and sends an exception specifying that the producto field is no longer available as you can see the filetrs are not the same so the result of my dataset is not the same because the fields that it retrieves changed so when I try to pass the other dataset it fails, the problem is not the databind, I used datasource = nothing and then databind to erase the past schema but I does'nt works either

I appreciate your help

Thanks in advance

<- Processed (Insufficient Information) by DevExpress Team 5/5/2009 8:20:26 AM

Hi Ivan,

Unfortunately, the information you provided doesn't allow me to clearly diagnose this problem.
If possible, post any sample project, as I requested previously. I'll be glad to help you.

Thanks,
Alex

<- Processed (Customer Closed) by Fernando Segura 9/10/2009 4:54:16 PM
Log in to Track Changes or Edit

Peer-to-Peer Discussion in DevExpress Forums

No discussion on this article has been started yet.

Please login to start discussion.

v
v
Search
Searching Tips