dynamically creating charts from a sql source

Soldato
Joined
8 Mar 2005
Posts
4,068
Location
London, UK
Hi, I've been playing around with visual web developer(asp) which has gone pretty smoothly however I'm having little success in being able to dynamically create multiple charts based upon data sourced from a sql query.

Currently I have a simple dropdownlist(instance) which allows me to pull a single row of data (which contains 3 series of chartable data) which works perfectly, however I now wish to create a dropdownlist (server) which shows all instances running and in turn generate a chart for each listed instance. Using gridview I can easily show all instances per server but I'm struggling how to then dynamically create a chart per each instance(row in the gridview).

I've searched on how to do this with some/limited success, my knowledge of asp is what is letting me down admittedly and I have a feeling what I'm trying to do is beyond the basics that VWD offers.

Any help, pointers, much appreciated.

Cheers, Paul.

EDIT - I do not actually need to show the instance detail in a gridview, but I do need a means or mechanism to generate the chart per instance from the selected server in the dropdownlist.
 
Last edited:
That appears to be just another chart api/wrapper (written in javascript). Or perhaps I'm missing something (probably am).

Creating a chart bound to a sqlsource isn't the issue. It's being able to dynamically create multiple charts from a sqlsource based upon multiple rows of chartable data as opposed to just 1.

Cheers, Paul.
 
That appears to be just another chart api/wrapper (written in javascript). Or perhaps I'm missing something (probably am).

Creating a chart bound to a sqlsource isn't the issue. It's being able to dynamically create multiple charts from a sqlsource based upon multiple rows of chartable data as opposed to just 1.

Cheers, Paul.


Do you mean similar to a pivot table in Excel, except on a web page?
 
No, I have a basic asp.net webapp which can plot a chart based on a sqldatasource query. This works fine as it pulls a single record of data. However I wish to plot multiple charts based upon a query which will return multiple record/s.

Currently I'm using the chart control to render the charts. So what I'm after, or what I was hoping would be relatively easy was to continue to use the chart control to render multiple charts depending on the number of records returned.

Probably as clear as mud :)
 
Last edited:
Not different. Just multiple charts generated from the dataset (1 per each record). So rather than bound a query which returns a single row of data and creates the chart. I wish to bind a query which returns multiple rows of data and in turn produces a chart per each row. So I was hoping there would be a means within the visual aspect of VWD which would cater for dynamically creating multiple charts depending on the number of returned rows of data.

EDIT - So for instance, the chart control allows you to bound to a query but will only create a single chart, which is to be expected. However I wish or was hoping you could easily loop if multiple rows detected to create an individual chart for every row within the dataset.

EDIT - Actually this has spawned a secondary question based on just using a single graph.

As an example (which also adds some further detail around the prmary question).
Date VM MinCPU MaxCPU
01/01/12 vm1 50 90
02/01/12 vm1 50 80
03/01/12 vm1 50 90
04/01/12 vm1 20 80
01/01/12 vm2 50 90
02/01/12 vm2 20 40
03/01/12 vm2 10 60
04/01/12 vm2 20 80
....
Using chart control this will plot 8 lines (2 series) on a single chart with x(Date) and y((Series1)MinCPU & (Series2)MaxCPU). Question is, how do I set-up a legend which will auto-populate with the VM name and thus identify which plot belongs to which VM.

Cheers, Paul.
 
Last edited:
Back
Top Bottom