Wednesday, March 7, 2012

Dynamically adding values to line chart

I have a report with a line chart and I need to add a number of values to
the chart from the data in my dataset. The problem is that the number of
values to be drawn on the chart may change each time a report is generated
and so I cannot add the values manually in the report designer. So for
example one report may have 5 values to be drawn on the chart Value1,
Value2, Values3... but then another report may only contain 2 values in the
dataset that need to be drawn on the chart.
Each value (Value1...) in the dataset belongs to the same row and so it is
the number of columns in each row which can vary each time a report is
generated.
First report generated (5 columns):
Value1 Value2 Value3 Value4 Value5
10 20 54 32 67
Second Report generated (2 columns):
Value1 Value2
45 2
Does anybody know how I can add values dynamically to a line chart?Hi Holmes,
Welcome to use MSDN Managed Newsgroup!
From your descriptions, I understood you would like to generate a Chart
with dynamic columns and its values. However, I am not sure what's the data
for your X-axis and Y-axis. Would you please show me a detailed
information? (For example, the chart will be has such points (1,10), (2,
20), (3,54), (4,32), (5, 67) )
In the Chart properties, we may notice that you will have to add Fields /
Expressions that based on Fields for your Values / Category Group / Series
Group, we cannot add columns dynamically. You will have to convert the data
in the same row into same column.
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi
Thanks for the reply. From what I understand you are suggesting I should
convert the dynamic values into just one column.
Here is a more detailed description of the data I have. Each query returns a
number of rows which have an ID, Value (Integer), and then a dynamic number
of Bands (Band1, Band2 ... which are Integers). However the number of bands
is constant for all rows from a single query but is does change each time
the query is executed.
So I may have
ID Value Band1 Band2
1033 25 30 60
1034 35 30 60
The bands need to be represented as straight lines drawn horizontally across
the line chart.
The Values need to be plotted as points and then a line drawn connected them
all.
So I can put the Band values into a single column but how will this help?
How can I get the Band values back from a single column?
Kind Regards
Lewis Holmes
"Michael Cheng [MSFT]" <v-mingqc@.online.microsoft.com> wrote in message
news:ZiTlmYovFHA.780@.TK2MSFTNGXA01.phx.gbl...
> Hi Holmes,
> Welcome to use MSDN Managed Newsgroup!
> From your descriptions, I understood you would like to generate a Chart
> with dynamic columns and its values. However, I am not sure what's the
> data
> for your X-axis and Y-axis. Would you please show me a detailed
> information? (For example, the chart will be has such points (1,10), (2,
> 20), (3,54), (4,32), (5, 67) )
> In the Chart properties, we may notice that you will have to add Fields /
> Expressions that based on Fields for your Values / Category Group / Series
> Group, we cannot add columns dynamically. You will have to convert the
> data
> in the same row into same column.
> Thank you for your patience and cooperation. If you have any questions or
> concerns, don't hesitate to let me know. We are always here to be of
> assistance!
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> =====================================================> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>|||Hi Lewis,
If the Bands number are not sure, I am afraid you cannot add these values
dynamically. As I have said, you must convert the tables like below
Line1: (for Band1)
X-axis Y-axis
1033 30
1033 60
Line2: (for Band2)
X-axis Y-axis
1034 30
1034 60
Make sure what was the X-axis and Y-axis value you want in the table and
then compose a line.
If you have any more tables or pictures to demonstrate this scenario more
clearly, you are welcome to send the files here or send them to me directly
if you have security concerns. my direct email address is
v-mingqc@.microsoft.com, you may send the file to me directly and I will
keep secure.
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.

No comments:

Post a Comment