[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do I create a asp.net chart with side by side

Posted on 2011-03-21
4
Medium Priority
?
324 Views
Last Modified: 2012-05-11
I have a graph that needs to be done side by side. an example would be you have two sets of dates. one date set is jan 1, 2011 - jan 7, 2011 and the second set is march 12, 2011 - march 19, 2011. what I need to know is how to have a side by side comparison from both of these date sets vertically. so the first date set would be on the left and the second date set would be on the right. my data looks like this...

date         |   hour   |   mw
1/1/2011       1        500
1/1/2011       2        500
1/1/2011       3        500
1/1/2011       4        500
1/1/2011       5        500
1/2/2011       1        500
1/2/2011       2        500
1/2/2011       3        500
1/2/2011       4        500
1/2/2011       5        500
1/3/2011       1        500
1/3/2011       2        500
1/3/2011       3        500
1/3/2011       4        500
1/3/2011       5        500

3/12/2011     1        500
3/12/2011     2        500
3/12/2011     3        500
3/12/2011     4        500
3/12/2011     5        500
3/13/2011     1        500
3/13/2011     2        500
3/13/2011     3        500
3/13/2011     4        500
3/13/2011     5        500
3/14/2011     1        500
3/14/2011     2        500
3/14/2011     3        500
3/14/2011     4        500
3/14/2011     5        500
0
Comment
Question by:bschave2
[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
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
nbove earned 2000 total points
ID: 35185292
Bind each set of data to a gridview with a style of "display:inline"
0
 

Author Comment

by:bschave2
ID: 35191287
i need this to be a chart with points. I cannot use a gridview.
0
 
LVL 7

Assisted Solution

by:nbove
nbove earned 2000 total points
ID: 35191634
The method of rendering the tables is rather irrelevant.  The end result will be two table elements.  If you simply add a "style=display:inline" to those tables, they will display side by side.
0
 

Author Comment

by:bschave2
ID: 35284222
nevermind. I used a union on the data and created strip lines to solve this problem. Here is the code.
on page load i put:

CurrentChart.ChartAreas["ChartArea1"].AxisX.IsMarginVisible = false;
                CurrentChart.ChartAreas["ChartArea1"].AxisX.LabelStyle.Interval = 24;
                CurrentChart.ChartAreas["ChartArea1"].AxisX.MajorGrid.Interval = 24;
                CurrentChart.ChartAreas["ChartArea1"].AxisX.MajorTickMark.Interval = 24;
                CurrentChart.ChartAreas["ChartArea1"].AxisX.Interval = 24;
                CurrentChart.ChartAreas["ChartArea1"].AxisX.StripLines.Add(new StripLine());
                CurrentChart.ChartAreas["ChartArea1"].AxisX.StripLines[0].StripWidth = 168;
                CurrentChart.ChartAreas["ChartArea1"].AxisX.StripLines[0].BackColor = System.Drawing.ColorTranslator.FromHtml("#eeeeee");
                CurrentChart.ChartAreas["ChartArea1"].AxisX.StripLines[0].IntervalOffset = 168;
                CurrentChart.ChartAreas["ChartArea1"].AxisX.StripLines.Add(new StripLine());
                CurrentChart.ChartAreas["ChartArea1"].AxisX.StripLines[1].StripWidth = 168;
                CurrentChart.ChartAreas["ChartArea1"].AxisX.StripLines[1].BackColor = System.Drawing.ColorTranslator.FromHtml("#99ccff");
                CurrentChart.ChartAreas["ChartArea1"].AxisX.StripLines[1].IntervalOffset = 0;

                
                Build_daily_Graphs();

private void Build_daily_Graphs()
        {
            try
            {
                CurrentChart.DataSource = Get_WPP_Period(ReportType);

                CurrentChart.Series["WPPSeries"].XValueMember = "study_date";
                CurrentChart.Series["WPPSeries"].YValueMembers = "mw";

                CurrentChart.Series["MinSeries"].XValueMember = "study_date";
                CurrentChart.Series["MinSeries"].YValueMembers = "minmw";
                CurrentChart.Series["MinSeries"].Color = Color.Red;

                CurrentChart.Series["MaxSeries"].XValueMember = "study_date";
                CurrentChart.Series["MaxSeries"].YValueMembers = "maxmw";
                CurrentChart.Series["MaxSeries"].Color = Color.Red;
                
                CurrentChart.DataBind();

               
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }

        }

Open in new window

0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

649 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