Solved

How to create multiple xValueMembers in ASP Chart control

Posted on 2013-12-24
2
1,891 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 500 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

736 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