?
Solved

How to create multiple xValueMembers in ASP Chart control

Posted on 2013-12-24
2
Medium Priority
?
1,946 Views
Last Modified: 2013-12-30
I have a chart control that looks like the attached image.  The control consists of 3 series and is bound to a dataset.  The xValuMember is bound to the "AcctName" column.  But what I need to do is combine the data in the AcctName column with the data in the AcctNumber column so my xvaluemember label is not just the account name but under it is the account number.

what the labels look like now
thanks in advance for the help.
0
Comment
Question by:mgmhicks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 2000 total points
ID: 39745834
The lack of response may indicate this is not easily possible the way you describe it.

How about this workaround: create a calculated column and use that for XValueMember instead of an existing column. Note: I only tested with a simplified version of your chart and data.
        Dim dt As New DataTable
        dt.Columns.AddRange(New DataColumn() {New DataColumn("AcctNumber", GetType(Integer)), New DataColumn("AcctName", GetType(String)), New DataColumn("Budget", GetType(Integer))})
        dt.Rows.Add({12345, "Cust 1", 567})
        dt.Rows.Add({12346, "Cust 2", 678})
        dt.Rows.Add({12347, "Cust 3", 789})
        Dim dc As New DataColumn("AcctNumberAndName", GetType(String), "'# ' + AcctNumber + ' : ' + AcctName")
        dt.Columns.Add(dc)
        Chart1.Series(0).XValueMember = "AcctNumberAndName"
        Chart1.Series(0).YValueMembers = "Budget"

        Chart1.DataSource = dt
        Chart1.DataBind()

Open in new window

EDIT: even easier might be of course to add a calculated column to your SQL query but I can't be sure how easy that would be in your situation.
0
 

Author Closing Comment

by:mgmhicks
ID: 39746207
thanks that Idea worked
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question